23.07.2013 Views

O'Reilly - Java Message Service

O'Reilly - Java Message Service

O'Reilly - Java Message Service

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Java</strong> <strong>Message</strong> <strong>Service</strong><br />

With the message-driven bean, it is important to understand that messages do not have to<br />

be produced by other beans in order for them to consumed by a message-driven bean.<br />

<strong>Message</strong>-driven beans can consume messages from any topic or queue administered by a<br />

JMS provider. [3] <strong>Message</strong>s consumed by message-driven beans may have come from other<br />

beans (session, entity, or message-driven beans), web components, application client<br />

components, normal non-J2EE JMS clients, or even legacy messaging systems supported<br />

by a JMS provider. A legacy application might, for example, use IBM's MQSeries to<br />

deliver messages to a queue, which is consumed by other legacy applications as well as<br />

message-driven beans.<br />

[3] In most cases the EJB vendor will also be the JMS provider, but it's possible some EJB vendors<br />

will provide hooks that allow third-party JMS providers to manage delivery of messages to an EJB<br />

container's message-driven beans.<br />

The <strong>Message</strong>DrivenBean interface is not specific to JMS-based messaging. While EJB 2.0<br />

requires support for JMS-based messaging, the specification also allows vendors to<br />

support other protocols and messaging systems (e.g., HTTP, ebXML, SMTP) using<br />

proprietary message-driven beans. And this is why the message-driven bean in EJB 2.0<br />

implements both the <strong>Message</strong>DrivenBean interface, as well as the <strong>Message</strong>Listener<br />

interface, to distinguish it as a message-driven bean.<br />

132

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!