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 editContent deleted Content addedVisualWikitext
Revision as of 03:48, 23 September 2019 editMonkbot (talk | contribs)Bots3,695,952 editsm Version history: Task 16: replaced (5×) / removed (0×) deprecated |dead-url= and |deadurl= with |url-status=;Tag: AWB← Previous edit Latest revision as of 09:29, 24 November 2024 edit undoDujo (talk | contribs)Extended confirmed users1,082 edits Provider implementations: Simplify wiki link 
(20 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{Short description|Java application programming interface}}
The '''Java Message TSC Service''' ('''JMS''') ] is a ] ] API for sending messages between two or more ].<ref>Curry, Edward. 2004. {{dead link|date=November 2017 |bot=InternetArchiveBot |fix-attempted=yes }}. 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> It is an implementation to handle the ]. JMS is a part of the ] (Java EE), and was defined by a specification developed at Sun Microsystems, but which has since been guided by the ].<ref>{{cite web |url=https://jcp.org/en/jsr/detail?id=914 |title=JSR 914: Java Message Service (JMS) API |website=The Java Community Process Program |access-date=July 31, 2018}}</ref> It is a messaging standard that allows application components based on 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 '''Jakarta Messaging''' API (formerly '''Java Message Service''' or '''JMS''' API) is a ] ] (API) for ]. It provides generic messaging models, able to handle the ], that can be used to facilitate the sending and receiving of messages between ]s.<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> Jakarta Messaging is a part of ] and was originally defined by a specification developed at Sun Microsystems before being guided by the ].<ref>{{cite web |url=https://jcp.org/en/jsr/detail?id=914 |title=JSR 914: Java Message Service (JMS) API |website=The Java Community Process Program |access-date=July 31, 2018}}</ref>


== General idea of messaging == == General idea of messaging ==
Line 6: Line 7:
Messaging is a form of '']'' 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 ] network ], ] or ]) by the introduction of an intermediary component. This approach allows software components to communicate with each other indirectly. Benefits of this include message senders not needing to have precise knowledge of their receivers. Messaging is a form of '']'' 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 ] network ], ] or ]) by the introduction of an intermediary component. This approach allows software components to communicate with each other indirectly. 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.<ref>Richards et al, pages 3–5</ref> The advantages of messaging include the ability to integrate heterogeneous platforms, reduce system bottlenecks, increase scalability, and respond more quickly to change.<ref>Richards et al., pages 3–5.</ref>


