Notice something missing from the code?

We never said what kind of messages we’re listening for, or where they might be coming from.

You don’t put anything in your code that indicates the JMS destination. You can probably guess when that happens... deploy-time.

But as a Bean Provider, you tell the Deployer whether you’re looking for messages from a topic or queue. And for that, we’ll use a new tag in the deployment descriptor, just for message-driven beans. At deploy-time, the Deployer will bind your bean to a specific Topic or Queue configured as a resource in the EJB server.

image with no caption

Complete DD for a message-driven bean

image with no caption

Get Head First EJB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.