Using JMS Queues or Topics with Message-Driven Beans

You can use a message-driven bean to asynchronously receive messages from a javax.jms.Queue or a javax.jms.Topic. When a message-driven bean is acting as a subscriber to a Topic, it can be set up as either a non-durable or durable subscriber. In most production applications, you’ll typically want to use either a persistent Queue or ensure that the message-driven bean is a durable subscriber. This will help ensure that messages are not missed.

The bean provider might provide information to the deployer as to whether the bean should be used with a Queue or a Topic by setting the message-driven-destination tag in the ejb-jar.xml file. The following code fragment shows an example of a message-driven ...

Get Special Edition Using Enterprise JavaBeans™ 2.0 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.