Misplaced Pages

Jakarta Messaging: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 09:07, 24 December 2016 editDexbot (talk | contribs)Bots192,602 editsm WP:CHECKWIKI error fix. Section heading problem. Violates WP:MOSHEAD.← Previous edit Revision as of 08:44, 26 December 2016 edit undoYobot (talk | contribs)Bots4,733,870 editsm WP:CHECKWIKI error fixes (Task 16) using AWBNext edit →
Line 1: Line 1:
The '''Java Message Service''' ('''JMS''') ] is a ] ] (MOM) API<ref>Curry, Edward. 2004. . In Middleware for Communications, ed. Qusay H Mahmoud, 1-28. Chichester, England: John Wiley and Sons. {{doi|10.1002/0470862084.ch1}}. ISBN 978-0-470-86206-3</ref> for sending messages between two or more ]. It is an implementation to handle the ]. JMS is a part of the ], and is defined by a specification developed under the ] as JSR 914.<ref name="JSR914"></ref> It is a messaging standard that allows application components based on the Java Enterprise Edition (Java EE) to create, send, receive, and read messages. It allows the communication between different components of a '']'' to be ], reliable, and asynchronous.<ref name="oraclejms"></ref> The '''Java Message Service''' ('''JMS''') ] is a ] ] (MOM) API<ref>Curry, Edward. 2004. . In Middleware for Communications, ed. Qusay H Mahmoud, 1-28. Chichester, England: John Wiley and Sons. {{doi|10.1002/0470862084.ch1}}. ISBN 978-0-470-86206-3</ref> for sending messages between two or more ]. It is an implementation to handle the ]. JMS is a part of the ], and is defined by a specification developed under the ] as JSR 914.<ref name="JSR914"></ref> It is a messaging standard that allows application components based on the Java Enterprise Edition (Java EE) to create, send, receive, and read messages. It allows the communication between different components of a '']'' to be ], reliable, and asynchronous.<ref name="oraclejms"></ref>


== General idea of messaging == == General idea of messaging ==
Line 89: Line 89:


==See also== ==See also==
{{Wikibooks|Java EE Programming|Java Message Service}}
* ] * ]
* ] &mdash; the concept underlying JMS * ] &mdash; the concept underlying JMS
Line 96: Line 95:
* Messaging technologies that do ''not'' implement the JMS API include: * Messaging technologies that do ''not'' implement the JMS API include:
** ] (AMQP) &mdash; standardized message queue protocol with multiple independent implementations ** ] (AMQP) &mdash; standardized message queue protocol with multiple independent implementations
** ] (DDS) &mdash; An ] standardized real-time messaging system with over ten implementations that have demonstrated interoperability between publishers and subscribers ** ] (DDS) &mdash; An ] standardized real-time messaging system with over ten implementations that have demonstrated interoperability between publishers and subscribers


=== ] &mdash; similar technology, implemented for ] === === ] &mdash; similar technology, implemented for ] ===



== Tutorials == == Tutorials ==
Line 121: Line 119:


== External links == == External links ==
{{Wikibooks|Java EE Programming|Java Message Service}}
* *
* *

Revision as of 08:44, 26 December 2016

The Java Message Service (JMS) API is a Java Message Oriented Middleware (MOM) API for sending messages between two or more clients. It is an implementation to handle the Producer-consumer problem. JMS is a part of the Java Platform, Enterprise Edition, and is defined by a specification developed under the Java Community Process as JSR 914. It is a messaging standard that allows application components based on the Java Enterprise Edition (Java EE) to create, send, receive, and read messages. It allows the communication between different components of a distributed application to be loosely coupled, reliable, and asynchronous.

General idea of messaging

See also: Message-oriented middleware and Message passing

Messaging is a form of loosely coupled distributed communication, where in this context the term 'communication' can be understood as an exchange of messages between software components. Message-oriented technologies attempt to relax tightly coupled communication (such as TCP network sockets, CORBA or RMI) by the introduction of an intermediary component. This approach allows software components to communicate 'indirectly' with each other. Benefits of this include message senders not needing to have precise knowledge of their receivers.

