RipplesMQ Message Broker Server
RipplesMQ is a simple Message Broker, this library contain the server part, use
Grumpy.RipplesMQ.Client to build services
using RipplesMQ Server.
The goal of the project was to develop an Open Source Message Broker using standard Windows features
as infrastructure. The solution uses the Microsoft Message Queue (MSMQ) for communication and Microsoft
SQL Server (MS-SQL) as persistent layer. It might seem strange to use these components as infrastructure
for a Message Broker, but the reason is that many organizations don’t want extra infrastructure. It might
be difficult for developers to convince management and infrastructure teams to add RabbitMQ, Kafka etc.
to the infrastructure stack. But with this solution the developer can download, install and use a Message
Broker with-out being stopped by the organization.
Secondary use could be for the developer that wants to setup a few Micro Services at home but done want
the extra infrastructure of and other messaging system.
RipplesMQ can run in multiple instances on the same machine and on different machines, the different
instances of RipplesMQ Server, will cooperate on distributing the work and deligating to other instances
when needed. This makes RipplesMQ failover save for most parts.
There is still single point of failure e.g. the common MS-SQL database and MSMQ Locally on a machine.
Features included in the Message Broker:
For Publish/Subscribe the solution can guaranty delivery to all subscribers, this is only for persistent
messages. It will not guaranty delivery order and in theory a message could be delivered twice to the
same subscriber. By using named subscribers you can active a Provide/Consume pattern as one subscriber
with a given name will receive the published message.
The features of RipplesMQ is very similar to the basic features of RabbitMQ, and one of the ideas, when
building this, was that this was an initial Message Broker that could be replaced with RabbitMQ when the
use excited the capabilities of RipplesMQ.
RipplesMQ Message broker will normally use a MS-SQL Database for storing persistent published messages
and keep track of their state on the individual subscribers. It will also use the database for identifying
other instances of the RipplesMQ Message Broker Server. If there is no database connection string in the
configuration for the Message Broker, the server will run without database as a standalone server,
persistent messages will only be in MSMQ and the server cannot find any counterparts to cooperate with.
This could work in a test scenario, but is not recommended for production use.
RipplesMQ Message Broker Server is published as a NuGet packages and the intent is that you implemented
your own service. In the contents folder of the Nuget packages you will find sql and dacpac file for
deploying the database. Alternativly get the source of my implementation of the service at
Grumpy.RipplesMQ.Sample.
var builder = new MessageBrokerBuilder()
.WithServiceName("RipplesMQ.Server")
.WithRepository(@"(localdb)\MSSQLLocalDB", "RipplesMQ");
using (var messageBroker = builder.Build())
{
messageBroker.Start(cancellationToken);
// Keep process alive :-)
messageBroker.Stop();
}
Default ServiceName is the name of the current process.