1
votes

In weblogic it is possible to create a message bridge between two JMS message queues. While configuring this bridge, a message filter can be applied so that the bridge will route messages that match the filter only.

Is it possible to achieve the same with Websphere?

Specifically I'm trying to achieve this scenario.

I have one source queue on which messages are received. Each message will have a custom JMS property set up. I would like to forward the messages on the source queue, to separate queues based on the JMS property and its value. This is easily configured in WLS using message bridges with filtering. How can I do the same in WAS?

Thanks Savio

3
Are you using SIB or another messaging provider ?Aviram Segal
We're using the default, SIB.Savio DSouza

3 Answers

0
votes

You need to use SIB Mediation.

The WAS info center have an example called writing a routing mediation which seems like what you need.

At the bottom of the example there is a link to what to do next which also explains how to configure WAS to use that mediation.

0
votes

Without writing custom code (as per your comment on Aviram's answer), it is not possible to achieve the exact same thing, but nonetheless it is possible to achieve same effect;

You say that a 'source queue' distributes messages to other 'separate queues' according to a custom JMS property. I'm assume that you have MDBs (message driven beans) configured to process messages in these separate queues.

What you can do with WebSphere is distribute messages to these MDBs directly from the 'source queue', without having to filter/distribute them to separate queues.

This is managed by using JMS Message Selectors. You can point all your MDBs to the source queue using activation specification definitions, and for each (one for each type of message) MDB, define a JMS Message Selector that matches the ones you use in WLS. This way each message is only delivered the MDB whose filter matches the message's properties. This effectively filters/distributes messages to different MDB's as in WLS.

You may read details on configuring message selectors (during development in RAD, or at/after deploy time) at infocenter. Below is a quote to give you an idea about what it look like;

messageSelector

This attribute determines the JMS message selector that is used to select which messages the message-driven bean receives. For example:

JMSType='car' AND color='blue' AND weight>2500

The selector string can refer to fields in the JMS message header and fields in the message properties. Message selectors cannot reference message body values.

0
votes

For the record, we finally ended up writing our own routing algorithm within the application to ensure that messages are sent to separate queues for each client. This way we are independent of app server implementations and the integration effort is the same across app servers, viz., adding custom queues per integrating client.

In brief, We published a JMS custom property that must be set. Using a published convention, we look up for a queue and send responses to the queue. If the property is not set, a default queue is created to route all messages. If the property is set, and the queue cannot be found an exception is raised and processing halted.

This suited our purpose. Hope it helps...