A while back, I was assigned to work on a project on which I needed to integrate with another JMS system. As I searched the web for some detailed tutorials, I didn't find any detailed tutorial that could help me. Eventually I figured out all the pieces I had the design and implement in order to get such JMS-to-JMS bridge integration. I decided to summarize the things I learned in this article, not only for my own record keeping purpose, but also helping others who needed similar information. I assumed audiences know the technologies such as spring, and jms.
The intention of this article is to provide a detailed tutorial on the following topics:
• Software required for this article.
• How to publish a Message to queue and consume it.
• How to bridge one Open-JMS to another ActiveMQ-JMS.
I hope readers will enjoy this article! If you have any questions of comments, please leave it in the FAQ section.
ActiveMQ is an open source, Apache 2.0 licensed Message Broker and JMS 1.1 implementation and Enterprise Integration Patterns provider which integrates seamlessly into Geronimo, light weight containers and any Java application. Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4.
ActiveMQ provides bridging functionality to other JMS providers that implement the JMS 1.0.2 and above specification. A JMS bridge can be co-located with an ActiveMQ broker or run remotely. In order to support JMS 1.0.2 there is separation between Queues and Topics.
• Supports a variety of Cross Language Clients and Protocols from Java, C, C++, C#, Ruby, Perl, Python, PHP
• OpenWire for high performance clients in Java, C, C++, C#
• Stomp support so that clients can be written easily in C, Ruby, Perl, Python, PHP, ActionScript/Flash, Smalltalk to talk to ActiveMQ as well as any other popular Message Broker
• full support for the Enterprise Integration Patterns both in the JMS client and the Message Broker
• Supports many advanced features such as Message Groups, Virtual Destinations, Wildcards and Composite Destinations
• Fully supports JMS 1.1 and J2EE 1.4 with support for transient, persistent, transactional and XA messaging
• Spring Support so that ActiveMQ can be easily embedded into Spring applications and configured using Spring's XML configuration mechanism
• Tested inside popular J2EE servers such as Geronimo, JBoss 4, GlassFish and WebLogic
• Includes JCA 1.5 resource adaptors for inbound & outbound messaging so that ActiveMQ should auto-deploy in any J2EE 1.4 compliant server
• Supports pluggable transport protocols such as in-VM, TCP, SSL, NIO, UDP, multicast, JGroups and JXTA transports
• Supports very fast persistence using JDBC along with a high performance journal
• Designed for high performance clustering, client-server, peer based communication
• REST API to provide technology agnostic and language neutral web based API to messaging
• Ajax to support web streaming support to web browsers using pure DHTML, allowing web browsers to be part of the messaging fabric
• CXF and Axis Support so that ActiveMQ can be easily dropped into either of these web service stacks to provide reliable messaging
• Can be used as an in memory JMS provider, ideal for unit testing JMS Can be used as an in memory JMS provider, ideal for unit testing JMS
OpenJMS is an open source implementation of Sun Microsystems's Java Message Service API 1.1 Specification
• Point-to-Point and publish-subscribe messaging models
• Guaranteed delivery of messages
• Synchronous and asynchronous message delivery
• Persistence using JDBC
• Local transactions
• Message filtering using SQL92-like selectors
• Administration GUI
• XML-based configuration files
• In-memory and database garbage collection
• Automatic client disconnection detection
• Applet support
• Integrates with Servlet containers such as Jakarta Tomcat
• Support for TCP, RMI, HTTP and SSL protocol stacks
• Support for large numbers of destinations and subscribers
Install and Configure the Required Software
This tutorial requires setup and configuration of the following software packages:
• JDK 1.5 (or higher).
• Open Jms 0.7.7 download link< http://openjms.sourceforge.net/downloads.html
• Apache ActiveMQ 5.1 download link http://activemq.apache.org/activemq-510-release.html
I also recommend the use of Eclipse IDE. But, for this tutorial, all work can be done using a simple code editor (like UltraEdit32, Crimson Editor, or Notepad), Command Prompt
For my own convenience, this tutorial was created on Windows XP. And it should be relative easy to be migrated to other platforms.