


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to messaging and java message service (jms) with a focus on ejb message-driven beans. It covers the basics of messaging, communication models, the jms object model, and writing jms clients. The document also explains how to develop and configure a message-driven bean (mdb), and discusses connector-based mdbs.
Typology: Study notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!



2006-9-20 © Dr. Ye Wu 2
2006-9-20 © Dr. Ye Wu 3
through “messages” (one way communication)
that uses a messaging service
do not need to know each other
2006-9-20 © Dr. Ye Wu 4
2006-9-20 © Dr. Ye Wu 5
- Messaging Domain
Sender
Sender
Sender
Message Queue
Message Queue
Receiver
Receiver
2006-9-20 © Dr. Ye Wu 6
Publisher Topic
Topic
Subscriber
Publisher
Publisher
Subscriber
2006-9-20 © Dr. Ye Wu 7
2006-9-20 © Dr. Ye Wu 8
2006-9-20 © Dr. Ye Wu 9
2006-9-20 © Dr. Ye Wu 10
2006-9-20 © Dr. Ye Wu 11
2006-9-20 © Dr. Ye Wu 19
public void onMessage(Message msg) { try { TextMessage message = (TextMessage)msg; System.out.println(message.getText()); }catch(Exception e) { System.out.println(e); } } }
2006-9-20 © Dr. Ye Wu 20
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName=“messageSelector", propertyValue=“’MessageFormat = ‘Version 3.4’") @ActivationConfigProperty(propertyName=“acknowledgeMode", propertyValue=“Auto-acknowledge") @ActivationConfigProperty(propertyName=“subscriptionDurability", propertyValue=“Durable") })
2006-9-20 © Dr. Ye Wu 21
Method Ready onMessage()
Not Exist
2006-9-20 © Dr. Ye Wu 22
Connector-Based Message-Driven Bean