Performance Zone is brought to you in partnership with:

Reza Rahman is a former independent consultant, now Java EE/GlassFish evangelist at Oracle. He is the author of the popular book EJB 3 in Action. Reza is a frequent speaker at Java User Groups and conferences worldwide. Reza has been a member of the Java EE, EJB and JMS expert groups. He implemented the EJB container for the Resin open source Java EE application server. All views voiced are my own, not necessarily Oracle's. Reza is a DZone MVB and is not an employee of DZone and has posted 160 posts at DZone. You can read more from them at their website. View Full User Profile

AutoCloseable JMS 2 Resources

03.18.2013
| 3345 views |
  • submit to reddit

As the Java EE 7 release date draws closer, blogs and articles covering the new features are beginning to roll in. In a brief blog entry, John Ament, a key independent member of the JMS 2 expert group talks about AutoCloseable JMS 2 Resources. This feature takes advantage of Java SE 7 try-with-resources to significantly simplify the cleanup of JMS resources such as connections, sessions, message consumers and message producers. This is particularly important in non-Java EE environments where you are not using the new JMSContext API via @Inject. The blog entry includes downloadable JMS 2 code samples. John expects to write many more blog entries covering JMS 2, so stay tuned.

For those unaware, JMS 2 is now in the proposed final draft stage. Feel free to download the draft and take a look at it yourself. There is a very handly What is new in JMS 2.0? section towards the beginning of the document.



Published at DZone with permission of Reza Rahman, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)