


no checked exceptions – just JMSRuntimeException,.JMSContext is a new object that combines Connection and Session capabilities it can be injected by the container,.Let’s take a look at few JMS 2.0 features used in this example: Responsibilities can be moved to the container to ease developer’s life, so why not doing it? That’s it – that’s all this method is about.Įxception handling, connection and session creation, message type – everything is done for us. It’s much easier to figure out what this method is doing: it creates a payload and sends it to the queue. To use Java EE 7 API I needed to add following Maven public class JMS11Producer I’ve configured it under the jms/queue/myqueue JNDI name.
#Glassfish blogspot code#
To be able to run this code you should create a sample queue. (SLSB and MDB) and pushed it to my github repository here. I’ve prepared a simple web application that uses JMS 2.0, JAX-RS and EJB I wanted to take a look what’s new in JMS world and how it allows me toĬode easier and in more maintainable way. Ok, but let’s get back to the main subject. That’s why they encourage you to use (true, 0) parameter values to avoid unnecessary confusion. What does it all means? Nothing less than: those arguments doesn’t have any sense for JMS producer used in Java EEĬontext. Seriously, integersĬonstants makes the API seems sooo legacy.įinally, what is a meaning of those parameters in Java EE environment? JavaDoc says that acknowledgeMode is ignored Second method argument ( acknowledgeMode) is an integer constant taken from Session object. We can choose if transactions are supported (default) or not. JMS has a lot of weird stuff like: Connection#createSession(boolean transacted, int acknowledgeMode) method.įirst method argument ( transacted) defines if the session should be transacted. Interesting improvements were introduced since version 1.1. One of the specifications that constitutes Java EE 7 is JMS 2.0. This means that soon we should have Java EE 7Īpplication servers available on the market. Java EE 7 has been recently accepted by the Executive Committee.

Tags: EJB, glassfish, javaee7, jax-rs, jms Piotr Nowicki's Blog Piotr Nowicki's Blog About Java EE 7 - JMS 2.0 With Glassfish v4
