mail2deenesh / Daishi.AMQP

Microservices SDK for .NET applications

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Microservices SDK for .NET applications

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

License:MIT License


Languages

Language:C# 91.6%Language:JavaScript 4.9%Language:HTML 2.3%Language:CSS 1.2%Language:ASP 0.1%