In this chapter we started off by looking at a general overview of PTP messaging before moving on to discuss message queues and queue management. In order to run the examples later in the chapter we installed our software environment and set up our connection factory, destinations, and users on FioranoMQ.
We then moved on to discuss transactions, noting that transactions are essential for distributed applications, and that transactions provide modular execution, which complements a component technology's modular programming. A series of incoming and outgoing messages can be grouped together into a transaction – a property that JMS can utilize in a number of different ways.
We had an overview of using transactional sessions and saw that you can use the javax.jts.UserTransaction class to achieve transactional work coordination between JMS and other transactional systems like EJBs. We then discussed distributed transactions and noted that providers are not required by the JMS specification to implement them. Providers who do want to implement distributed transactions in their servers can do so by using the JTS XA interfaces.
We then moved on to discuss an implementation of an online banking application in which we set up three common banking features – transferring funds from one account to another transactionally, stopping payment instructions from an account holder, and browsing pending instructions for a particular account holder.
While developing this application, we looked at:
Providing for user identification, authorization, and remoting
Releasing JMS resources
Setting message priorities and message expiration
Message delivery modes
Simulating request/reply messaging in PTP
The JMSCorrelationID and the JMSReplyTo message properties
Setting up and using temporary queues
Installing exception handlers
Concurrent delivery of JMS message
Setting up message listeners
Setting up message selectors
Browsing queue messages
Running JMS applications remotely as applets on a web browser
In the next chapter we will learn about the Publish/Subscribe messaging model by developing a retail stock brokerage application.