A Rudimentary Message Queue for Windows

RudyMQ is a lightweight message queue for Windows built using .NET and WCF that you may want to consider if you don't need the enterprise grade features of MSMQ and don't want to deal with all of its tantrums and oh-so-friendly error messages. It supports persistent messages and also comes with its own WCF binding.
Getting Started
  • To install or host the server:
    • Download, install and configure the server installation (see Server Installation), or:
    • Download the NuGet package RudyMQ.Service and add to your hosting application (see Self Hosting).

  • To talk to an existing instance:
    • Download the NuGet package RudyMQ.Client and add to your application.
    • Access the queue API directly (see Queue API) or use the WCF binding provided (see WCF Binding)
Server Installation
  • Make sure .NET 4.5 is installed on your system.
  • Download the server installation here.
  • Extract the files.
  • If you want to, make changes to the AK.RudyMQ.Service.Host.exe.config file as needed. Instructions can be found inside the file itself.
  • Run Install.cmd.
  • A new service for RudyMQ should be registered which you can now start like any other service.
Self Hosting
  • Add the NuGet package RudyMQ.Service to your hosting application (which may be a web application, a Windows or console application, an Azure worker role - whatever).
  • Use the QueueHost class to instantiate and listen.
  • Example:
using (var queueHost = new QueueHost(hostName, port, baseAddress,
	catalogLocation, persistLocation, transitLocation,
	transitCleanupInterval, transitMaximumAge))

    // ...
Queue API
  • Add the NuGet package RudyMQ.Client to your application.
  • You can send or receive typed messages. Message types can be any simple and serializable data structure. It needs to be marked as Serializable.
  • Sending a message:
var conn = MessageQueue.Connect(hostName, port, baseAddress);
var queue = conn.Get("MyQueue");

var message = new MyMessage { ... };
  • Receiving a message:
// Here, receiveOperation is IDisposable. You can call Stop on it, or just Dispose it,
// use it inside a using block, whatever, when you want to stop receiving.

var receiveOperation = queue.StartReceiving<MyMessage>(100, /* poll every 100 ms */
    message =>
        // Handle received message here.

    }, exception =>
        // Handle exception here.

  • Other operations:
conn.Create("MyQueue", true, false); // Create a new queue.
conn.Remove("ExistingQueue"); // Remove an existing queue.

queue.Purge<MyMessage>(); // Remove all messages of type MyMessage from the queue.
queue.PurgeAll(); // Remove all messages from the queue.
WCF Binding
  • Just as with MSMQ, you can use RudyMQ as a transport mechanism for one-way WCF operations.
  • The binding is part of the RudyMQ.Client package.
  • The endpoint address is of the form net.rudymq://hostname:port/baseAddress/queueName
  • Example server side WCF configuration:
            <add name="rudyMqBinding" type="AK.RudyMQ.Client.ServiceModel.RudyMqBindingSection, AK.RudyMQ.Client"/>
        <service name="...">
            <endpoint address="net.rudymq://..." binding="rudyMqBinding" contract="..." />
  • Example client side WCF configuration:
            <add name="rudyMqBinding" type="AK.RudyMQ.Client.ServiceModel.RudyMqBindingSection, AK.RudyMQ.Client"/>
        <endpoint address="net.rudymq://..." binding="rudyMqBinding" contract="..." />
  • Example server side when done programmatically:
using (var serviceHost = new ServiceHost(...))
    serviceHost.AddServiceEndpoint(..., new RudyMqBinding(), "net.rudymq://...");
  • Example client side when done programmatically:
var proxy = new ServiceProxyClass(new RudyMqBinding(), "net.rudymq://...");
Terms of Use
  • The server installation as well as the NuGet packages are free to download and use.
  • The source code is provided under the GPL v3 License. You can see it here.
  • As with most things free, do not blame me if running this blows up your computer or infects you with Hepatitis.
  • If there are legit issues, please do log a GitHub issue.
  • These are downloads and libraries, not hosted solutions.
  • Nowhere does RudyMQ ask you for or store any personal information.
  • The page you're looking at right now has a rudimentary Google Analytics scriptlet.
  • Identifiable information related to usage and download of the server installation is not tracked as far as I know (unless Google Analytics is doing something I am unaware of).
  • Download of the NuGet package is not tracked except the NuGet download counter itself.