Workbook 10 delta

Exercise 12.1: The Messag-Driven Bean

As the configuration of JMS queues is application server dependent, this is quite different for Sun Application server, at least two ways do exist to create JMS queues. The queues must be created before executing the exercise.

Creating using the adminstration panel.

First method is using the application console http://localhost:8010/asadmin/admingui/TopFrameset

Select Resources->JMS Resources->Connection Factories and select new.

Fill In the JNDI Name and select the Type. (I choose the name jms/ConnectionFactory of type javax.jms.QueueConnectionFactory.) The rest of the entries i have left unchanged.

Also select Destination Resources and then new.

Fill in the JNDI Name (queue/titan-ReservationQueue) Select the Type (javax.jms.Queue) and give a value to the Name property (titanReservationQueue).

Also do this to create the second queue (queue/titan-TicketQueue with as name titanTicketQueue)

It is important to not use a – in the name property, execution of the exercise will fail if a – is used in the name.

Creating using the command line utility.

This can also be performed using the asadmin command line utitlity.

asadmin create-jms-resource --user admin -–port 8010--restype javax.jms.ConnectionFactory --property imqDestinationName=connectionFactory jms/ConnectionFactory
asadmin create-jms-resource --user admin --port 8010 --restype javax.jms.Queue --property imqDestinationName=titanReservationQueue  queue/titan-ReservationQueue

asadmin create-jms-resource --user admin --port 8010 --restype javax.jms.Queue --property imqDestinationName=titanTicketQueue  queue/titan-TicketQueue

Executing the exercise

He message driven bean has slighly adapted annotations. Furthermore I have adapted the client selects the list of valid id's from the database instead of guessing. Both clients can be run using the ant build file (run.bookinbatch and run.consumer). (To break a potential deadlock when performing Connection.close() the posting client has a System.exit after a timeout.)

Back to the index Further to Workbook 11

UUIDs and information about UUIDs
If you have improvements, contact information on the homepage of this host.
The uptime of this host