=== Version history === === Version history ===
Line 12: Line 13:
* '''JMS 1.0'''<ref name="jms-101-spec" /> * '''JMS 1.0'''<ref name="jms-101-spec" />
* '''JMS 1.0.1''' (October 5, 1998)<ref name="jms-101-spec">{{cite web |url=http://java.sun.com/products/jms/jms-101-spec.pdf |title=Java Message Service |date=October 5, 1998 |publisher=] |archive-url=https://web.archive.org/web/19990224001845/http://java.sun.com/products/jms/jms-101-spec.pdf |archive-date=1999-02-24 |access-date=July 31, 2018 |url-status=live }}</ref> * '''JMS 1.0.1''' (October 5, 1998)<ref name="jms-101-spec">{{cite web |url=http://java.sun.com/products/jms/jms-101-spec.pdf |title=Java Message Service |date=October 5, 1998 |publisher=] |archive-url=https://web.archive.org/web/19990224001845/http://java.sun.com/products/jms/jms-101-spec.pdf |archive-date=1999-02-24 |access-date=July 31, 2018 |url-status=live }}</ref>
* '''JMS 1.0.1a''' (October 30, 1998)<ref>{{cite web |url=http://java.sun.com/products/jms/docs.html |title=Java Message Service Documentation |date=October 30, 1998 |publisher=Sun Microsystems |archive-url=https://web.archive.org/web/19990224001845/http://java.sun.com/products/jms/docs.html |archive-date=1999-02-24 |access-date=July 31, 2018 |url-status=live }}</ref><ref>{{cite web |url=http://www.javasoft.com/products/jms/jms-101a-src.zip |title=Java Message Service Source - Version 1.0.1a |date=October 29, 1998 |publisher=Sun Microsystems |archive-url=https://web.archive.org/web/20000816170233/http://www.javasoft.com/products/jms/jms-101a-src.zip |archive-date=2000-08-16 |access-date=July 31, 2018 |format=ZIP |url-status=live }}</ref> * '''JMS 1.0.1a''' (October 30, 1998)<ref>{{cite web |url=http://java.sun.com/products/jms/docs.html |title=Java Message Service Documentation |date=October 30, 1998 |publisher=Sun Microsystems |archive-url=https://web.archive.org/web/19990224001845/http://java.sun.com/products/jms/docs.html |archive-date=1999-02-24 |access-date=July 31, 2018 |url-status=live }}</ref><ref>{{cite web |url=http://www.javasoft.com/products/jms/jms-101a-src.zip |title=Java Message Service Source - Version 1.0.1a |date=October 29, 1998 |publisher=Sun Microsystems |archive-url=https://web.archive.org/web/20000816170233/http://www.javasoft.com/products/jms/jms-101a-src.zip |archive-date=August 16, 2000 |access-date=July 31, 2018 |format=ZIP |url-status=dead }}</ref>
* '''JMS 1.0.2''' (December 17, 1999)<ref>{{cite web |url=http://java.sun.com/products/jms/jms1_0_2-spec.pdf |title=Java Message Service |date=November 9, 1999 |publication-date=December 17, 1999 |publisher=Sun Microsystems |archive-url=https://web.archive.org/web/20000823085445/http://java.sun.com/products/jms/jms1_0_2-spec.pdf |archive-date=2000-08-23 |access-date=July 31, 2018 |url-status=live }}</ref> * '''JMS 1.0.2''' (December 17, 1999)<ref>{{cite web |url=http://java.sun.com/products/jms/jms1_0_2-spec.pdf |title=Java Message Service |date=November 9, 1999 |publication-date=December 17, 1999 |publisher=Sun Microsystems |archive-url=https://web.archive.org/web/20000823085445/http://java.sun.com/products/jms/jms1_0_2-spec.pdf |archive-date=2000-08-23 |access-date=July 31, 2018 |url-status=live }}</ref>
* '''JMS 1.0.2a''' (December 23, 1999)<ref>{{cite web |url=http://java.sun.com/products/jms/docs.html |title=Java Message Service Documentation |date=December 23, 1999 |publisher=Sun Microsystems |archive-url=https://web.archive.org/web/20000229161639/http://java.sun.com/products/jms/docs.html |archive-date=2000-02-29 |access-date=July 31, 2018 |url-status=live }}</ref> * '''JMS 1.0.2a''' (December 23, 1999)<ref>{{cite web |url=http://java.sun.com/products/jms/docs.html |title=Java Message Service Documentation |date=December 23, 1999 |publisher=Sun Microsystems |archive-url=https://web.archive.org/web/20000229161639/http://java.sun.com/products/jms/docs.html |archive-date=2000-02-29 |access-date=July 31, 2018 |url-status=live }}</ref>
* '''JMS 1.0.2b''' (August 27, 2001)<ref>{{cite web |url=http://download.oracle.com/otn-pub/jcp/7543-jms-1.0.2b-spec-oth-JSpec/jms-1_0_2b-spec.pdf |title=Java Message Service |date=August 27, 2001 |publisher=Sun Microsystems |access-date=July 31, 2018}}</ref> * '''JMS 1.0.2b''' (August 27, 2001)<ref>{{cite web |url=http://download.oracle.com/otn-pub/jcp/7543-jms-1.0.2b-spec-oth-JSpec/jms-1_0_2b-spec.pdf |archive-url=https://ghostarchive.org/archive/20221009/http://download.oracle.com/otn-pub/jcp/7543-jms-1.0.2b-spec-oth-JSpec/jms-1_0_2b-spec.pdf |archive-date=2022-10-09 |url-status=live |title=Java Message Service |date=August 27, 2001 |publisher=Sun Microsystems |access-date=July 31, 2018}}</ref>
* '''JMS 1.1''' (April 12, 2002)<ref>{{cite web |url=https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms1.1/specification/jms-1_1-fr-spec.pdf |title=Java Message Service |date=April 12, 2002 |publisher=Sun Microsystems |access-date=July 31, 2018}}</ref> * '''JMS 1.1''' (April 12, 2002)<ref>{{cite web |url=https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms1.1/specification/jms-1_1-fr-spec.pdf |archive-url=https://ghostarchive.org/archive/20221009/https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms1.1/specification/jms-1_1-fr-spec.pdf |archive-date=2022-10-09 |url-status=live |title=Java Message Service |date=April 12, 2002 |publisher=Sun Microsystems |access-date=July 31, 2018}}</ref>
* '''JMS 2.0''' (May 21, 2013)<ref>{{cite web |url=https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms2.0/specification/word/JMS20.pdf |title=Java Message Service |date=March 20, 2013 |publisher=] |access-date=July 31, 2018}}</ref><ref>{{cite web |url=https://javaee.github.io/jms-spec/pages/JMS20FinalRelease |title=JMS 2.0 Final Release |date=June 9, 2017 |website=Java Message Service Specification |access-date=July 31, 2018}}</ref> * '''JMS 2.0''' (May 21, 2013)<ref>{{cite web |url=https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms2.0/specification/word/JMS20.pdf |archive-url=https://ghostarchive.org/archive/20221009/https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms2.0/specification/word/JMS20.pdf |archive-date=2022-10-09 |url-status=live |title=Java Message Service |date=March 20, 2013 |publisher=] |access-date=July 31, 2018}}</ref><ref>{{cite web |url=https://javaee.github.io/jms-spec/pages/JMS20FinalRelease |title=JMS 2.0 Final Release |date=June 9, 2017 |website=Java Message Service Specification |access-date=July 31, 2018}}</ref>
* '''JMS 2.0a''' (March 16, 2015)<ref>{{cite web |url=https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms2.0a/specification/word/JMS20.pdf |title=Java Message Service |date=March 10, 2015 |publisher=Oracle |access-date=July 31, 2018}}</ref><ref>{{cite web |url=https://javaee.github.io/jms-spec/pages/JMS20RevA |title=JMS 2.0 errata release (Rev a) |date=July 5, 2017 |website=Java Message Service Specification |access-date=July 31, 2018}}</ref> * '''JMS 2.0a''' (March 16, 2015)<ref>{{cite web |url=https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms2.0a/specification/word/JMS20.pdf |archive-url=https://ghostarchive.org/archive/20221009/https://github.com/javaee/jms-spec/raw/9383d33ff79a156d09fb5c9c0ccdfd6b844b1d54/jms2.0a/specification/word/JMS20.pdf |archive-date=2022-10-09 |url-status=live |title=Java Message Service |date=March 10, 2015 |publisher=Oracle |access-date=July 31, 2018}}</ref><ref>{{cite web |url=https://javaee.github.io/jms-spec/pages/JMS20RevA |title=JMS 2.0 errata release (Rev a) |date=July 5, 2017 |website=Java Message Service Specification |access-date=July 31, 2018}}</ref>


JMS 2.0 is currently maintained under the ] as ] 343.<ref>{{cite web |url=https://jcp.org/en/jsr/detail?id=343 |title=JSR 343: Java Message Service 2.0 |website=The Java Community Process Program |access-date=July 31, 2018}}</ref> JMS 2.0 is currently maintained under the ] as ] 343.<ref>{{cite web |url=https://jcp.org/en/jsr/detail?id=343 |title=JSR 343: Java Message Service 2.0 |website=The Java Community Process Program |access-date=July 31, 2018}}</ref>


JMS 3.0 is as part of . JMS 3.0 is under early development as part of Jakarta EE.<ref>{{cite web |url=https://www.tomitribe.com/blog/jms-3-0-get-involved/ |title=JMS 3.0: Get Involved! |website=Tomitribe |first=Richard |last=Monson-Haefel |date=December 6, 2018 |access-date=July 17, 2020}}</ref>


== Elements == == Elements ==


The following are JMS elements:<ref name="oraclejms"/> The following are JMS elements:<ref name="oraclejms"></ref>


; JMS provider ; JMS provider
Line 57: Line 58:
* 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. * 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 ] of providing data. The same Java ] can be used to communicate with different JMS providers by using the ] (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. JMS provides a way of separating the application from the ] of providing data. The same Java ] can be used to communicate with different JMS providers by using the ] (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 == == URI scheme ==
Line 73: Line 74:


* ]'s * ]'s
* ] * ]
* ]
* ], using ]<ref>{{cite web|title=Apache Qpid™: Open Source AMQP Messaging|url=http://qpid.apache.org/}}</ref> * ], using ]<ref>{{cite web|title=Apache Qpid™: Open Source AMQP Messaging|url=http://qpid.apache.org/}}</ref>
* ] (formerly MQSeries, then WebSphere MQ) * ] (formerly MQSeries, then WebSphere MQ)
* ]'s Service Integration Bus (SIBus)<ref>{{cite web|last=Wallis|first=Graham|title=Choosing a messaging system: WebSphere MQ vs. the WebSphere Application Server Service Integration Bus|url=http://www.ibm.com/developerworks/websphere/library/techarticles/1109_wallis/1109_wallis.html|work=IBM developerWorks}}</ref> * ]'s Service Integration Bus (SIBus)<ref>{{cite web|last=Wallis|first=Graham|title=Choosing a messaging system: WebSphere MQ vs. the WebSphere Application Server Service Integration Bus|url=http://www.ibm.com/developerworks/websphere/library/techarticles/1109_wallis/1109_wallis.html|work=IBM developerWorks}}</ref>
* ] and ] from ] * ] and ] from ]
Line 82: Line 84:
* ] from the OpenJMS Group * ] from the OpenJMS Group
* ] and ] * ] and ]
* PubSub+ from ]
* ] from ] * ] from ]
* ]<ref> {{cite web|title=TIBCO Product Documentation - TIBCO Enterprise Message Service|url=https://docs.tibco.com/products/tibco-enterprise-message-service}}</ref>


==See also== ==See also==
Line 104: Line 108:


{{Wikibooks|Java EE Programming|Java Message Service}} {{Wikibooks|Java EE Programming|Java Message Service}}
* {{Official website}}
* *
* {{Javadoc:EE|package=javax.jms|javax/jms}} API ] documentation * {{Javadoc:EE|package=javax.jms|javax/jms}} API ] documentation
Line 109: Line 114:
* *


{{Java EE 7}} {{Jakarta EE}}


{{DEFAULTSORT:Message Service}}
] ]
] ]

Latest revision as of 09:29, 24 November 2024

Java application programming interface

The Jakarta Messaging API (formerly Java Message Service or JMS API) is a Java application programming interface (API) for message-oriented middleware. It provides generic messaging models, able to handle the producer–consumer problem, that can be used to facilitate the sending and receiving of messages between software systems. Jakarta Messaging is a part of Jakarta EE and was originally defined by a specification developed at Sun Microsystems before being guided by the Java Community Process.

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 with each other indirectly. 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
  • JMS 1.0.1 (October 5, 1998)
  • JMS 1.0.1a (October 30, 1998)
  • JMS 1.0.2 (December 17, 1999)
  • JMS 1.0.2a (December 23, 1999)
  • JMS 1.0.2b (August 27, 2001)
  • JMS 1.1 (April 12, 2002)
  • JMS 2.0 (May 21, 2013)
  • JMS 2.0a (March 16, 2015)

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

JMS 3.0 is under early development as part of Jakarta EE.

Elements

The following are JMS elements:

JMS provider
An implementation of the JMS interface for 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). As the name queue suggests, the messages are delivered in the order sent. A JMS queue 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 distinct models:

  • Point-to-point
  • Publish-and-subscribe

