FireAndForget - Easy to configure, asynchronous message bus

07.05.2013 12:00:00 by Norbert Eder

FireAndForget is an easy to configure and lightweight asynchronous message bus. It is accessible via JSON REST API.

Features

Configuration

There is not a lot to configure. All configurations are stored in the app.config of the console application. Per default the Message Bus is executed as a self hosted HTTP container within a console application. The section ServiceBusConfiguration is necessary for FireAndForget to run. There are very important settings:

Message

This is how a message looks like:

{
   "Data":{
      "MessageType":"DefaultTask",
      "Data":"This is some data for the default handler0"
   }
}

Very important is MessageType. This has to match with an executor that handles this kind of messages. Data includes the serialized data for the executor.

API

These are the possible requests for controlling FireAndForget:

Add a message

POST http://localhost:2900/api/v1/enqueue HTTP/1.1
Host: localhost:2900
content-type: application/json
content-length: 72

{
  "Data": {
    "MessageType": "Default",
    "Data": "Muh"
  }
}

Requeue all erroneous tasks

POST http://localhost:2900/api/v1/retry HTTP/1.1
Host: localhost:2900
content-type: application/json
content-length: 0

Requeue all erroneous tasks of a specific queue

POST http://localhost:2900/api/v1/retry/default HTTP/1.1
Host: localhost:2900
content-type: application/json
content-length: 0

There is a test client in the solution to show how it works. It's really simple!

Implement an executor

It is very easy to create your custom executor. All you need is a reference to FireAndForget.Core and implement the interface ITaskExecutor:

public class DefaultTaskExecutor : ITaskExecutor
{
    public string MessageType
    {
        get { return "DefaultTask"; }
    }

    public void Process(string data)
    {
        // Do whatever you need to do
    }
}

After implementation configure your executor in the Executors section within your app.config. To get it work, send a message having a MessageType being equal to your executor's MessageType.

Feedback can be given via @devtyr_com or the G+ community.

Message Service Bus FireAndForget .NET

comments powered by Disqus