The advantages of messaging include the ability to integrate heterogeneous platforms, reduce system bottlenecks, increase scalability, and respond more quickly to change.

Version history

  • JMS 1.0.2b (June 26, 2001)
  • JMS 1.1 (April 12, 2002)
  • JMS 2.0 (May 21, 2013)

JMS 2.0 is maintained under the Java Community Process as JSR 343.

Elements

The following are JMS elements:

JMS provider
An implementation of the JMS interface for a Message Oriented Middleware (MOM). Providers are implemented as either a Java JMS implementation or an adapter to a non-Java MOM.
JMS client
An application or process that produces and/or receives messages.
JMS producer/publisher
A JMS client that creates and sends messages.
JMS consumer/subscriber
A JMS client that receives messages.
JMS message
An object that contains the data being transferred between JMS clients.
JMS queue
A staging area that contains messages that have been sent and are waiting to be read (by only one consumer). Contrary to what the name queue suggests, messages don't have to be received in the order in which they were sent. A JMS queue only guarantees that each message is processed only once.
JMS topic
A distribution mechanism for publishing messages that are delivered to multiple subscribers.

Models

The JMS API supports two models:

Point-to-point model

In the point-to-point messaging system, messages are routed to an individual consumer which maintains a queue of "incoming" messages. This messaging type is built on the concept of message queues, senders, and receivers. Each message is addressed to a specific queue, and the receiving clients extract messages from the queues established to hold their messages. While any number of producers can send messages to the queue, each message is guaranteed to be delivered, and consumed by one consumer. Queues retain all messages sent to them until the messages are consumed or until the messages expire. If no consumers are registered to consume the messages, the queue holds them until a consumer registers to consume them.

Publish/subscribe model

The publish/subscribe model supports publishing messages to a particular message topic. Subscribers may register interest in receiving messages on a particular message topic. In this model, neither the publisher nor the subscriber knows about each other. A good analogy for this is an anonymous bulletin board

  • Zero or more consumers will receive the message.
  • There is a timing dependency between publishers and subscribers. The publisher has to create a message topic for clients to subscribe. The subscriber has to remain continuously active to receive messages, unless it has established a durable subscription. In that case, messages published while the subscriber is not connected will be redistributed whenever it reconnects.

JMS provides a way of separating the application from the transport layer of providing data. The same Java classes can be used to communicate with different JMS providers by using the Java Naming and Directory Interface (JNDI) information for the desired provider. The classes first use a connection factory to connect to the queue or topic, and then use populate and send or publish the messages. On the receiving side, the clients then receive or subscribe to the messages.

URI scheme

RFC 6167 defines a jms: URI scheme for the Java Message Service.

Provider implementations

To use JMS, one must have a JMS provider that can manage the sessions, queues and topics. Starting from Java EE version 1.4, JMS provider has to be contained in all Java EE application servers. This can be implemented using the message inflow management of the Java EE Connector Architecture, which was first made available in that version.

The following is a list of JMS providers:

A historical comparison matrix of JMS providers from 2005 is available at http://www.theserverside.com/reviews/matrix.tss

See also

Microsoft Message Queuing — similar technology, implemented for .NET Framework

Tutorials

References

  1. Curry, Edward. 2004. "Message-Oriented Middleware". In Middleware for Communications, ed. Qusay H Mahmoud, 1-28. Chichester, England: John Wiley and Sons. doi:10.1002/0470862084.ch1. ISBN 978-0-470-86206-3
  2. JSR914 - JMS Spec
  3. ^ Java Message Service (JMS)
  4. Richards et al, pages 3-5
  5. "Apache Qpid™: Open Source AMQP Messaging".
  6. Wallis, Graham. "Choosing a messaging system: WebSphere MQ vs. the WebSphere Application Server Service Integration Bus". IBM developerWorks.

Further reading

  • Richards, Mark; Richard Monson-Haefel; David A. Chappell (2009). Java Message Service, Second Edition. O'Reilly. ISBN 978-0-596-52204-9.

External links

Jakarta EE specifications
Web app
Enterprise app
Web services
Other
Removed
Related
Categories: