Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

JMS transport nodes in WebSphere Message Broker V6

Rich Bicheno (Rich_Bicheno@uk.ibm.com), Performance Analyst, WebSphere Message Broker Performance team, IBM
Rich Bicheno is a Performance Analyst on the WebSphere Message Broker Performance team at the IBM Hursley Software Lab in the UK. He works with the Development teams to develop new releases of WebSphere Message Broker, and he works as a Consultant with customers on WebSphere Message Broker design, configuration, and tuning issues. You can contact Rich at Rich_Bicheno@uk.ibm.com.

Summary:  While the popular Java Messaging Service (JMS) standard offers the advantage of a common API, interconnecting different JMS providers can be a challenge because it is a standard and not a wire format. This article shows you how the new JMS transport nodes in WebSphere Message Broker V6 can solve this problem easily and flexibly.

Date:  12 Apr 2006
Level:  Introductory
Also available in:   Chinese

Activity:  8100 views
Comments:  

Introduction

Although Java™ Messaging Service (JMS) is now widely used as the standard for enterprise messaging, it does not resolve many of the connection problems between applications, sometimes not even between one JMS application and another, let alone bridging the gap between JMS and non-JMS applications.

JMS transport nodes, a new feature in IBM® WebSphere® Message Broker V6, can help you resolve these connection and protocol conversion challenges. This article describes what the JMS transport nodes are, how to configure them, and how to use them to solve common connection or protocol conversion problems and increase the business value of your messaging infrastructure. In addition to outlining the function, use, and value of the nodes, this article also offers advice on key performance and scalability considerations when implementing message flows that use JMS transport nodes.

What is JMS?

JMS is the standard J2EE messaging API for building enterprise messaging applications. The JMS specification offers an abstract, provider-independent messaging interface, so that you can write messaging applications to this common API without worrying about the underlying messaging implementation. JMS offers two common messaging paradigms on which to build messaging applications: point-to-point and publish/subscribe (pub/sub). JMS applications send messages to JMS destinations, which can be queues (in the point-to-point domain) and topics (in the pub/sub domain).

Benefits of using JMS as the messaging interface include:

  • Since they are written to a standard API, applications are portable between JMS providers, and you should be able to move your application to any other JMS provider.
  • Programmers can write to a common API regardless of the underlying implementation, which means your programmers can build common skills and instead of needing to develop in-depth knowledge of specific products.

For more information on JMS, see the JMS specifications from Sun Microsystems.

Most enterprise messaging providers offer a JMS implementation as a mechanism for using their products. WebSphere Message Broker V6 and its predecessor releases, as well as WebSphere MQ, are JMS providers, and let you perform JMS messaging across WebSphere MQ, WebSphere real-time and WebSphere multicast transports.

Integrating JMS within the enterprise

One of the claimed benefits of JMS is that it enables portable applications. But in practise, many JMS providers offer extensions and capabilities beyond the standard JMS API, resulting in applications that are no longer truly portable. Once a JMS application is written, tested, and in production, you will probably not want to move messaging providers and risk outages as a result of the migration.

Adding new applications to the existing infrastructure using a new JMS provider can present a challenge, because the JMS specification does not define the wire format for JMS communications. Therefore underlying messages are likely to be incompatible between JMS providers, with one JMS provider unable to send a message directly to another JMS provider without a transformation between the two formats. This incompatibility presents a problem when integrating JMS applications based on different providers within your enterprise, and you need to convert the protocol of one JMS message implementation to that of the others. The new JMS transport nodes in WebSphere Message Broker V6 can add significant value to your enterprise by resolving this communications issue.

Another common enterprise scenario involves connecting a JMS-based application to a proprietary messaging application. The two messaging formats are incompatible, and once again some form of integration and transformation between the two systems is needed, and it can be provided by the JMS transport nodes in WebSphere Message Broker V6.

What are the JMS transport nodes?

WebSphere Message Broker V6 supports many messaging protocols, including:

  • HTTP and Web services
  • WebSphere MQ
  • WebSphere MQTT
  • WebSphere MQ real-time

JMS transport nodes extend this list by enabling WebSphere Message Broker V6 to send and receive messages from any JMS provider transport, as long as the provider is compliant with the JMS 1.1 specification. JMS transport nodes enable a broker to be a JMS client (JMS consumer or JMS producer) to any JMS provider, which enables the broker to send messages to and receive messages from the JMS provider. JMS nodes can operate in both JMS messaging paradigms: point-to-point and pub/sub.

There are four types of JMS transport nodes:

JMSInput node
Acts as a JMS consumer to a JMS destination, and can connect to the JMS provider in point-to-point mode as a queue receiver or in pub/sub mode as a subscriber. The role of the node is to receive messages into the message flow that will transform and route the message. Once the input node has received a JMS message, it builds an internal JMS message tree that you can use like any other WebSphere Message Broker tree representation. The JMSInput node can receive all six types of JMS message as defined by the JMS 1.1 specification: Base JMS message, Text, Object, Bytes, Stream, and Map.
JMSOutput node
Acts as a JMS producer to a JMS destination. It can connect to the JMS provider in point-to-point mode as a queue sender or as a publisher in pub/sub mode. Its role is to send messages that have been transformed and routed in the message flow. It converts the internal JMS tree into a JMS message to be sent to the JMS provider. The JMSOutput node can send all six types of JMS message as defined in the JMS 1.1 specification.
JMSMQTransform node
Used in conjunction with the JMSInput node. It converts the message received from a JMS provider into a format that can be sent to WebSphere MQ.
MQJMSTransform node
Used in conjunction with the JMSOutput node. It converts the message received from WebSphere MQ into a format that can then be sent to the JMS provider.

Node configuration

JMS nodes have the same configuration requirements as any JMS client -- access to the JMS provider's client code, the definitions required to access the JNDI repository, and the name of the administered objects to retrieve from the repository. The nodes can reuse any existing JNDI repositories and administered objects that are already set up for the existing JMS network. These settings are made by altering the node properties in the WebSphere Message Broker toolkit. An example of the configuration properties for the JMSInput node is shown in Figure 1 below. A key advantage of the implementation of these nodes is that you do not need to write any code to set them up:


Figure 1. JMSInput node configuration properties
Figure 1. JMSInput node configuration properties

More advanced JMS client configurations, such as adding message selectors to filter incoming messages, are also configurable as node properties. For more information on these settings, see the WebSphere Message Broker toolkit online help.

Connection to a JMS provider

Figure 2 below shows how the JMSInput and JMSOutput nodes connect to a JMS provider. The diagram shows the JMSInput and JMSOutput nodes running in a message flow that will be hosted in a broker. As mentioned above, the nodes behave like clients, so like any JMS client, they use JNDI to look up the JMS connection factories and destinations. They then use the objects they have looked up to connect to the JMS provider and the specified destination (either a queue or topic) and send messages to or receive messages from the destination:


Figure 2. JMSInput and JMSOutput nodes connecting to a JMS provider
Figure 2. JMSInput and JMSOutput nodes connecting to a JMS provider

Technology benefits and business value

So far this article has focused on what the JMS transport nodes are and how they can be configured and used. This section describes some common scenarios that show how you can use these nodes in your enterprise messaging infrastructure. As you will see, JMS transport nodes help you solve many conversion and bridging problems solutions with no coding on your part.

Enrich an existing JMS provider

You can use JMS transport nodes to enrich any enterprise messaging system that has JMS 1.1 support by adding brokering function to the JMS network. Once a JMSInput node has received a message from a JMS provider, all WebSphere Message Broker V6 transformation and routing capabilities are available to process the messages. On completion of the message processing, you can send the result back to the same or to another JMS network via the JMSOutput node.

Some simple example flows are shown in Figure 3 below. They show the XML Transformation and the Database nodes being used to transform and store JMS messages in a database:


Figure 3. Message enrichment message flows using the JMSInput and JMSOutput nodes
Figure 3. Message enrichment message flows using the JMSInput and JMSOutput nodes

Bridge any JMS providers

