Chapter 7. Asynchronous messaging
This chapter covers
- Using ActiveMQ and Stomp
- Using reliable-msg
- Using WebSphere MQ
Asynchronous messaging is one of the most effective ways of building a loosely coupled system while maintaining a sense of coherence in the system. Coupling the publish/subscribe architecture with a reliable delivery broker gives you a solid architecture for integration with heterogeneous (or homogeneous) systems. In this chapter, we’ll look at a few options for asynchronous messaging in Ruby, including how to integrate these solutions with Rails. We’ll start with two open source messaging servers, ActiveMQ and Ruby-native reliable-msg, before moving on to WMQ, the granddaddy of message-oriented middleware.
When building an application that requires asynchronous messaging, open source messaging servers are a compelling option. In this section, we’ll take a look at two such options. The first, ActiveMQ (available from http://activemq.apache.org) is a Java-based messaging middleware developed by the Apache Software Foundation. It’s a popular mid-size solution attractive not only for its price tag (free!) but also for packing the right combination of features and performance while requiring minimal setup and administration. The second, reliable-msg, is a pure-Ruby implementation suitable for small-scale deployments.