Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform
by Mark Hapner, Rich Burridge, Rahul Sharma, Joseph Fialli, Kim Haase
6.2. Using Message-Driven Beans
As we noted in Section 1.4 on page 6, the J2EE platform supports a new kind of enterprise bean, the message-driven bean, which allows J2EE applications to process JMS messages asynchronously. Session beans and entity beans allow you to send messages and to receive them synchronously but not asynchronously.
A message-driven bean is a message listener that can reliably consume messages from a queue or a durable subscription. The messages may be sent by any J2EE component—from an application client, another enterprise bean, or a Web component—or from an application or a system that does not use J2EE technology.
Like a message listener in a standalone JMS client, a message-driven bean contains an onMessage method that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access