See the IBM WebSphere Developer Technical Journal: Launching a stand-alone Java application in WebSphere MQ V6.0 . Although the article focuses on WebSphere MQ, code loading is a simple JMS with JNDI images and should run on any compatible JMS provider.
The best part is that it works for both queues and topics, and will either be a message producer or a message consumer based on run-time parameters. You can run it as a producer, and the other (or two, three, or four) as a consumer to check the queue or topic. The code is very simple non-gui, which makes it a great starting point for experimentation. For example, you can easily change it to set the expiration date of a message or a bridge between topics and queues.
T.Rob source share