As discussed above, there are is wire compatibility between different JMS providers. Without WebSphere Message Broker V6, bridging between any two JMS providers typically requires custom code. The JMS transport nodes in WebSphere Message Broker V6 let you do the the bridging without writing any custom code.

Figure 4 below shows how the JMSInput Node can connect to one provider and the JMSOutput node can connect to another provider, so that the messages will flow from one provider to the other. Additionally, you could if you want, insert any of the WebSphere Message Broker nodes in between to perform any additional transformation or routing processing:


Figure 4. Bridging JMS providers using JMSInput and JMSOutput nodes
Figure 4. Bridging JMS providers using JMSInput and JMSOutput nodes

Any JMS 1.1 compliant providers can be bridged in this manner, such as integrating WebSphere MQ JMS and the WebSphere Service Integration Bus (the WebSphere Application Server V6 JMS provider). Therefore you can run many similar flows using other providers within the same message broker, using the broker as a bridge between any number of different providers.

Integrating JMS with application server applications

Any J2EE-compliant application server such as WebSphere Application Server must include a JMS provider to enable J2EE applications to do messaging. Therefore it is common for Web applications using Java servlets or EJBs running on an application server to use JMS.

JMS transport nodes let WebSphere Message Broker V6 connect to any JMS 1.1-compliant JMS provider. Therefore they can connect to the JMS provider of an application server. Once a message broker can communicate with the JMS provider of an application server, it can send messages to and receive messages from the JMS destinations that are being used by the servlets, EJBs, or MDBs running on the application server. Therefore you can use use WebSphere Message Broker V6 to enrich messages being used by the application, or even to bridge the application to WebSphere MQ or to another JMS Network. It is now possible to enrich Web-based applications running on an application server using WebSphere Message Broker V6, or to integrate those applications with the rest of your enterprise infrastructure using the integration capabilities of WebSphere Message Broker V6.

Bridge any JMS provider to WebSphere MQ

You can use the MQJMSTransform and JMSMQTransform nodes to connect any JMS network to an existing WebSphere MQ Network. Figure 5 below shows how you can use these nodes in a message flow to perform this function:


Figure 5. Transforming messages between JMS and MQ
Figure 5. Transforming messages between JMS and MQ

This feature lets you easily integrate JMS networks with any MQ-enabled applications. JMS transport nodes let you connect:

  • WebSphere MQ-enabled applications to JMS applications
  • One JMS network to other JMS networks

Thus you can connect WebSphere MQ clusters and WebSphere Application Server clusters. And because that connection is achieved using WebSphere Message Broker, it is robust and scalable.

Using transactions with JMS providers

The JMS transport nodes offer different levels of transactional support, which can be configured as a property of the node instance depending on your particular requirements:

  • They can be non-transacted, so that messages passing through the flow are not part of any transaction. This setting best suits non-persistent messages where high throughput is a requirement.
  • The individual nodes can be enabled for local transactions, which means that each node uses a transacted JMS session to their JMS provider, so the messages are sent and received as part of individual transactions.
  • The third level of transactionality is global transactions (also known as XA transactions). JMS destinations that supply messages to a JMSInput node, or receive messages from a JMSOutput node, can be coordinated as part of a message flow global transaction. Therefore the whole operation performed by the flow can be contained in a transaction, so that all or none of the processing takes place, depending on the outcome of the transaction.

Global transactions are available to any JMS provider that conforms to the JMS 1.1 specification, and supports the JMS XAResource API through the JMS session. An example of such a provider is WebSphere MQ JMS. Global transactions use the WebSphere MQ Queue Manager as the transaction coordinator. The coordinator handles events such as transaction start and end, and the need for other resources to be included in the unit-of-work, including resources such as updates to WebSphere MQ queues, DB2 databases, and any XA-compliant JMS provider destination. Therefore you can combine one or more JMS providers in a single XA transaction. For example, within the same XA transaction, you can include:

  • Receiving a message from WebSphere MQ
  • Logging the message to a database
  • Sending the message to a JMS provider

Any of the message flows shown above can also be included in an XA transaction.

Connecting JMS pub/sub and point-to-point networks

