This exercise is an extension of the preceding one.
You’ll add a
ReservationProcessor, which plays the
same role as the TravelAgent EJB but receives its booking orders
through a JMS queue instead of synchronous RMI invocations.
To test the MDB, you’ll build a new client application that makes multiple reservations in batch, using a JMS queue that’s bound to the MDB. You’ll also build a second client application that listens on another queue to receive booking confirmations.
Along the way, you’ll learn how to create a new JMS queue in JBoss and configure a message-driven bean (MDB).
If JBoss is already running, there is no reason to restart it.
Because the exercise uses the ProcessPayment EJB used in recent
exercises, the database must contain the
Ant targets, Java code, and clients here have been borrowed from
If you haven’t already dropped the
PAYMENT table after running the examples in
Exercise 12.1, do so now by running the
C:\workbook\ex12_2>ant dropdb Buildfile: build.xml prepare: compile: dropdb: [java] Looking up home interfaces.. [java] Dropping database table... BUILD SUCCESSFUL
Then re-create the
PAYMENT database table by
createdb Ant target:
C:\workbook\ex12_2>ant createdb Buildfile: build.xml prepare: compile: ejbjar: createdb: [java] Looking up home interfaces.. [java] Creating database table... ...