Rajiv Patil
Rajiv Patil

Reputation: 129

WSO2 ESB Proxy - JMS Message Selector

We have WSO2 ESB listening on to a single ActiveMQ Queue. However we want to configure multiple proxies on listening on to the JMS queue.. however we want the proxy to only consume message meant for it. Is there a mechanism to set JMS Message selector on the ESB Proxy so that it consumes only message designated for it. ?

Thanks Rajiv Patil

Upvotes: 0

Views: 875

Answers (2)

Voicu
Voicu

Reputation: 17850

Yes, you can have multiple proxy services listening to the same queue, each following a certain JMS MessageSelector. You will have to set the transport.jms.MessageSelector parameter for each proxy like this (value 100 is variable, each proxy service containing a different number):

<parameter name="transport.jms.MessageSelector">account='100'</parameter>

And the Java message producer sending the message to the JMS broker is setting the message selector with:

// this will set a key/value pair as JMS message selector
// 100 should be a variable in your case
message.setStringProperty("account", "100");

This was tested on ActiveMQ 4.7 and WSO2 ESB 4+.

Upvotes: 0

Sumedha Kodithuwakku
Sumedha Kodithuwakku

Reputation: 612

AFAIK it is not possible to perform such a selection. However there are two possible approaches to achieve the above.

  1. Let each proxy read all the messages and select which to process inside the proxy itself
  2. Use an EIP pattern to achieve the above. One possible pattern would be Message Routing where you can select the messages and direct the message to the desired sequence or proxy which will do the processing.

Upvotes: 0

Related Questions