O'Reilly logo

Applied Enterprise JavaBeans™ Technology by Kevin Boone

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10.5. Sending messages from EJBs

The process of sending JMS messages from an EJB will be illustrated using the example of LegacyMessager from the Prestige Bike Hire application. This EJB has one exposed method: dispatchToQueue(), which takes as arguments information about the customer (including credit card details) and the amount of money to be charged. This method is called by makeReservation() in the BookingManager EJB when the customer makes a reservation. This latter method also creates an instance of Booking to represent a new booking.

Note that the update of the database (that is, creating a Booking EJB) and the delivery of the message to the queue constitute a transaction. If the message can’t be delivered, we want the database to be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required