Introduction to JMS.ActiveMQ, HornetQ, IBM WebSphere MQ and others… Author: Vadim Lotar Lohika (2012)
Agenda • What is JMS? • JMS Key Elements • JMS Messaging Domains • JMS Message Types • When Can You Use the JMS API? • Overview of existing Implementations • Demo • Q&A
What is JMS? • JMS API is a part of the Java Platform (Enterprise Edition). JSR 914. • A specification that describes a common way for Java programs to create, send, receive and read distributed enterprise messages • loosely coupled communication • Asynchronous messaging • Reliable delivery • A message is guaranteed to be delivered once and only once.
JMS Messaging Domains • Point-to-Point (PTP) • built around the concept of message queues • each message has only one consumer
JMS Messaging Domains • Publish-Subscribe systems • uses a “topic” to send and receive messages • each message has multiple consumers
JMS Message Types
When Can You Use the JMS API? • The provider wants the components not to depend on information about other components interfaces, so that components can be easily replaced. • The provider wants the application to run whether or not all components are up and running simultaneously. • The application business model allows a component to send information to another and to continue to operate without receiving an immediate response.
ActiveMQ • HIGHLY configurable • You can choose a message store • Has lots of clustering options • Network of brokers • Scaling • Transactions • Active MQ crashes fairly frequently • Less performant as compared to RabbitMQ
HornetQ • Written in Java • JMS and above • Superb performance • POJO-based design • Solid high availability • Flexible clustering • Management • Documentation & Examples
WebSphere MQ• Not free!!! Money, money, money…• Works on all common platforms• Messages will be delivered once and once only• Data should never be lost• Message is not just text, it’s something more…
• No ONCE-ONLY semantics• Multiple consumers can be configured for a single queue• Unordered• Failed messages are re-tried almost immediately• It will use only it’s own DB• Clustering• Transactions
Apache qpid • Transactions • HIGHLY configurable • Management using JMX • Supports message Priorities • Automatic client failover using configurable connection properties • Clustering • Has bindings in many languages
ZeroMQ • http://www.slideshare.net/pieterh/overview-of-zeromq • Many kinds of connection patterns • Multiplatform, multi-language(30+) • Fast • Small(20K lines of C++ code) • Open source LGPL(large community) • Easy to experiment and learn • Scalable to any number of cores