Book Image

Java EE 7 Development with NetBeans 8

By : David R Heffelfinger
5 (1)
Book Image

Java EE 7 Development with NetBeans 8

5 (1)
By: David R Heffelfinger

Overview of this book

Table of Contents (18 chapters)
Java EE 7 Development with NetBeans 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Consuming JMS messages with message-driven beans


The most common way of implementing JMS message consumers is by developing message-driven beans. Message-driven beans are a special type of Enterprise JavaBean (EJB) whose purpose is to listen to JMS messages on a message queue or topic. Message-driven beans provide EJB features such as transactions and scalability.

Note

In real systems, JMS message producers and JMS message consumers will be developed in separate NetBeans projects, as these are usually completely different systems. For simplicity, we will develop both the JMS producer and consumer in the same NetBeans project.

We can develop message-driven beans in NetBeans by going to File | New File, selecting the Enterprise JavaBeans category, and selecting the Message-Driven Bean file type.

Then, we need to enter an EJB Name and select an appropriate value for the Project Destinations or Server Destinations fields; in our example, we need to select the server destination we created earlier...