Giter Site home page Giter Site logo

iron_dotnet's People

Contributors

alex-litvak avatar bobend avatar d-kononov avatar edsrzf avatar iiiheloiii avatar mchadrdk avatar pyeremenko avatar rkononov avatar stephenitis avatar sunloverz avatar treeder avatar vasilev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iron_dotnet's Issues

Throws exception when trying to create client

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

Could not load type 'System.Web.Hosting.HostingEnvironment'

Hi,

The next error I get when I want to start the IronClientConfig inside a POST httpmethod.

"{error:Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.}"

image

Throws exception when trying to create client

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()'.

Demo.Ironsharp not working

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.

QueueInfo serialisation causes bad request

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.

V3 version failing with "The request message was already sent"

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

Non intuitive info on the readme.md here

On the start page here (readme.md)

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.

Long polling doesn't work

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.

#54

API methods should support the awaitable Task based Async/Await keywords

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();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.