JMS 2.0 Final Release
JMS 2.0 was finally released on 21 May 2013.
The specification document and API documentation of the JMS 2.0 final release may be downloaded from the JCP website here.
Browse the JMS 2.0 javadocs.
JMS 2.0 was developed by the Java Community Process as JSR 343.
Comments are invited. Reports of possible errors or omissions are especially welcome (note that there has since been an errata release). See Getting involved.
- What’s new in JMS 2.0?
- More information about JMS 2.0
- Reference implementation
- JMS 2.0 tutorial
- JMS 2.0 demonstration examples
- JMS 2.0 schedule (historical)
- Related pages
What’s new in JMS 2.0?
A full list of the new features, changes and clarifications introduced in JMS 2.0 is given in the specification. See section B.5 “Version 2.0” of the “Change history” appendix. Here is a summary:
The JMS 2.0 specification now requires JMS providers to implement both P2P and Pub-Sub.
The following new messaging features have been added in JMS 2.0:
- Delivery delay: a message producer can now specify that a message must not be delivered until after a specified time interval.
- New send methods have been added to allow an application to send messages asynchronously.
- JMS providers must now set the JMSXDeliveryCount message property.
The following change has been made to aid scalability:
- Applications are now permitted to create multiple consumers on the same durable or non-durable topic subscription. In previous versions of JMS only a single consumer was permitted.
Several changes have been made to the JMS API to make it simpler and easier to use:
Sessionand other objects with a
closemethod now implement the
java.jang.AutoCloseableinterface to allow them to be used in a Java SE 7 try-with-resources statement.
- A new “simplified API” has been added which offers a simpler alternative to the standard API, especially in Java EE applications.
- New methods have been added to create a session without the need to supply redundant arguments.
- Although setting client ID remains mandatory when creating an unshared durable subscription, it is optional when creating a shared durable subscription.
- A new method
getBodyhas been added to allow an application to extract the body directly from a Message without the need to cast it first to an appropriate subtype.
A new chapter has been added which describes some additional restrictions and behaviour which apply when using the JMS API in the Java EE web or EJB container. This information was previously only available in the EJB and Java EE platform specifications.
A new chapter has been added which defines a number of standard configuration properties for JMS message-driven beans.
New methods have been added to
Session which return a
MessageConsumer on a durable topic subscription. Applications could previously only obtain a domain-specific
TopicSubscriber, even though its use was discouraged.
The specification has been clarified in various places.
The JMS 2.0 specification was developed by recording each proposed change in an issue tracker. There’s a summary of all issues incorporated into JMS 2.0 on the JMS 2.0 planning page.
More information about JMS 2.0
Watch this 15 minute slide presentation.
Read these two OTN articles by by Nigel Deakin, JSR 343 spec lead:
If, having read about JMS 2.0, you have questions about why it was designed as it was, read the JMS 2.0 design FAQ.
The purpose of a reference implementation is to prove that a specification can be implemented. There are two reference implementations for JMS 2.0.
- The reference implementation for JMS 2.0 in a Java SE environment is based on Open Message Queue 5.0.
- The reference implementation for JMS 2.0 as part of a Java EE 7 application server is based on GlassFish Server Open Source Edition 4.0.
JMS 2.0 tutorial
JMS 2.0 demonstration examples
A NetBeans project which demonstrates some of the new features of JMS 2.0 may be downloaded as a zip or checked out from the project’s GitHub repository here. An earlier version was demonstrated at JavaOne 2012.
This demonstration (which was last updated to work with GlassFish build 82) shows
- Use of the JMS 2.0 simplified API using application-managed
- Use of the JMS 2.0 API using Java EE container-managed (injected)
- Use of the new
receiveBodymethod to synchronously receive a message and return its body in a single method call
- Use of the new
getBodymethod to return the body of a
Messagewithout the need to cast it to a more specific message type
Please report issues with this demonstration using the issue tracker.
JMS 2.0 schedule (historical)
Also see the JMS 2.0 Planning page.
|JSR approval||March 2011||March 2011|
|Expert group formation||March 2011||May 2011|
|Early draft review||Q3 2011||28 Feb - 29 Mar 2012|
|Submission of Public Review Draft to the JCP||19 Dec 2012||19 Dec 2012|
|Start of Public Review||3 Jan 2013||3 Jan 2013|
|End of Public Review||4 Feb 2013||4 Feb 2013|
|Completion of JCP Public Review Ballot||18 Feb 2013||18 Feb 2013|
|Submission of Proposed Final Draft to the JCP||20 Feb 2013||20 Feb 2013|
|Submission of Materials for Final Ballot to the JCP||20 Mar 2013||20 Mar 2013|
|Start of Final Ballot||26 Mar 2013||26 Mar 2013|
|Completion of Final Ballot||8 Apr 2013||8 Apr 2013|
|Release of Spec, RI, TCK||21 May 2013|
This was based on the schedule for the Java EE 7 platform.
- JMS 2.0 Planning. Contains lists of issues that were resolved in JMS 2.0.
- Ten ways in which JMS 2.0 means writing less code
- JMS 2.0 design FAQ
- JMS 2.0 Early Draft
- JMS 2.0 Public Draft
- JMS 2.0 Proposed Final Draft
- JMS 2.0 errata release (Rev a)
- How to join the JSR 343 (JMS 2.0) Expert group (Retained for historical purposes only)
- Proposals for the injection of JMSContext objects (Discussion of various alternative options: retained for historical purposes only)