As shown above, JMS nodes can act in either the point-to-point or pub/sub domain. Within a single flow, you can therefore have the JMSInput node connected to a JMS point-to-point network, and the JMSOutput node configured to a JMS pub/sub network. The reverse configuration is also possible. Thus a message published on a queue can be received by the JMSInput node and published to a topic on a pub/sub network by the JMSOutput node, which provides a fast way to connect the different messaging domains without custom coding. Figure 6 shows a simple way to make this connection:


Figure 6. Connecting point-to-point and pub/sub
Figure 6. Connecting point-to-point and pub/sub

Performance and scalability

This section discusses performance considerations when implementing message flows that use the JMS transport nodes. For more information on JMS transport node performance, see WebSphere Message Broker V6 performance reports.

JMS Transport node performance depends on which JMS client and transport you use. For example, WebSphere MQ real-time transport generally yields a much higher message rate than WebSphere MQ client transport, because WebSphere MQ real-time transport is a lighter weight protocol, with the tradeoff that it offers a lower quality of service than WebSphere MQ client transport.

As with any JMS application, the quality of service you choose impacts performance -- reliability and robustness have a cost. For example, a non-persistent, non-transacted client performs better than a persistent and transacted client, so use these options only when necessary.

Each JMS provider has tuning parameters and techniques to enhance JMS performance. For performance tuning information for the JMS server or JMS client setup, see the JMS provider documentation. For performance tuning information on the IBM JMS providers, see the Resources section below.

Message type and size are also important performance factors. Smaller messages offer better performance, particularly when using persistent messages. The different types of JMS message are handled differently by the nodes. JMS Bytes messages require less work than the other message types, while JMS stream and JMS map messages require extra work to be parsed and interpreted and therefore offer lower performance for a given amount of resource.

Typically, when scaling any WebSphere Message Broker application, using additional copies of the message flow (additional instances) and multiple execution groups will increase message throughput rates. For examples of such scaling, see WebSphere Message Broker V6 performance reports. The same is true for message flows involving the JMS transport nodes. The exact gains vary depending on the scenario.

In point-to-point mode, with each additional instance of the message flow, a new connection to the JMS provider is made (for both JMSInput and JMSOutput nodes) to the same JMS queue. The result is multiple connections and threads serving the same destination, with the potential for higher message rates.

In pub/sub mode, there is a limit of one connection to a destination from a JMSInput node (to avoid multiple subscriptions and resulting duplicate messages), and therefore additional instances are not helpful. However, by using a different approach, you can build message flows with the JMS transport nodes within them that allow message throughput to be scaled with additional copies (though not with additional instances). You must design the topic tree such that each copy of the message flow can serve a particular topic or portion of the tree. In this way, you can concurrently run multiple message flows (containing JMS transport nodes) where each message flow subscribes or publishes to a different topic.

Conclusion

This article has explained the role and function of the new JMS transport nodes in WebSphere Message Broker V6. It has shown how you can use the nodes to solve common protocol conversion and bridging problems. Typical uses of the nodes include:

  • Enriching an existing JMS provider
  • Bridging any JMS providers
  • Integrating JMS with application server applications
  • Bridging any JMS provider to WebSphere MQ
  • Using JMS providers in XA-coordinated transactions
  • Connecting JMS pub/sub and point-to-point networks

In a number of the cases, no coding is needed, which is a big advantage when you need to solve a protocol conversion or bridging problem with minimal effort. In other cases you may need to perform more complex transformation or routing processing on a message, and you can use the full range of WebSphere Message Broker function once the message has been read into a message flow using one of the JMS transport nodes. This article also discussed performance and scalability considerations when designing your message flow applications.


Resources

About the author

Rich Bicheno is a Performance Analyst on the WebSphere Message Broker Performance team at the IBM Hursley Software Lab in the UK. He works with the Development teams to develop new releases of WebSphere Message Broker, and he works as a Consultant with customers on WebSphere Message Broker design, configuration, and tuning issues. You can contact Rich at Rich_Bicheno@uk.ibm.com.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=108059
ArticleTitle=JMS transport nodes in WebSphere Message Broker V6
publish-date=04122006
author1-email=Rich_Bicheno@uk.ibm.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers