RabbitMQ is a widely used and rock-solid messaging framework. In my original post, I outlined how to get started using ScriptCs and ScriptCs.Rebus in particular, I’ll therefore urge the reader to read that post prior to this one.
Besides major refactorings and code clean-up, the two main features of 0.3.0 is support for RabbitMQ and console logging.
Support for RabbitMQ
I’ve been very trying to be very consistent with the original design, and therefore configuring ScriptCs.Rebus for RabbitMQ is very straightforward:
This will configure the bus to use the default RabbitMQ port, amqp://localhost:5672, which requires a local server. This configuration is equivalent to using ScriptCs.Rebus with MSMQ, with additional RabbitMQ features. Usually, a remote server is used, and to supply a connectionstring, use the following configuration:
With this configuration the message of type String will be sent to the remote server. Likewise when you to need receive messages from the remote server, configuration follow the same setup as of the one from MSMQ:
Working with message busses can often be very complex and a blackbox. Since Rebus has a nice and very useful console logging, it makes so much sense to support this as an option for script authors. Console logging is available for both MSMQ and RabbitMQ busses. By default console logging is disabled. To enable console logging, just add UseLogging() to your configuration:
Now console logging is enabled and will output some nice logging like this:
That’s it for 0.3.0, get it, use it, and let me know what you think of it.