Day 14. Developing Message-Driven Beans

Today, you'll learn how to develop applications using asynchronous messaging. You'll work on a complete example of developing a message-driven enterprise bean (MDB).

In our sample University Registration System, a student selects items from the course catalog, places them in an enrollment cart, and, when she's ready, places an order for the cart contents. After the order is placed, we must verify the student's billing information, the classroom's capacity, and so on. We would like to enable the student to continue browsing the Web site and not require her to wait for the background processing to complete. This asynchronous processing can be best modeled using a message-driven bean. In the sample application, after the student submits an order, a Java Message Service (JMS) message is sent to a destination, where it will be processed by an OrderVerifier message-driven bean. An OrderVerifier bean is responsible for verifying the order's facts, such as the billing information and so on.

To learn how to develop and deploy an MDB, the following are the activities we'll engage in today:

  • Learn the interactions between the client, the JMS Server, the EJB container, and the message-driven bean by looking under the hood of the bean

  • Show you how to implement the message-driven bean class and write its deployment descriptor

  • Explore how to compile, package, and deploy the bean in a container

  • Learn how to write a client that sends a message to a JMS Destination for which the message-driven bean is the consumer

  • Examine the life cycle of a message-driven bean instance

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.205.99