/Daishi.AMQP

Microservices SDK for .NET applications

Primary LanguageC#MIT LicenseMIT

Image of insidethecpu

Microservices SDK for .NET applications

Join the chat at https://gitter.im/daishisystems/Daishi.AMQP Build status NuGet

As seen on visualstudiomagazine.com.

Microservices are groupings of lightweight services, interconnected, although independent of each other, without direct coupling or dependency. Microservices allow flexibility in terms of infrastructure; application traffic is routed to collections of services that may be distributed across CPU, disk, machine and network as opposed to a single monolithic platform designed to manage all traffic.

Click here for an in-depth tutorial on building Microservices using this framework. Image of Microservices as Gears

Installation

PM> Install-Package Daishi.AMQP

Sample Code

Connect to RabbitMQ

var adapter = RabbitMQAdapter.Instance;
 
adapter.Init("hostName", 1234, "userName", "password", 50);
adapter.Connect();

Send a Message

var message = "Hello, World!";
adapter.Publish(message, "queueName");

Retrieve a Message

string output;
BasicDeliverEventArgs eventArgs;

adapter.TryGetNextMessage("queueName", out output, out eventArgs, 50);

Continuously Poll for Messages

var consumer = new RabbitMQConsumerCatchAll("queueName", 10);
adapter.ConsumeAsync(consumer);
 
Console.ReadLine();
adapter.StopConsumingAsync(consumer);

Contact the Developer

Please reach out and contact me for questions, suggestions, or to just talk tech in general.

RSSTwitterLinkedInGoogle+YouTube