Here you will find a very simple queue-based JMS application. It consists of one or more queue-senders (class Station), which simulate the measurement of raindrops on the unit square. The coordinates of the raindrops are sent to an accumulator (class Accu) using JMS. Using some simple maths, an approximation to the number pi is calculated. Note that there are far better ways to calculate pi :-)
As a start, you should have a look at the JMS homepage. There you will find links to JMS providers (commercial and open-source). I have tested my sample with OpenJMS and with SwiftMQ.
My sample code won't teach you JMS, but will give you an impression how simple it is to use JMS once you have setup your provider.
You can download the source tarball from here. Compilation should be no problem. See the file README for details.