Super simple service bus manager
C# Smalltalk
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.nuget
src
.gitignore
Ariane.sln
README.md
changelog.txt

README.md

Welcome to Ariane (4.0.47.0)

Ariane is a super simple bus manager for asynchronous messages based on type or dynamic objects for later treatment, Ariane manage queueing system in one place with one thread by queue and multi readers by queue

List of queue provider

  • In Memory
  • MSMQ
  • Azure Service Bus
  • File System
  • Custom...

Installing

You can download http://nuget.org/packages/Ariane from NuGet in Visual Studio, With Package Manager Console type:

PM> Install-Package Ariane

Example

  • Client
Get service bus
var bus = new Ariane.BusManager(); 
Register the writer with name or configuration file
bus.Register.AddMemoryWriter("test"); 
Create message
var person = new Person();
person.FirsName = i.ToString();
person.LastName = Guid.NewGuid().ToString();
Send typed message or dynamic
bus.Send("test", person);
  • Server
Get service bus
var bus = new Ariane.BusManager(); 
Register concrete reader
bus.Register.AddMemoryReader("test", typeof(PersonMessageReader)); 
or register anonymous reader
bus.Register.AddMemoryReader<Person>("test", (message) => {
     Console.WriteLine("{0}:{1}", System.Threading.Thread.CurrentThread.Name, message.FirsName);
}); 
Start reading
bus.StartReading(); 
Receive message from dedicated thread
public class PersonMessageReader : MessageReaderBase<Person>
{
    public override void ProcessMessage(Person message)
    {
        Console.WriteLine("{0}:{1}", System.Threading.Thread.CurrentThread.Name, message.FirsName);
    }
}

Using dynamic and anonymous reader in memory

var bus = new Ariane.ServiceBus();

bus.Register.AddMemoryReader<System.Dynamic.ExpandoObject>("queueName", (p) =>
{
     Console.WriteLine("person : {0} {1}", p.FirstName, p.LastName);
}); 

dynamic person = bus.CreateMessage("person");
person.FirstName = "ftest";
person.LastName = "ltest";

bus.Send("queueName", person);