The document discusses Java Message Service (JMS) and its architecture, describing key JMS concepts like connections, sessions, message producers and consumers, and administered objects. It also covers message types and how to implement asynchronous messaging using a message-driven bean within a J2EE application.
29. JMS with EJB Example EJB Container automatically performs several setup tasks that standalone client has to do:-creating a msgconsumer instead, you associate the message-driven bean with a destination and connection factory at deployment time
30.
31.
32.
Editor's Notes
Tip: Can use a QueueSession to create a receiver for the queue myQueue , and TopicSession to create a subscriber for the topic myTopic
Once message delivery begins, the message consumer automatically calls the message listener's onMessage method whenever a message is delivered. The onMessage method takes one argument of type Message, which the method can cast to any of the other message types. **The same listener can obtain messages from either a queue or a topic, depending on whether the listener is set by a QueueReceiver or a TopicSubscriber object.
-Every message has a unique identifier, represented in the header field JMSMessageID. -The value of another header field, JMSDestination, represents the queue or the topic to which the message is sent. -Other fields include a timestamp and a priority level.