Introduction

What is JMS?

It is Java Message Oriented Middleware (MoM) API for sending messages(message is any piece of information in the format the MoM implementation would support) between two or more clients. This API specifications is part of Java Enterprise Edition.

The primary benefits of JMS are:

1. Loose Coupling

2. Asynchronous

3. Reliable: Message will be delivered to once and only once. Lower reliability is also available. Read Reliablity.

Hint: When thinking JMS, think JDBC. It just tell the MoM provider to provide connectivity for Java via standard specifications (JMS).


What is Message Oriented Middleware?

It is infrastructure (hardware or software) that supports sending and receiving messages. That is it. Thus, the advantage of THIS MoM infrastructure is that the (distributed) applications in different OS, supporting different protocols can transparently and in loose coupled fashion, send the messages to other systems. Additionally & optionally, the MoM systems provides (complex) features "Guaranteed Message Delivery", performance, persistence, synchronous/asynchronous options, routing(e.g. broadcasting (topic) or queue, etc), handling multiple input systems (JMS, FTP, HTTP, JDBC, TCP, etc), transformations (one format to another format).

Example: Websphere MQ server, Tibco MQ Server


What is the difference between MoM and Message Broker?

The generally accepted definition of a Message Broker is a higher-level concept that deals more directly with application integration issues (e.g. transformations). A Message Broker is typically built upon a MOM. The MOM provides the base communication among the applications and things like message persistence and guaranteed delivery.

A Message Broker also includes things like a data transformation engine, content-based routing, prepackaged adaptors to ERP systems, business process integration based on a rules engine, and a set of tools for plugging it all together. For some, a Message Broker is viewed as a complete solution; to others, it's viewed as excess baggage.


Can you provide example as Difference between Websphere MQ Server an Websphere Message Broker?

WebSphere MQ is a messaging engine that provides assured delivery of some message/payload. MQ provides a Queue Manager: a server application that hosts Queues (to hold messages) and Channels & Listeners (to allow Queue Managers to communicate with each other). MQ provides an API interface that implements JMS. It also has a number of APIs native to MQ. As of WebSphere MQ version 7.0.1 it also provides a publish-subscribe engine. WebSphere MQ basically lets you put a message in one place and get that message somewhere else with the smallest chance of the message being lost.

WebSphere Message Broker is a program that attempts to provide an any-transport-to-any-transport interface, and an any-language transformation engine. In terms of transports, it provides MQ, JMS (most providers), MQ-FTE, local files, SMPT, FTP/SFTP, HTTP/HTTPS, TCP/TCPSSL, JDBC and probably some other entry hooks I have forgotten. Once the message is in MEssage Broker, you can manipulate that message using ESQL (SQL-like language native to Message Broker), Java, PHP, XSTL. It also contains functionality for message routing, collecting, aggregation, sequencing etc. Message Broker basically allows you to move data from a number of formats (both physical and logical) and manipulate that data before putting it somewhere else, possibly in a different format.


Does JMS specifies Messaging protocol?

No, JMS only provides API specifications (very similar to JDBC). That means it tells Middleware owners to provide a driver that supports JMS API because Java Developers want to use common API to talk to your product.

But API does not limit the protocol of a Message. The message protocol can be AMPQ or ??

References:


JMS vs AMPQ

AMPQ is wire-level protocol for MoM that defines how the format of message, queuing, reliability, security, While JMS is API for Java for MoM. JMS makes sure compatibility with Java library, but AMPQ ensures across platforms.