Point-to-point model

Under the point-to-point messaging system, messages are routed to individual consumers who maintain queues 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-and-subscribe model

The publish-and-subscribe model supports publishing messages to a particular message "topic". Subscribers may register interest in receiving messages published 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, a 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 common JMS providers:

See also

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. "JSR 914: Java Message Service (JMS) API". The Java Community Process Program. Retrieved July 31, 2018.
  3. Richards et al., pages 3–5.
  4. ^ "Java Message Service" (PDF). Sun Microsystems. October 5, 1998. Archived (PDF) from the original on 1999-02-24. Retrieved July 31, 2018.
  5. "Java Message Service Documentation". Sun Microsystems. October 30, 1998. Archived from the original on 1999-02-24. Retrieved July 31, 2018.
  6. "Java Message Service Source - Version 1.0.1a". Sun Microsystems. October 29, 1998. Archived from the original (ZIP) on August 16, 2000. Retrieved July 31, 2018.
  7. "Java Message Service" (PDF). Sun Microsystems (published December 17, 1999). November 9, 1999. Archived (PDF) from the original on 2000-08-23. Retrieved July 31, 2018.
  8. "Java Message Service Documentation". Sun Microsystems. December 23, 1999. Archived from the original on 2000-02-29. Retrieved July 31, 2018.
  9. "Java Message Service" (PDF). Sun Microsystems. August 27, 2001. Archived (PDF) from the original on 2022-10-09. Retrieved July 31, 2018.
  10. "Java Message Service" (PDF). Sun Microsystems. April 12, 2002. Archived (PDF) from the original on 2022-10-09. Retrieved July 31, 2018.
  11. "Java Message Service" (PDF). Oracle. March 20, 2013. Archived (PDF) from the original on 2022-10-09. Retrieved July 31, 2018.
  12. "JMS 2.0 Final Release". Java Message Service Specification. June 9, 2017. Retrieved July 31, 2018.
  13. "Java Message Service" (PDF). Oracle. March 10, 2015. Archived (PDF) from the original on 2022-10-09. Retrieved July 31, 2018.
  14. "JMS 2.0 errata release (Rev a)". Java Message Service Specification. July 5, 2017. Retrieved July 31, 2018.
  15. "JSR 343: Java Message Service 2.0". The Java Community Process Program. Retrieved July 31, 2018.
  16. Monson-Haefel, Richard (December 6, 2018). "JMS 3.0: Get Involved!". Tomitribe. Retrieved July 17, 2020.
  17. Java Message Service (JMS)
  18. "Apache Qpid™: Open Source AMQP Messaging".
  19. Wallis, Graham. "Choosing a messaging system: WebSphere MQ vs. the WebSphere Application Server Service Integration Bus". IBM developerWorks.
  20. "TIBCO Product Documentation - TIBCO Enterprise Message Service".

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: