iron-io / iron_dotnet Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Response from server:
msg=In JSON, cannot use array as object
I just realised the correct posted param would be
{} instead of []
The code
var config = new IronClientConfig { Token = "...", ProjectId = "..." };
IronMqRestClient client = Client.New(config);
throws exception System.MissingMethodException
with the message Method not found: 'Common.Logging.ILog Common.Logging.LogManager.GetCurrentClassLogger()'.
I have installed the package from NuGet. This is my packages.config:
<packages>
<package id="Common.Logging" version="3.0.0" targetFramework="net45" />
<package id="Common.Logging.Core" version="3.0.0" targetFramework="net45" />
<package id="Iron.IronCore" version="1.0.2" targetFramework="net45" />
<package id="Iron.IronMQ" version="1.0.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="5.0.1" targetFramework="net45" />
</packages>
The project is a console application running .NET 4.5 in Visual Studio 2013
as soon as it reaches the first line of below code it is raising an exception which I given below
(by the way im using latest ironmq from nuget with .net 4.5 framework)
IronMqRestClient ironMqRestClient = Client.New(new IronClientConfig
{
ProjectId = ConfigurationManager.AppSettings[IronMqProjectIdConfigKey],
Token = ConfigurationManager.AppSettings[IronMqUserTokenConfigKey],
ApiVersion = 3,
Host = ConfigurationManager.AppSettings[IronMqHostConfigKey],
Scheme = ConfigurationManager.AppSettings[IronMqHostSchemeConfigKey],
Port = string.IsNullOrEmpty(port) ? 8080 : Convert.ToInt32(port)
});
_queueClient = ironMqRestClient.Queue(ConfigurationManager.AppSettings[IronMqMessageQueueNameConfigKey]);
throws exception System.MissingMethodException with the message Method not found: 'Common.Logging.ILog Common.Logging.LogManager.GetCurrentClassLogger()'.
When I run the program file after changing the project and token settings an error happens as follows
"No connection could be made because the target machine actively refused it 52.16.102.22:8080"
My Request as follows:
{Method: POST, RequestUri: 'http://mq-aws-eu-west-1-1.iron.io:8080 /3/projects/************/queues/NotifierQueue/messages', Version: 1.1, Content: IronSharp.Core.JsonContent, Headers:
{
Authorization: OAuth yRPG3-J9qjCdfWWHvZb7eyBF3wo
Accept-Encoding: gzip
Accept-Encoding: deflate
Accept: appliction/json
Content-Type: application/json
Content-Length: 35
}}
I entered the projectId, host and token infos from the iron.json file.
Thank you.
I'm getting a bad request when trying to create a pull queue because your QueueInfo is serialising incorrectly. If I create a simple new queue request (using a new QueueInfo where the only property I set it PushType to a value PushType.Pull) then my the request looks like this:
{"alerts":[],"push_type":"push","Alerts":[]}
Your protected PushTypeValue getter is returning "push" instead of "pull" for PushType.Pull. It also looks like your public accessor for Alerts is missing a JsonIgnore attribute so isn't being excluded from serialisation either.
System.InvalidOperationException: The request message was already sent. Cannot send the same request message multiple times.
в System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
в IronSharp.Core.RestClient.AttemptRequest(IronSharpConfig sharpConfig, HttpRequestMessage request, Int32 attempt) в c:\Users\admin\Documents\GitHub\iron_dotnet\src\IronSharp.Core\RestClient.cs:строка 140
в IronSharp.Core.RestClient.AttemptRequest(IronSharpConfig sharpConfig, HttpRequestMessage request, Int32 attempt) в c:\Users\admin\Documents\GitHub\iron_dotnet\src\IronSharp.Core\RestClient.cs:строка 161
в IronSharp.Core.RestClient.Post[T](IronClientConfig config, String endPoint, Object payload, NameValueCollection query) в c:\Users\admin\Documents\GitHub\iron_dotnet\src\IronSharp.Core\RestClient.cs:строка 94
в IronSharp.IronMQ.QueueClient.Post(QueueMessage message) в c:\Users\admin\Documents\GitHub\iron_dotnet\src\IronSharp.IronMQ\QueueClient.cs:строка 459
Touch(string messageId, string reservationId = null)
must require reservation ID. Only reserved messages can be touched.Delete(string messageId, string subscriberId)
must accept subscriber name and reservation, does not accept subscriber ID, because this field does not exist in v3. Endpoint format is /#{QueueName}/messages/#{MessageId}
, HTTP verb is DELETE. JSON body must contain reservation_id
and subscriber_name
fields. See documentation.You can specify host settings in iron.json or explicitly in code, for example:
var iromMq = IronSharp.IronMQ.Client.New(new IronClientConfig {
ProjectId = "XXXXXXX", Token = "YYYYYYY",
Host = "localhost", Scheme = "http", Port = 8080});
The code example contains Host = "localhost", Scheme = "http", Port = 8080
This had me confused for a while before I realized I needed to replace localhost with the URL to the queue and port to 80.
I only figured it out after looking at the Java docs which states:
{
"token": "m6000000000000000000RJ",
"project_id": "54000000000000000000000d",
"scheme": "http",
"host": "mq-aws-us-east-1-1.iron.io",
"port": 80
}
IMO, you should copy some of the Java docs to the .NET docs here as they are more to the point.
Just my 2 cents.
No long poll happens, it just returns immediately with an empty result as if you werent long polling.
I have created a pull request with a fix, it was a very simple bug.
Thanks for merging my pull request with the long polling fix.
Could you also update the nuget package? https://www.nuget.org/packages/Iron.IronMQ/
I think the AssemblyVersion and AssemblyFileVersion needs to be updated too.
There is a pull request for adding deadletter queue info.
It would be nice to get that merged in and get it published to Nuget.
var message = await mqClient.GetAsync();
In the original IronSharp project, the API is currently only supporting awaitable calls.
If we wanted to support the possible call models (Async, Sync, FireAndForget), I thought of an idea of doing something like:
IronTask postTask = mqClient.Post(...params...);
var syncResult = postTask .Send();
var asycResult = await postTask.SendAsync();
postTask.FireAndForget();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.