SlideShare uma empresa Scribd logo
1 de 60
Baixar para ler offline
Graphic Section Divider 
Copyright © 2013, Oracle and/or its affiliates. 1 All rights reserved.
Easier Messaging 
with JMS 2.0 
Jagadish Ramu 
Application Server Group 
Oracle 
Copyright © 2013, Oracle and/or its affiliates. 2 All rights reserved.
The following is intended to outline our general product direction. It is intended 
for information purposes only, and may not be incorporated into any contract. 
It is not a commitment to deliver any material, code, or functionality, and should 
not be relied upon in making purchasing decisions. The development, release, 
and timing of any features or functionality described for Oracle’s products 
remains at the sole discretion of Oracle. 
Copyright © 2013, Oracle and/or its affiliates. 3 All rights reserved.
Java Message Service (JMS) 
l A Java API for sending and receiving messages 
l Many competing implementations 
l Two distinct API variants 
l Java SE applications 
l Java EE applications – adds additional features 
l JTA (XA) transactions 
l Replaces async MessageListener with MDBs, 
l Injection of connection factories and destinations using 
@Resource 
l (New!) Injection and management of JMSContext objects 
Copyright © 2013, Oracle and/or its affiliates. 4 All rights reserved.
What JMS is and isn't 
A standard API 
Not a messaging system in itself 
Not a wire protocol 
Defines Java API only 
Doesn't define API for non-Java clients (e.g. C++, HTTP) - but many 
implementations do 
An application API 
Not (currently) an admin, management or monitoring API 
Copyright © 2013, Oracle and/or its affiliates. 5 All rights reserved.
JMS 2.0 
JMS 1.1 (2002) 
Dozens of implementations, both standalone and as part of a full 
Java EE provider 
JMS 2.0 (2013) 
Launched in 2011 as JSR 343 
Released in 2013 with Java EE 7 
Available in Open Message Queue 5.0 (standalone JMS provider) 
and in GlassFish 4.0 (full Java EE provider) 
Other implementations announced or in progress 
Copyright © 2013, Oracle and/or its affiliates. 6 All rights reserved.
What's new in JMS 2.0 
l Simpler and easier to use 
l New messaging features 
l Better Java EE integration 
l Define differences between JMS in SE and EE more 
clearly 
l Simpler resource configuration 
l Standardized configuration of JMS MDBs 
l Minor corrections and clarifications 
Copyright © 2013, Oracle and/or its affiliates. 7 All rights reserved.
JMS 2.0 
Simpler and easier to use 
Copyright © 2013, Oracle and/or its affiliates. 8 All rights reserved.
JMS API simplifications 
Twin-track strategy 
l Make minor simplifications to existing standard API where it won't 
break compatibility 
l Define new simplified API requiring fewer objects 
JMSContext, JMSProducer, JMSConsumer 
In Java EE, allow JMSContext to be injected and managed by the 
container 
Copyright © 2013, Oracle and/or its affiliates. 9 All rights reserved.
Why did JMS 1.1 
need simplifying? 
Copyright © 2013, Oracle and/or its affiliates. 10 All rights reserved.
JMS 1.1: Sending a message 
@Resource(lookup = "java:global/jms/demoConnectionFactory") 
ConnectionFactory connectionFactory; 
@Resource(lookup = "java:global/jms/demoQueue") 
Queue demoQueue; 
public void sendMessage(String payload) { 
try { 
Connection connection = connectionFactory.createConnection(); 
try { 
Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); 
MessageProducer messageProducer = session.createProducer(demoQueue); 
TextMessage textMessage = session.createTextMessage(payload); 
messageProducer.send(textMessage); 
} finally { 
connection.close(); 
} 
} catch (JMSException ex) { 
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 11 All rights reserved. 
13 lines of 
code just 
to send a 
message
JMS 1.1: Sending a message 
@Resource(lookup = "java:global/jms/demoConnectionFactory") 
ConnectionFactory connectionFactory; 
@Resource(lookup = "java:global/jms/demoQueue") 
Queue demoQueue; 
public void sendMessage(String payload) { 
try { 
Connection connection = connectionFactory.createConnection(); 
try { 
Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); 
MessageProducer messageProducer = session.createProducer(demoQueue); 
TextMessage textMessage = session.createTextMessage(payload); 
messageProducer.send(textMessage); 
} finally { 
connection.close(); 
} 
} catch (JMSException ex) { 
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 12 All rights reserved. 
must create 
several 
intermediate 
objects
JMS 1.1: Sending a message 
@Resource(lookup = "java:global/jms/demoConnectionFactory") 
ConnectionFactory connectionFactory; 
@Resource(lookup = "java:global/jms/demoQueue") 
Queue demoQueue; 
public void sendMessage(String payload) { 
try { 
Connection connection = connectionFactory.createConnection(); 
try { 
Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); 
MessageProducer messageProducer = session.createProducer(demoQueue); 
TextMessage textMessage = session.createTextMessage(payload); 
messageProducer.send(textMessage); 
} finally { 
connection.close(); 
} 
} catch (JMSException ex) { 
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 13 All rights reserved. 
redundant 
and 
misleading 
arguments
JMS 1.1: Sending a message 
@Resource(lookup = "java:global/jms/demoConnectionFactory") 
ConnectionFactory connectionFactory; 
@Resource(lookup = "java:global/jms/demoQueue") 
Queue demoQueue; 
public void sendMessage(String payload) { 
try { 
Connection connection = connectionFactory.createConnection(); 
try { 
Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); 
MessageProducer messageProducer = session.createProducer(demoQueue); 
TextMessage textMessage = session.createTextMessage(payload); 
messageProducer.send(textMessage); 
} finally { 
connection.close(); 
} 
} catch (JMSException ex) { 
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 14 All rights reserved. 
must 
close 
resources 
after use!
JMS 1.1: Sending a message 
@Resource(lookup = "java:global/jms/demoConnectionFactory") 
ConnectionFactory connectionFactory; 
@Resource(lookup = "java:global/jms/demoQueue") 
Queue demoQueue; 
public void sendMessage(String payload) { 
try { 
Connection connection = connectionFactory.createConnection(); 
try { 
Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); 
MessageProducer messageProducer = session.createProducer(demoQueue); 
TextMessage textMessage = session.createTextMessage(payload); 
messageProducer.send(textMessage); 
} finally { 
connection.close(); 
} 
} catch (JMSException ex) { 
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 15 All rights reserved. 
all 
methods 
throw 
checked 
exceptions
Minor simplifications to the 
existing standard API 
Copyright © 2013, Oracle and/or its affiliates. 16 All rights reserved.
Minor simplifications to the standard API 
Simpler API to create a Session 
Methods on javax.jms.Connection to create a Session: 
l JMS 1.1 method remains 
connection.createSession(transacted, 
acknowledgeMode) 
l New method combines two parameters into one: 
connection.createSession(sessionMode) 
l New method mainly for Java EE 
connection.createSession() 
Session.SESSION_TRANSACTED Session.AUTO_ACKNOWLEDGE, 
Session.CLIENT_ACKNOWLEDGE Session.DUPS_OK_ACKNOWLEDGE 
Copyright © 2013, Oracle and/or its affiliates. 17 All rights reserved.
Minor simplifications to the standard API 
Simpler API to close JMS objects 
l Make JMS objects implement java.jang.AutoCloseable 
Connection 
Session 
MessageProducer 
MessageConsumer 
QueueBrowser 
l Requires Java SE 7 
Copyright © 2013, Oracle and/or its affiliates. 18 All rights reserved.
Minor simplifications to the standard JMS API 
Simpler API to close JMS objects 
@Resource(lookup = "jms/connFactory") 
ConnectionFactory cf; 
@Resource(lookup="jms/inboundQueue") 
Destination dest; 
Create closeable 
resources in a 
try-with-resources 
Make JMS objects implement java.jang.AutoCloseable 
Connection, Session, MessageProducer, 
MessageConsumer, QueueBrowser 
public void sendMessage (String payload) throws JMSException { 
try ( Connection conn = connectionFactory.createConnection(); 
Session session = conn.createSession(); 
MessageProducer producer = session.createProducer(dest); 
){ 
Message mess = sess.createTextMessage(payload); 
producer.send(mess); 
} catch(JMSException e){ 
// exception handling 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 19 All rights reserved. 
block 
close() is called 
automatically 
at end of block
Completely new 
simplified API 
Copyright © 2013, Oracle and/or its affiliates. 20 All rights reserved.
Completely new simplified API 
Introducing JMSContext and JMSProducer 
@Resource(lookup = "java:global/jms/demoConnectionFactory") 
ConnectionFactory connectionFactory; 
@Resource(lookup = "java:global/jms/demoQueue") 
Queue demoQueue; 
public void sendMessageNew(String payload) { 
try (JMSContext context = connectionFactory.createContext();){ 
context.createProducer().send(demoQueue, payload); 
} catch (JMSRuntimeException ex) { 
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 21 All rights reserved. 
13 lines 
reduced 
to 5
Completely new simplified API 
Introducing JMSContext and JMSProducer 
@Resource(lookup = "java:global/jms/demoConnectionFactory") 
ConnectionFactory connectionFactory; 
@Resource(lookup = "java:global/jms/demoQueue") 
Queue demoQueue; 
public void sendMessageNew(String payload) { 
try (JMSContext context = connectionFactory.createContext();){ 
context.createProducer().send(demoQueue, payload); 
} catch (JMSRuntimeException ex) { 
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 22 All rights reserved. 
JMSContext 
combines 
Connection 
and Session 
Payload 
can be 
sent 
directly
JMSContext (1/2) 
l A new object which encapsulates a Connection, a Session and an 
anonymous MessageProducer 
l Created from a ConnectionFactory 
JMSContext context = connectionFactory.createContext(sessionMode); 
l Call close() after use, or create in a try-with-resources block 
l Can also be injected (into a Java EE web or EJB application) 
Copyright © 2013, Oracle and/or its affiliates. 23 All rights reserved.
JMSContext (2/2) 
l Can also create from an existing JMSContext 
(to reuse its connection – Java SE only) 
JMSContext context2 = context1.createContext(sessionMode); 
l Used to create JMSProducer objects for sending messages 
l Used to create JMSConsumer objects for receiving messages 
l Methods on JMSContext, JMSProducer and JMSConsumer throw only 
unchecked exceptions 
Copyright © 2013, Oracle and/or its affiliates. 24 All rights reserved.
JMSProducer 
Messages are sent by creating a JMSProducer object 
Does not encapsulate a MessageProducer so is lightweight 
Supports method chaining for a fluid style 
JMS 1.1 
MessageProducer producer = session.createProducer(); 
producer.send(destination,message); 
JMS 2.0 
JMSProducer producer = context.createProducer(); 
producer.send(destination,message); 
Copyright © 2013, Oracle and/or its affiliates. 25 All rights reserved.
JMSProducer 
Setting message delivery options using method chaining 
JMS 1.1 
MessageProducer producer = session.createProducer(); 
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); 
producer.setPriority(1); 
producer.setTimeToLive(1000); 
producer.send(destination,message); 
JMS 2.0 
context.createProducer().setDeliveryMode(DeliveryMode.NON_PERSISTENT). 
setPriority(1).setTimeToLive(1000).send(destination,message); 
Copyright © 2013, Oracle and/or its affiliates. 26 All rights reserved.
JMSProducer 
Setting message properties and headers 
JMS 1.1 (need to set on the message) 
MessageProducer producer = session.createProducer(); 
TextMessage textMessage = session.createTextMessage("Hello); 
textMessage.setStringProperty("foo","bar"); 
producer.send(destination,message); 
JMS 2.0 (can also set on the JMSProducer) 
context.createProducer().setProperty("foo","bar").send(destination,"Hello"); 
Copyright © 2013, Oracle and/or its affiliates. 27 All rights reserved.
JMSProducer 
Sending message bodies directly 
Methods on JMSProducer to send a Message 
send(Destination dest, Message message) 
No need to create a Message 
send(Destination dest, Map<String,Object> payload) 
send(Destination dest, Serializable payload) 
send(Destination dest, String payload) 
send(Destination dest, byte[] payload) 
Use methods on JMSProducer to set delivery options, 
message headers and message properties 
Copyright © 2013, Oracle and/or its affiliates. 28 All rights reserved.
JMSConsumer 
Messages are consumed by creating a JMSConsumer object 
Encapsulates a MessageConsumer 
Similar functionality and API to MessageConsumer 
Synchronous 
JMSConsumer consumer = context.createConsumer(destination); 
Message message = consumer.receive(1000); 
Asynchronous 
JMSConsumer consumer = context.createConsumer(destination); 
consumer.setMessageListener(messageListener); 
Connection is automatically started (configurable) 
Copyright © 2013, Oracle and/or its affiliates. 29 All rights reserved.
JMSConsumer 
Receiving message bodies directly 
When consuming messages synchronously 
Methods on JMSConsumer that return a Message 
Message receive(); 
Message receive(long timeout); 
Message receiveNoWait(); 
Methods on JMSConsumer that return message body directly 
<T> T receiveBody(Class<T> c); 
<T> T receiveBody(Class<T> c, long timeout); 
<T> T receiveBodyNoWait(Class<T> c); 
Copyright © 2013, Oracle and/or its affiliates. 30 All rights reserved.
JMSConsumer 
Receiving message bodies directly 
public String receiveMessage() throws NamingException { 
InitialContext initialContext = getInitialContext(); 
ConnectionFactory connectionFactory = 
(ConnectionFactory) initialContext.lookup("jms/connectionFactory"); 
Queue inboundQueue = (Queue)initialContext.lookup("jms/inboundQueue"); 
try (JMSContext context = connectionFactory.createContext();) { 
JMSConsumer consumer = context.createConsumer(inboundQueue); 
return consumer.receiveBody(String.class); 
} 
} 
Copyright © 2013, Oracle and/or its affiliates. 31 All rights reserved.
Extracting the body from a message 
In both the standard and simplified APIs 
Old way 
Message message = consumer.receive(1000); 
TextMessage textMessage = (TextMessage) message; 
String body = textMessage.getText(); 
New way 
Message message = consumer.receive(1000); 
String body = message.getBody(String.class); 
Copyright © 2013, Oracle and/or its affiliates. 32 All rights reserved.
Injection of JMSContext objects 
into a Java EE web or EJB container 
@Inject 
@JMSConnectionFactory("jms/connectionFactory") 
private JMSContext context; 
@Resource(mappedName = "jms/inboundQueue") 
private Queue inboundQueue; 
public void sendMessage (String payload) { 
context.createProducer().send(inboundQueue, payload); 
} 
Copyright © 2013, Oracle and/or its affiliates. 33 All rights reserved.
Injection of JMSContext objects 
into a Java EE web or EJB container 
Connection factory will default to platform default JMS 
@Inject private JMSContext context; 
Specifying session mode 
@Inject 
@JMSConnectionFactory("jms/connectionFactory") 
@JMSSessionMode(JMSContext.AUTO_ACKNOWLEDGE) 
private JMSContext context; 
Specifying user and password (not for production use) 
@Inject 
@JMSConnectionFactory("jms/connectionFactory") 
@JMSPasswordCredential(userName="admin",password="mypassword") 
private JMSContext context; 
Copyright © 2013, Oracle and/or its affiliates. 34 All rights reserved.
Injection of JMSContext objects 
into a Java EE web or EJB container 
l Injected JMSContext objects have a scope 
In a JTA transaction, scope is the transaction 
If no JTA transaction, scope is the request 
l JMSContext is automatically closed when scope ends 
l Inject two JMSContext objects within the same scope and you get the 
same object 
If @JMSConnectionFactory, @JMSPasswordCredential and 
@JMSSessionMode annotations match 
Makes it easier to use same session within a transaction 
Copyright © 2013, Oracle and/or its affiliates. 35 All rights reserved.
The four JMS APIs 
Simplified API Standard API Legacy 
TopicConnection 
Factory 
TopicConnection 
TopicSession 
TopicProducer 
TopicSubscriber new and 
simplified slightly 
Copyright © 2013, Oracle and/or its affiliates. 36 All rights reserved. 
queue-specific 
API 
Legacy 
topic-specific 
API 
Introduced 
in 
JMS 2.0 JMS 1.1 JMS 1.0 JMS 1.0 
Main 
interfaces 
ConnectionFactory 
JMSContext 
JMSProducer 
JMSConsumer 
ConnectionFactory 
Connection 
Session 
MessageProducer 
MessageConsumer 
QueueConnection 
Factory 
QueueConnection 
QueueSession, 
QueueSender, 
QueueReceiver 
simplified 
deprecated
New messaging features 
Copyright © 2013, Oracle and/or its affiliates. 37 All rights reserved.
Delivery delay 
In both the standard and simplified APIs 
Allows a JMS client to schedule the future delivery of a message 
New method on MessageProducer 
public void setDeliveryDelay(long deliveryDelay) 
New method on JMSProducer 
public JMSProducer setDeliveryDelay(long deliveryDelay) 
Sets minimum time in ms from that a message should be retained by the 
messaging system before delivery to a consumer 
Why? If the business requires deferred processing, e.g. end of day 
Copyright © 2013, Oracle and/or its affiliates. 38 All rights reserved.
Async send 
In both the standard and simplified APIs 
l Send a message and return immediately without blocking until an 
acknowledgement has been received from the server. 
l Instead, when the acknowledgement is received, an asynchronous 
callback will be invoked 
l New methods on MessageProducer 
messageProducer.send(message,completionListener) 
l Feature also available on JMSProducer 
l Why? Allows thread to do other work whilst waiting for the 
acknowledgement 
Copyright © 2013, Oracle and/or its affiliates. 39 All rights reserved.
Async send 
In both the standard and simplified APIs 
Application specifies a CompletionListener instance 
public interface CompletionListener { 
void onCompletion(Message message); 
void onException(Message message, Exception exception); 
} 
Copyright © 2013, Oracle and/or its affiliates. 40 All rights reserved.
Better handling of "poison" messages 
JMS 1.1 defines an optional JMS defined message property 
JMSXDeliveryCount. 
When used, this is set by the JMS provider when a message is 
received, and is set to the number of times this message has been 
delivered (including the first time). 
JMS 2.0 will make this mandatory 
Why? Allows app servers and applications to handle "poisonous" 
messages better 
Copyright © 2013, Oracle and/or its affiliates. 41 All rights reserved.
Multiple consumers on a 
topic subscription 
Copyright © 2013, Oracle and/or its affiliates. 42 All rights reserved.
How topics work in JMS 1.1 
Producer Topic 
Copyright © 2013, Oracle and/or its affiliates. 43 All rights reserved. 
Subscription 
Subscription 
Consumer 
Each message 
is copied to 
every 
subscription 
In JMS 1.1, 
each 
subscription 
has a single 
consumer 
Subscription may 
be persisted 
(durable) or 
memory-only 
(non-durable) 
Consumer 
Subscription 
Consumer
Shared subscriptions in JMS 2.0 
Producer Topic 
Copyright © 2013, Oracle and/or its affiliates. 44 All rights reserved. 
Consumer 
Shared Subscription 
Each message 
is copied to 
every 
subscription A shared 
subscription 
may have 
multiple 
consumers 
Subscription may 
be persisted 
(durable) or 
memory-only 
(non-durable) 
Unshared subscription 
Consumer 
Consumer 
Consumer 
Each message on 
the shared 
subscription is 
delivered to only 
one consumer
Easier definition of JMS 
resources in Java EE 
(This is actually part of 
Java EE 7) 
Copyright © 2013, Oracle and/or its affiliates. 45 All rights reserved.
Easier definition of JMS resources in Java EE 
The problem 
l Java EE and JMS recommend applications should obtain JMS 
ConnectionFactory and Destination resources by lookup from JNDI 
@Resource(lookupName = "jms/inboundQueue") 
private Queue inboundQueue; 
l Keeps application code portable 
l Creating these resources is a burden on the deployer, and is non-standard 
Copyright © 2013, Oracle and/or its affiliates. 46 All rights reserved.
Platform default connection factory 
Making the simple case simple 
If you simply want to use the application server's built-in JMS provider, 
with no special settings: 
@Resource(lookup="java:comp/defaultJMSConnectionFactory") 
ConnectionFactory myJMScf; 
Copyright © 2013, Oracle and/or its affiliates. 47 All rights reserved.
Easier definition of JMS resources in Java EE 
New feature in Java EE 7 
Application may specify the JMS connection factories and JMS 
destinations that it needs using annotations 
Copyright © 2013, Oracle and/or its affiliates. 48 All rights reserved. 
@JMSDestinationDefinition( 
name = "java:global/jms/myQueue", 
interfaceName = "javax.jms.Queue", 
destinationName = "demoQueue" 
) 
@JMSConnectionFactoryDefinition( 
name="java:global/jms/myCF" 
) 
JNDI 
name 
JNDI 
name 
queue/ 
topic 
name
Easier definition of JMS resources in Java EE 
New feature in Java EE 7 
Can specify additional standard or provider-specific properties 
Copyright © 2013, Oracle and/or its affiliates. 49 All rights reserved. 
@JMSDestinationDefinition( 
name = "java:global/jms/myQueue", 
interfaceName = "javax.jms.Queue", 
destinationName = "demoQueue" 
) 
@JMSConnectionFactoryDefinition( 
name="java:global/jms/myCF", 
maxPoolSize = 30, 
minPoolSize= 20, 
properties = { 
"addressList=mq://localhost:7676", 
"reconnectEnabled=true" 
} 
) 
standard 
properties 
non-standard 
properties
Easier definition of JMS resources in Java EE 
New feature in Java EE 7 
Multiple definitions of same type must be wrapped in collection 
annotations (due to restriction in how Java annotations work) 
Copyright © 2013, Oracle and/or its affiliates. 50 All rights reserved. 
@JMSDestinationDefinitions({ 
@JMSDestinationDefinition( 
name = "java:global/jms/myQueue1", 
interfaceName = "javax.jms.Queue", 
destinationName = "demoQueue1" 
), 
@JMSDestinationDefinition( 
name = "java:global/jms/myQueue2", 
interfaceName = "javax.jms.Queue", 
destinationName = "demoQueue2" 
) 
}) 
@JMSConnectionFactoryDefinitions({ 
@JMSConnectionFactoryDefinition( 
name="java:global/jms/myCF1" 
), 
@JMSConnectionFactoryDefinition( 
name="java:global/jms/myCF2" 
) 
})
Easier definition of JMS resources in Java EE 
New feature in Java EE 7 
Alternatively application may specify the JMS connection factories and 
JMS destinations that it needs in the XML deployment descriptor 
Copyright © 2013, Oracle and/or its affiliates. 51 All rights reserved. 
<jms-destination> 
<name> 
java:global/jms/myQueue 
</name> 
<interface-name> 
javax.jms.Queue 
</interface-name> 
<destination-name> 
demoQueue 
</destination-name> 
</jms-destination> 
<jms-connection-factory> 
<name>java:global/jms/myCF</name> 
<max-pool-size>30</max-pool-size> 
<min-pool-size>20</min-pool-size> 
<property> 
<name>addressList</name> 
<value>mq://localhost:7676</value> 
</property> 
<property> 
<name>reconnectEnabled</name> 
<value>true</value> 
</property> 
</jms-connection-factory>
Easier definition of JMS resources in Java EE 
Available namespaces 
Resources configured in this way must be in one of the following 
namespaces: 
java:comp – may be used within same component only 
java:module – may be used within same module only 
java:app – may be used within same application only 
java:global – may be used within any application 
May be referenced just like any other resource (e.g. @Resource) 
@Resource(lookup="java:global/jms/myCF") 
ConnectionFactory myCF; 
Copyright © 2013, Oracle and/or its affiliates. 52 All rights reserved.
More standardized 
configuration of JMS MDBs 
Joint effort with 
JSR 345 (EJB 3.2) 
Copyright © 2013, Oracle and/or its affiliates. 53 All rights reserved.
More standardized configuration of JMS MDBs 
l Configuration of JMS MDBs is surprisingly non-standard 
l EJB 3.1 does not define how to specify 
JNDI name of queue or topic (using annotation) 
JNDI name of connection factory 
ClientID 
DurableSubscriptionName 
l EJB 3.1 does not define how topic messages delivered to clustered 
MDBs 
Copyright © 2013, Oracle and/or its affiliates. 54 All rights reserved.
More standardized configuration of JMS MDBs 
New activation property to specify the queue or topic 
@MessageDriven(activationConfig = { 
@ActivationConfigProperty( 
propertyName = "destinationLookup", 
propertyValue = "jms/myTopic"), 
. . . 
}) 
Can also be configured in ejb-jar.xml 
Copyright © 2013, Oracle and/or its affiliates. 55 All rights reserved.
More standardized configuration of JMS MDBs 
New activation property to specify the connection factory 
@MessageDriven(activationConfig = { 
@ActivationConfigProperty( 
propertyName = "connectionFactoryLookup", 
propertyValue = "jms/myCF"), 
. . . 
}) 
Can also be configured in ejb-jar.xml 
Copyright © 2013, Oracle and/or its affiliates. 56 All rights reserved.
More standardized configuration of JMS MDBs 
New activation properties to specify durable subscriptions 
@MessageDriven(activationConfig = { 
@ActivationConfigProperty( 
propertyName = "subscriptionDurability", 
propertyValue = "Durable"), 
@ActivationConfigProperty( 
propertyName = "clientId", 
propertyValue = "myClientID"), 
@ActivationConfigProperty( 
propertyName = "subscriptionName", 
propertyValue = "MySub"), 
. . . 
Surprisingly, these have never been standardized before 
}) 
Copyright © 2013, Oracle and/or its affiliates. 57 All rights reserved. 
clientId 
optional even 
for durable 
subscriptions
What’s new in JMS 2.0 
Summary 
l Simplicity and ease of use 
l New messaging features 
l Multi-threaded topic subscribers 
Delivery delay 
Async send 
l Better Java EE integration 
Simpler resource configuration 
Standardized configuration of JMS MDBs 
l Minor corrections and clarifications 
Copyright © 2013, Oracle and/or its affiliates. 58 All rights reserved.
Try JMS 2.0 
JMS 2.0, EJB 3.2 and Java EE 7 
l JMS 2.0 in a standalone provider (for Java SE applications) 
Open Message Queue 5.0 mq.java.net/ 
l JMS 2.0 in a full Java EE 7 application server 
GlassFish 4.0 glassfish.java.net/ 
l Try other implementations as they are released 
l See also jms-spec.java.net for lots of useful links 
Copyright © 2013, Oracle and/or its affiliates. 59 All rights reserved.
Copyright © 2013, Oracle and/or its affiliates. 60 All rights reserved.

Mais conteúdo relacionado

Mais procurados

Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
javatwo2011
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
glassfish
 
5050 dev nation
5050 dev nation5050 dev nation
5050 dev nation
Arun Gupta
 

Mais procurados (20)

Java EE 7 - Overview and Status
Java EE 7  - Overview and StatusJava EE 7  - Overview and Status
Java EE 7 - Overview and Status
 
GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0
 
JEE5 New Features
JEE5 New FeaturesJEE5 New Features
JEE5 New Features
 
GIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE ApplicationGIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE Application
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 
JAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web ServicesJAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web Services
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
 
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX LondonJAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for future
 
Java Web Programming [2/9] : Servlet Basic
Java Web Programming [2/9] : Servlet BasicJava Web Programming [2/9] : Servlet Basic
Java Web Programming [2/9] : Servlet Basic
 
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun GuptaJAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Java Summit Chennai: JAX-RS 2.0
Java Summit Chennai: JAX-RS 2.0Java Summit Chennai: JAX-RS 2.0
Java Summit Chennai: JAX-RS 2.0
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking Tour
 
5050 dev nation
5050 dev nation5050 dev nation
5050 dev nation
 
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsJava Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
 

Destaque

Parts of a House
Parts of a HouseParts of a House
Parts of a House
nsantaellav
 
3 Енергоефективність та енергозбереження широке поле для інвестиції - Юрій ...
3 Енергоефективність та енергозбереження   широке поле для інвестиції - Юрій ...3 Енергоефективність та енергозбереження   широке поле для інвестиції - Юрій ...
3 Енергоефективність та енергозбереження широке поле для інвестиції - Юрій ...
Main Department of Economy of Vinnytsia Regional State Administration
 
Slides bulgaria angelo raffaele tursi bg
Slides bulgaria angelo raffaele tursi bgSlides bulgaria angelo raffaele tursi bg
Slides bulgaria angelo raffaele tursi bg
Irecoop Toscana
 
Se nós lemos eles len
Se nós lemos eles lenSe nós lemos eles len
Se nós lemos eles len
migadepan
 
Photo shots
Photo shotsPhoto shots
Photo shots
ecsmedia
 
Social media and online tools
Social media and online toolsSocial media and online tools
Social media and online tools
Stuart Lowe
 
11 frederike van wijck et al exercise after stroke.ppt
11 frederike van wijck et al exercise after stroke.ppt11 frederike van wijck et al exercise after stroke.ppt
11 frederike van wijck et al exercise after stroke.ppt
bluebuilding
 
Indigenous Archives: Opportunities for Archival Access in an Information Society
Indigenous Archives: Opportunities for Archival Access in an Information SocietyIndigenous Archives: Opportunities for Archival Access in an Information Society
Indigenous Archives: Opportunities for Archival Access in an Information Society
teagueschneiter
 
Angle shots
Angle shotsAngle shots
Angle shots
ecsmedia
 
Key figures in the development of stop motion
Key figures in the development of stop motionKey figures in the development of stop motion
Key figures in the development of stop motion
ecsmedia
 
Presentation
PresentationPresentation
Presentation
KevLoud
 

Destaque (20)

Государственное управление
Государственное управлениеГосударственное управление
Государственное управление
 
Parts of a House
Parts of a HouseParts of a House
Parts of a House
 
3 Енергоефективність та енергозбереження широке поле для інвестиції - Юрій ...
3 Енергоефективність та енергозбереження   широке поле для інвестиції - Юрій ...3 Енергоефективність та енергозбереження   широке поле для інвестиції - Юрій ...
3 Енергоефективність та енергозбереження широке поле для інвестиції - Юрій ...
 
4 Інвестиційні можливості м. Вінниця - Володимир Гройсман (виступ)
4 Інвестиційні можливості м. Вінниця - Володимир Гройсман (виступ)4 Інвестиційні можливості м. Вінниця - Володимир Гройсман (виступ)
4 Інвестиційні можливості м. Вінниця - Володимир Гройсман (виступ)
 
Slides bulgaria angelo raffaele tursi bg
Slides bulgaria angelo raffaele tursi bgSlides bulgaria angelo raffaele tursi bg
Slides bulgaria angelo raffaele tursi bg
 
Se nós lemos eles len
Se nós lemos eles lenSe nós lemos eles len
Se nós lemos eles len
 
Android UI Development: Tips, Tricks, and Techniques
Android UI Development: Tips, Tricks, and TechniquesAndroid UI Development: Tips, Tricks, and Techniques
Android UI Development: Tips, Tricks, and Techniques
 
Photo shots
Photo shotsPhoto shots
Photo shots
 
My five minutes bell
My five minutes bellMy five minutes bell
My five minutes bell
 
Social media and online tools
Social media and online toolsSocial media and online tools
Social media and online tools
 
11 frederike van wijck et al exercise after stroke.ppt
11 frederike van wijck et al exercise after stroke.ppt11 frederike van wijck et al exercise after stroke.ppt
11 frederike van wijck et al exercise after stroke.ppt
 
Possible to match our drawings with our coats of arms
Possible to match our drawings with our coats of armsPossible to match our drawings with our coats of arms
Possible to match our drawings with our coats of arms
 
Indigenous Archives: Opportunities for Archival Access in an Information Society
Indigenous Archives: Opportunities for Archival Access in an Information SocietyIndigenous Archives: Opportunities for Archival Access in an Information Society
Indigenous Archives: Opportunities for Archival Access in an Information Society
 
Angle shots
Angle shotsAngle shots
Angle shots
 
Three settings
Three settingsThree settings
Three settings
 
Buồn vui nghề IT (Pros & cons of IT Career)
Buồn vui nghề IT (Pros & cons of IT Career)Buồn vui nghề IT (Pros & cons of IT Career)
Buồn vui nghề IT (Pros & cons of IT Career)
 
Key figures in the development of stop motion
Key figures in the development of stop motionKey figures in the development of stop motion
Key figures in the development of stop motion
 
Presentation
PresentationPresentation
Presentation
 
Fill your Jobs with the Right-Fit Generation
Fill your Jobs with the Right-Fit GenerationFill your Jobs with the Right-Fit Generation
Fill your Jobs with the Right-Fit Generation
 
20040624 036-002
20040624 036-00220040624 036-002
20040624 036-002
 

Semelhante a What's new in JMS 2.0 - OTN Bangalore 2013

Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
telestax
 

Semelhante a What's new in JMS 2.0 - OTN Bangalore 2013 (20)

'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOF
 
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
 
Java ee7 1hour
Java ee7 1hourJava ee7 1hour
Java ee7 1hour
 
OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7
 
Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5
 
As novidades do Java EE 7: do HTML5 ao JMS 2.0
As novidades do Java EE 7: do HTML5 ao JMS 2.0As novidades do Java EE 7: do HTML5 ao JMS 2.0
As novidades do Java EE 7: do HTML5 ao JMS 2.0
 
Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java Platform
 
GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012
 
Jms intro
Jms introJms intro
Jms intro
 
Using the JMS 2.0 API with Apache Pulsar - Pulsar Virtual Summit Europe 2021
Using the JMS 2.0 API with Apache Pulsar - Pulsar Virtual Summit Europe 2021Using the JMS 2.0 API with Apache Pulsar - Pulsar Virtual Summit Europe 2021
Using the JMS 2.0 API with Apache Pulsar - Pulsar Virtual Summit Europe 2021
 
Jms
JmsJms
Jms
 
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
 
WhatsNewInJMS21
WhatsNewInJMS21WhatsNewInJMS21
WhatsNewInJMS21
 
MarvelSoft SchoolAdmin Dev Framework
MarvelSoft SchoolAdmin Dev FrameworkMarvelSoft SchoolAdmin Dev Framework
MarvelSoft SchoolAdmin Dev Framework
 
Whats Next for JCA?
Whats Next for JCA?Whats Next for JCA?
Whats Next for JCA?
 
Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners
 
GlassFish REST Administration Backend
GlassFish REST Administration BackendGlassFish REST Administration Backend
GlassFish REST Administration Backend
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 

Mais de Jagadish Prasath (7)

JAX RS 2.0 - OTN Bangalore 2013
JAX RS 2.0 - OTN Bangalore 2013JAX RS 2.0 - OTN Bangalore 2013
JAX RS 2.0 - OTN Bangalore 2013
 
Experiences in building a PaaS Platform - Java One SFO 2012
Experiences in building a PaaS Platform - Java One SFO 2012Experiences in building a PaaS Platform - Java One SFO 2012
Experiences in building a PaaS Platform - Java One SFO 2012
 
PaaS enabling Java EE applications through service meta-data and policies - J...
PaaS enabling Java EE applications through service meta-data and policies - J...PaaS enabling Java EE applications through service meta-data and policies - J...
PaaS enabling Java EE applications through service meta-data and policies - J...
 
PaaSing a Java EE Application
PaaSing a Java EE ApplicationPaaSing a Java EE Application
PaaSing a Java EE Application
 
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012EJB 3.2 - Java EE 7 - Java One Hyderabad 2012
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012
 
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
 
Connector Architecture 1.6 - Tech-days 2010, Hyderabad.
Connector Architecture 1.6 - Tech-days 2010, Hyderabad.Connector Architecture 1.6 - Tech-days 2010, Hyderabad.
Connector Architecture 1.6 - Tech-days 2010, Hyderabad.
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

What's new in JMS 2.0 - OTN Bangalore 2013

  • 1. Graphic Section Divider Copyright © 2013, Oracle and/or its affiliates. 1 All rights reserved.
  • 2. Easier Messaging with JMS 2.0 Jagadish Ramu Application Server Group Oracle Copyright © 2013, Oracle and/or its affiliates. 2 All rights reserved.
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Copyright © 2013, Oracle and/or its affiliates. 3 All rights reserved.
  • 4. Java Message Service (JMS) l A Java API for sending and receiving messages l Many competing implementations l Two distinct API variants l Java SE applications l Java EE applications – adds additional features l JTA (XA) transactions l Replaces async MessageListener with MDBs, l Injection of connection factories and destinations using @Resource l (New!) Injection and management of JMSContext objects Copyright © 2013, Oracle and/or its affiliates. 4 All rights reserved.
  • 5. What JMS is and isn't A standard API Not a messaging system in itself Not a wire protocol Defines Java API only Doesn't define API for non-Java clients (e.g. C++, HTTP) - but many implementations do An application API Not (currently) an admin, management or monitoring API Copyright © 2013, Oracle and/or its affiliates. 5 All rights reserved.
  • 6. JMS 2.0 JMS 1.1 (2002) Dozens of implementations, both standalone and as part of a full Java EE provider JMS 2.0 (2013) Launched in 2011 as JSR 343 Released in 2013 with Java EE 7 Available in Open Message Queue 5.0 (standalone JMS provider) and in GlassFish 4.0 (full Java EE provider) Other implementations announced or in progress Copyright © 2013, Oracle and/or its affiliates. 6 All rights reserved.
  • 7. What's new in JMS 2.0 l Simpler and easier to use l New messaging features l Better Java EE integration l Define differences between JMS in SE and EE more clearly l Simpler resource configuration l Standardized configuration of JMS MDBs l Minor corrections and clarifications Copyright © 2013, Oracle and/or its affiliates. 7 All rights reserved.
  • 8. JMS 2.0 Simpler and easier to use Copyright © 2013, Oracle and/or its affiliates. 8 All rights reserved.
  • 9. JMS API simplifications Twin-track strategy l Make minor simplifications to existing standard API where it won't break compatibility l Define new simplified API requiring fewer objects JMSContext, JMSProducer, JMSConsumer In Java EE, allow JMSContext to be injected and managed by the container Copyright © 2013, Oracle and/or its affiliates. 9 All rights reserved.
  • 10. Why did JMS 1.1 need simplifying? Copyright © 2013, Oracle and/or its affiliates. 10 All rights reserved.
  • 11. JMS 1.1: Sending a message @Resource(lookup = "java:global/jms/demoConnectionFactory") ConnectionFactory connectionFactory; @Resource(lookup = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessage(String payload) { try { Connection connection = connectionFactory.createConnection(); try { Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); MessageProducer messageProducer = session.createProducer(demoQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } finally { connection.close(); } } catch (JMSException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } } Copyright © 2013, Oracle and/or its affiliates. 11 All rights reserved. 13 lines of code just to send a message
  • 12. JMS 1.1: Sending a message @Resource(lookup = "java:global/jms/demoConnectionFactory") ConnectionFactory connectionFactory; @Resource(lookup = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessage(String payload) { try { Connection connection = connectionFactory.createConnection(); try { Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); MessageProducer messageProducer = session.createProducer(demoQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } finally { connection.close(); } } catch (JMSException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } } Copyright © 2013, Oracle and/or its affiliates. 12 All rights reserved. must create several intermediate objects
  • 13. JMS 1.1: Sending a message @Resource(lookup = "java:global/jms/demoConnectionFactory") ConnectionFactory connectionFactory; @Resource(lookup = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessage(String payload) { try { Connection connection = connectionFactory.createConnection(); try { Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); MessageProducer messageProducer = session.createProducer(demoQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } finally { connection.close(); } } catch (JMSException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } } Copyright © 2013, Oracle and/or its affiliates. 13 All rights reserved. redundant and misleading arguments
  • 14. JMS 1.1: Sending a message @Resource(lookup = "java:global/jms/demoConnectionFactory") ConnectionFactory connectionFactory; @Resource(lookup = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessage(String payload) { try { Connection connection = connectionFactory.createConnection(); try { Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); MessageProducer messageProducer = session.createProducer(demoQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } finally { connection.close(); } } catch (JMSException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } } Copyright © 2013, Oracle and/or its affiliates. 14 All rights reserved. must close resources after use!
  • 15. JMS 1.1: Sending a message @Resource(lookup = "java:global/jms/demoConnectionFactory") ConnectionFactory connectionFactory; @Resource(lookup = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessage(String payload) { try { Connection connection = connectionFactory.createConnection(); try { Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); MessageProducer messageProducer = session.createProducer(demoQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } finally { connection.close(); } } catch (JMSException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } } Copyright © 2013, Oracle and/or its affiliates. 15 All rights reserved. all methods throw checked exceptions
  • 16. Minor simplifications to the existing standard API Copyright © 2013, Oracle and/or its affiliates. 16 All rights reserved.
  • 17. Minor simplifications to the standard API Simpler API to create a Session Methods on javax.jms.Connection to create a Session: l JMS 1.1 method remains connection.createSession(transacted, acknowledgeMode) l New method combines two parameters into one: connection.createSession(sessionMode) l New method mainly for Java EE connection.createSession() Session.SESSION_TRANSACTED Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE Session.DUPS_OK_ACKNOWLEDGE Copyright © 2013, Oracle and/or its affiliates. 17 All rights reserved.
  • 18. Minor simplifications to the standard API Simpler API to close JMS objects l Make JMS objects implement java.jang.AutoCloseable Connection Session MessageProducer MessageConsumer QueueBrowser l Requires Java SE 7 Copyright © 2013, Oracle and/or its affiliates. 18 All rights reserved.
  • 19. Minor simplifications to the standard JMS API Simpler API to close JMS objects @Resource(lookup = "jms/connFactory") ConnectionFactory cf; @Resource(lookup="jms/inboundQueue") Destination dest; Create closeable resources in a try-with-resources Make JMS objects implement java.jang.AutoCloseable Connection, Session, MessageProducer, MessageConsumer, QueueBrowser public void sendMessage (String payload) throws JMSException { try ( Connection conn = connectionFactory.createConnection(); Session session = conn.createSession(); MessageProducer producer = session.createProducer(dest); ){ Message mess = sess.createTextMessage(payload); producer.send(mess); } catch(JMSException e){ // exception handling } } Copyright © 2013, Oracle and/or its affiliates. 19 All rights reserved. block close() is called automatically at end of block
  • 20. Completely new simplified API Copyright © 2013, Oracle and/or its affiliates. 20 All rights reserved.
  • 21. Completely new simplified API Introducing JMSContext and JMSProducer @Resource(lookup = "java:global/jms/demoConnectionFactory") ConnectionFactory connectionFactory; @Resource(lookup = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessageNew(String payload) { try (JMSContext context = connectionFactory.createContext();){ context.createProducer().send(demoQueue, payload); } catch (JMSRuntimeException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } } Copyright © 2013, Oracle and/or its affiliates. 21 All rights reserved. 13 lines reduced to 5
  • 22. Completely new simplified API Introducing JMSContext and JMSProducer @Resource(lookup = "java:global/jms/demoConnectionFactory") ConnectionFactory connectionFactory; @Resource(lookup = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessageNew(String payload) { try (JMSContext context = connectionFactory.createContext();){ context.createProducer().send(demoQueue, payload); } catch (JMSRuntimeException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } } Copyright © 2013, Oracle and/or its affiliates. 22 All rights reserved. JMSContext combines Connection and Session Payload can be sent directly
  • 23. JMSContext (1/2) l A new object which encapsulates a Connection, a Session and an anonymous MessageProducer l Created from a ConnectionFactory JMSContext context = connectionFactory.createContext(sessionMode); l Call close() after use, or create in a try-with-resources block l Can also be injected (into a Java EE web or EJB application) Copyright © 2013, Oracle and/or its affiliates. 23 All rights reserved.
  • 24. JMSContext (2/2) l Can also create from an existing JMSContext (to reuse its connection – Java SE only) JMSContext context2 = context1.createContext(sessionMode); l Used to create JMSProducer objects for sending messages l Used to create JMSConsumer objects for receiving messages l Methods on JMSContext, JMSProducer and JMSConsumer throw only unchecked exceptions Copyright © 2013, Oracle and/or its affiliates. 24 All rights reserved.
  • 25. JMSProducer Messages are sent by creating a JMSProducer object Does not encapsulate a MessageProducer so is lightweight Supports method chaining for a fluid style JMS 1.1 MessageProducer producer = session.createProducer(); producer.send(destination,message); JMS 2.0 JMSProducer producer = context.createProducer(); producer.send(destination,message); Copyright © 2013, Oracle and/or its affiliates. 25 All rights reserved.
  • 26. JMSProducer Setting message delivery options using method chaining JMS 1.1 MessageProducer producer = session.createProducer(); producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); producer.setPriority(1); producer.setTimeToLive(1000); producer.send(destination,message); JMS 2.0 context.createProducer().setDeliveryMode(DeliveryMode.NON_PERSISTENT). setPriority(1).setTimeToLive(1000).send(destination,message); Copyright © 2013, Oracle and/or its affiliates. 26 All rights reserved.
  • 27. JMSProducer Setting message properties and headers JMS 1.1 (need to set on the message) MessageProducer producer = session.createProducer(); TextMessage textMessage = session.createTextMessage("Hello); textMessage.setStringProperty("foo","bar"); producer.send(destination,message); JMS 2.0 (can also set on the JMSProducer) context.createProducer().setProperty("foo","bar").send(destination,"Hello"); Copyright © 2013, Oracle and/or its affiliates. 27 All rights reserved.
  • 28. JMSProducer Sending message bodies directly Methods on JMSProducer to send a Message send(Destination dest, Message message) No need to create a Message send(Destination dest, Map<String,Object> payload) send(Destination dest, Serializable payload) send(Destination dest, String payload) send(Destination dest, byte[] payload) Use methods on JMSProducer to set delivery options, message headers and message properties Copyright © 2013, Oracle and/or its affiliates. 28 All rights reserved.
  • 29. JMSConsumer Messages are consumed by creating a JMSConsumer object Encapsulates a MessageConsumer Similar functionality and API to MessageConsumer Synchronous JMSConsumer consumer = context.createConsumer(destination); Message message = consumer.receive(1000); Asynchronous JMSConsumer consumer = context.createConsumer(destination); consumer.setMessageListener(messageListener); Connection is automatically started (configurable) Copyright © 2013, Oracle and/or its affiliates. 29 All rights reserved.
  • 30. JMSConsumer Receiving message bodies directly When consuming messages synchronously Methods on JMSConsumer that return a Message Message receive(); Message receive(long timeout); Message receiveNoWait(); Methods on JMSConsumer that return message body directly <T> T receiveBody(Class<T> c); <T> T receiveBody(Class<T> c, long timeout); <T> T receiveBodyNoWait(Class<T> c); Copyright © 2013, Oracle and/or its affiliates. 30 All rights reserved.
  • 31. JMSConsumer Receiving message bodies directly public String receiveMessage() throws NamingException { InitialContext initialContext = getInitialContext(); ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("jms/connectionFactory"); Queue inboundQueue = (Queue)initialContext.lookup("jms/inboundQueue"); try (JMSContext context = connectionFactory.createContext();) { JMSConsumer consumer = context.createConsumer(inboundQueue); return consumer.receiveBody(String.class); } } Copyright © 2013, Oracle and/or its affiliates. 31 All rights reserved.
  • 32. Extracting the body from a message In both the standard and simplified APIs Old way Message message = consumer.receive(1000); TextMessage textMessage = (TextMessage) message; String body = textMessage.getText(); New way Message message = consumer.receive(1000); String body = message.getBody(String.class); Copyright © 2013, Oracle and/or its affiliates. 32 All rights reserved.
  • 33. Injection of JMSContext objects into a Java EE web or EJB container @Inject @JMSConnectionFactory("jms/connectionFactory") private JMSContext context; @Resource(mappedName = "jms/inboundQueue") private Queue inboundQueue; public void sendMessage (String payload) { context.createProducer().send(inboundQueue, payload); } Copyright © 2013, Oracle and/or its affiliates. 33 All rights reserved.
  • 34. Injection of JMSContext objects into a Java EE web or EJB container Connection factory will default to platform default JMS @Inject private JMSContext context; Specifying session mode @Inject @JMSConnectionFactory("jms/connectionFactory") @JMSSessionMode(JMSContext.AUTO_ACKNOWLEDGE) private JMSContext context; Specifying user and password (not for production use) @Inject @JMSConnectionFactory("jms/connectionFactory") @JMSPasswordCredential(userName="admin",password="mypassword") private JMSContext context; Copyright © 2013, Oracle and/or its affiliates. 34 All rights reserved.
  • 35. Injection of JMSContext objects into a Java EE web or EJB container l Injected JMSContext objects have a scope In a JTA transaction, scope is the transaction If no JTA transaction, scope is the request l JMSContext is automatically closed when scope ends l Inject two JMSContext objects within the same scope and you get the same object If @JMSConnectionFactory, @JMSPasswordCredential and @JMSSessionMode annotations match Makes it easier to use same session within a transaction Copyright © 2013, Oracle and/or its affiliates. 35 All rights reserved.
  • 36. The four JMS APIs Simplified API Standard API Legacy TopicConnection Factory TopicConnection TopicSession TopicProducer TopicSubscriber new and simplified slightly Copyright © 2013, Oracle and/or its affiliates. 36 All rights reserved. queue-specific API Legacy topic-specific API Introduced in JMS 2.0 JMS 1.1 JMS 1.0 JMS 1.0 Main interfaces ConnectionFactory JMSContext JMSProducer JMSConsumer ConnectionFactory Connection Session MessageProducer MessageConsumer QueueConnection Factory QueueConnection QueueSession, QueueSender, QueueReceiver simplified deprecated
  • 37. New messaging features Copyright © 2013, Oracle and/or its affiliates. 37 All rights reserved.
  • 38. Delivery delay In both the standard and simplified APIs Allows a JMS client to schedule the future delivery of a message New method on MessageProducer public void setDeliveryDelay(long deliveryDelay) New method on JMSProducer public JMSProducer setDeliveryDelay(long deliveryDelay) Sets minimum time in ms from that a message should be retained by the messaging system before delivery to a consumer Why? If the business requires deferred processing, e.g. end of day Copyright © 2013, Oracle and/or its affiliates. 38 All rights reserved.
  • 39. Async send In both the standard and simplified APIs l Send a message and return immediately without blocking until an acknowledgement has been received from the server. l Instead, when the acknowledgement is received, an asynchronous callback will be invoked l New methods on MessageProducer messageProducer.send(message,completionListener) l Feature also available on JMSProducer l Why? Allows thread to do other work whilst waiting for the acknowledgement Copyright © 2013, Oracle and/or its affiliates. 39 All rights reserved.
  • 40. Async send In both the standard and simplified APIs Application specifies a CompletionListener instance public interface CompletionListener { void onCompletion(Message message); void onException(Message message, Exception exception); } Copyright © 2013, Oracle and/or its affiliates. 40 All rights reserved.
  • 41. Better handling of "poison" messages JMS 1.1 defines an optional JMS defined message property JMSXDeliveryCount. When used, this is set by the JMS provider when a message is received, and is set to the number of times this message has been delivered (including the first time). JMS 2.0 will make this mandatory Why? Allows app servers and applications to handle "poisonous" messages better Copyright © 2013, Oracle and/or its affiliates. 41 All rights reserved.
  • 42. Multiple consumers on a topic subscription Copyright © 2013, Oracle and/or its affiliates. 42 All rights reserved.
  • 43. How topics work in JMS 1.1 Producer Topic Copyright © 2013, Oracle and/or its affiliates. 43 All rights reserved. Subscription Subscription Consumer Each message is copied to every subscription In JMS 1.1, each subscription has a single consumer Subscription may be persisted (durable) or memory-only (non-durable) Consumer Subscription Consumer
  • 44. Shared subscriptions in JMS 2.0 Producer Topic Copyright © 2013, Oracle and/or its affiliates. 44 All rights reserved. Consumer Shared Subscription Each message is copied to every subscription A shared subscription may have multiple consumers Subscription may be persisted (durable) or memory-only (non-durable) Unshared subscription Consumer Consumer Consumer Each message on the shared subscription is delivered to only one consumer
  • 45. Easier definition of JMS resources in Java EE (This is actually part of Java EE 7) Copyright © 2013, Oracle and/or its affiliates. 45 All rights reserved.
  • 46. Easier definition of JMS resources in Java EE The problem l Java EE and JMS recommend applications should obtain JMS ConnectionFactory and Destination resources by lookup from JNDI @Resource(lookupName = "jms/inboundQueue") private Queue inboundQueue; l Keeps application code portable l Creating these resources is a burden on the deployer, and is non-standard Copyright © 2013, Oracle and/or its affiliates. 46 All rights reserved.
  • 47. Platform default connection factory Making the simple case simple If you simply want to use the application server's built-in JMS provider, with no special settings: @Resource(lookup="java:comp/defaultJMSConnectionFactory") ConnectionFactory myJMScf; Copyright © 2013, Oracle and/or its affiliates. 47 All rights reserved.
  • 48. Easier definition of JMS resources in Java EE New feature in Java EE 7 Application may specify the JMS connection factories and JMS destinations that it needs using annotations Copyright © 2013, Oracle and/or its affiliates. 48 All rights reserved. @JMSDestinationDefinition( name = "java:global/jms/myQueue", interfaceName = "javax.jms.Queue", destinationName = "demoQueue" ) @JMSConnectionFactoryDefinition( name="java:global/jms/myCF" ) JNDI name JNDI name queue/ topic name
  • 49. Easier definition of JMS resources in Java EE New feature in Java EE 7 Can specify additional standard or provider-specific properties Copyright © 2013, Oracle and/or its affiliates. 49 All rights reserved. @JMSDestinationDefinition( name = "java:global/jms/myQueue", interfaceName = "javax.jms.Queue", destinationName = "demoQueue" ) @JMSConnectionFactoryDefinition( name="java:global/jms/myCF", maxPoolSize = 30, minPoolSize= 20, properties = { "addressList=mq://localhost:7676", "reconnectEnabled=true" } ) standard properties non-standard properties
  • 50. Easier definition of JMS resources in Java EE New feature in Java EE 7 Multiple definitions of same type must be wrapped in collection annotations (due to restriction in how Java annotations work) Copyright © 2013, Oracle and/or its affiliates. 50 All rights reserved. @JMSDestinationDefinitions({ @JMSDestinationDefinition( name = "java:global/jms/myQueue1", interfaceName = "javax.jms.Queue", destinationName = "demoQueue1" ), @JMSDestinationDefinition( name = "java:global/jms/myQueue2", interfaceName = "javax.jms.Queue", destinationName = "demoQueue2" ) }) @JMSConnectionFactoryDefinitions({ @JMSConnectionFactoryDefinition( name="java:global/jms/myCF1" ), @JMSConnectionFactoryDefinition( name="java:global/jms/myCF2" ) })
  • 51. Easier definition of JMS resources in Java EE New feature in Java EE 7 Alternatively application may specify the JMS connection factories and JMS destinations that it needs in the XML deployment descriptor Copyright © 2013, Oracle and/or its affiliates. 51 All rights reserved. <jms-destination> <name> java:global/jms/myQueue </name> <interface-name> javax.jms.Queue </interface-name> <destination-name> demoQueue </destination-name> </jms-destination> <jms-connection-factory> <name>java:global/jms/myCF</name> <max-pool-size>30</max-pool-size> <min-pool-size>20</min-pool-size> <property> <name>addressList</name> <value>mq://localhost:7676</value> </property> <property> <name>reconnectEnabled</name> <value>true</value> </property> </jms-connection-factory>
  • 52. Easier definition of JMS resources in Java EE Available namespaces Resources configured in this way must be in one of the following namespaces: java:comp – may be used within same component only java:module – may be used within same module only java:app – may be used within same application only java:global – may be used within any application May be referenced just like any other resource (e.g. @Resource) @Resource(lookup="java:global/jms/myCF") ConnectionFactory myCF; Copyright © 2013, Oracle and/or its affiliates. 52 All rights reserved.
  • 53. More standardized configuration of JMS MDBs Joint effort with JSR 345 (EJB 3.2) Copyright © 2013, Oracle and/or its affiliates. 53 All rights reserved.
  • 54. More standardized configuration of JMS MDBs l Configuration of JMS MDBs is surprisingly non-standard l EJB 3.1 does not define how to specify JNDI name of queue or topic (using annotation) JNDI name of connection factory ClientID DurableSubscriptionName l EJB 3.1 does not define how topic messages delivered to clustered MDBs Copyright © 2013, Oracle and/or its affiliates. 54 All rights reserved.
  • 55. More standardized configuration of JMS MDBs New activation property to specify the queue or topic @MessageDriven(activationConfig = { @ActivationConfigProperty( propertyName = "destinationLookup", propertyValue = "jms/myTopic"), . . . }) Can also be configured in ejb-jar.xml Copyright © 2013, Oracle and/or its affiliates. 55 All rights reserved.
  • 56. More standardized configuration of JMS MDBs New activation property to specify the connection factory @MessageDriven(activationConfig = { @ActivationConfigProperty( propertyName = "connectionFactoryLookup", propertyValue = "jms/myCF"), . . . }) Can also be configured in ejb-jar.xml Copyright © 2013, Oracle and/or its affiliates. 56 All rights reserved.
  • 57. More standardized configuration of JMS MDBs New activation properties to specify durable subscriptions @MessageDriven(activationConfig = { @ActivationConfigProperty( propertyName = "subscriptionDurability", propertyValue = "Durable"), @ActivationConfigProperty( propertyName = "clientId", propertyValue = "myClientID"), @ActivationConfigProperty( propertyName = "subscriptionName", propertyValue = "MySub"), . . . Surprisingly, these have never been standardized before }) Copyright © 2013, Oracle and/or its affiliates. 57 All rights reserved. clientId optional even for durable subscriptions
  • 58. What’s new in JMS 2.0 Summary l Simplicity and ease of use l New messaging features l Multi-threaded topic subscribers Delivery delay Async send l Better Java EE integration Simpler resource configuration Standardized configuration of JMS MDBs l Minor corrections and clarifications Copyright © 2013, Oracle and/or its affiliates. 58 All rights reserved.
  • 59. Try JMS 2.0 JMS 2.0, EJB 3.2 and Java EE 7 l JMS 2.0 in a standalone provider (for Java SE applications) Open Message Queue 5.0 mq.java.net/ l JMS 2.0 in a full Java EE 7 application server GlassFish 4.0 glassfish.java.net/ l Try other implementations as they are released l See also jms-spec.java.net for lots of useful links Copyright © 2013, Oracle and/or its affiliates. 59 All rights reserved.
  • 60. Copyright © 2013, Oracle and/or its affiliates. 60 All rights reserved.