Giter Site home page Giter Site logo

daishisystems / daishi.amqp Goto Github PK

View Code? Open in Web Editor NEW
81.0 81.0 48.0 806 KB

Microservices SDK for .NET applications

Home Page: http://insidethecpu.com/2015/05/22/microservices-with-c-and-rabbitmq/

License: MIT License

C# 91.58% CSS 1.19% ASP 0.05% HTML 2.32% JavaScript 4.86%

daishi.amqp's People

Contributors

daishisystems avatar gitter-badger avatar

Stargazers

 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  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  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

Watchers

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

daishi.amqp's Issues

Multiple clients re-use the same return queues

Context: the AMQP project, the QueuePool.cs file

Since each MicroService client keeps track of which return queues (GUID named) are used in its own ConcurrentBag, it is inevitable that other clients will also enumerate all GUID named queues and also see them as unused return queues - but blissfully unaware that another client might have started to use a queue.

I suggest that each client has its own pool of return queues - maybe by prefixing each GUID named queue with the client's unique name? In my scenario this should work because I will only have around 10-20 clients (other microservices), each with a unique name - but I'd like to hear other suggestions?

Hardcoding of username and password

In the AMQP's QueuePool.cs there is a hardcoded username and password:
Line 30: var manager = new RabbitMQQueueMetricsManager(false, "localhost", 15672, "paul", "password");

Can we rather read these values from a .config file (e.g. appSettings) ?
Specifically the Servername, Port, Username and Password parameters.

Old messages left in return queue

When a client send a message to a microservice, the client needs to identity a queue to be used for the return message.
The clients gets a "unused" queue from QueuePool.Instance.Get();
But the fact that it is unused is determined by the client keeping track of which return queues are used.
If the previous user of the queue never fetched its message from this queue, the queue might still have a message in it.

I solved this problem by purging the queue everytime I get an "unused" queue from QueuePool.Instance.Get() by doing a channel.QueuePurge(queue.Name)

Change Request

Since the assumption is that when a client gets a new return queue from QueuePool.Instance.Get(), that it would be "ready for use", and empty, would it be possible to make this a default behavior (first purging any potential messages from it) inside QueuePool.Instance.Get() before returning the queue to the client?

adapter.connect errors when using RabbitMQ 4.1.1

After upgrading to 4.1.1 I get the following error. If I downgrade it all works fine again. If you need any more info please don't hesitate

ERROR - Error creating the service bus System.MissingFieldException: Field not found: 'RabbitMQ.Client.ConnectionFactory.HostName'.
at Daishi.AMQP.RabbitMQAdapter.Connect()
<snip....>

       _adapter = RabbitMQAdapter.Instance;
        _adapter.Init("localhost", 5672, "guest", "guest", 50);

        _rabbitMqConsumerCatchAll = new RabbitMQConsumerCatchAll(GlobalResources.Properties.Resources.SurveyorMessageQueueText, 10);
        _rabbitMqConsumerCatchAll.MessageReceived += OnMessageReceived;

        _adapter.Connect();  
        _adapter.ConsumeAsync(_rabbitMqConsumerCatchAll);

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.