Skip to end of metadata
Go to start of metadata

Description:  

There are many questions in the XI forum regarding how to allow mutiple JMS sender adpaters to pick different type of messages from one queue. This wiki helps explain the process of how to use the JMS Message Selector setting for the JMS Adapter. This is particularly helpful for fixed width or delimited messages that have different layouts. This illustration helps to visualize the scenario:

Step by Step Solutions:

  1. First we have to make sure the application publishing the message to the JMS queue includes a specific Property Name and Value into the header of the message. The following figure shows that we have defined the property name ("action") and value for one type of the message. For other type of messages, we have same property name with different Values.         

        

Note: Make certain your queue server is configured to allow more than one connection to the queue because each Adapter you configure with this method will effectively have its own connection.

2.  After modifying the publishing application (Sender system), create or modify JMS adapter(s). Go to the Parameter -> Advanced tab. Check "Set Adapter-Specific Message Attribute" and scroll down the current  window.      

  


 

3.  Check Specify Additional JMS Message Properties (Maxmum of 10), and add your own property, in this case, it is "Action"    

   

4. In JMS Message Selector field of "Processing" tab, specify property condition: e.g. Action = 'your action value here'

    
After above setup, activate your adapter. It will now pick up all messages queue when the Action property contains the specified value (in this example the string ending like "...wep.ManageFieldOrder").

Now you can set alternate adapters to pick up the other types of messages you are expecting in the queue.

Caution: If no conditions are satisfied messages could be stranded in the queue!

Caution: If conditions from two adapters looking at the same queue overlap, no warning is given by XI. You will have random results on which adapter picks up the message.

Note: This example was based on the BEA Weblogic queue. OSS Note 1090516 can be referenced while deploying the driver for BEA Weblogic Queue, but the approach can be used for any supported JMS Adapter queue type.

5 Comments

  1. Unknown User (inkav9r)

    hello,

     Where would you define the filter condition. for e.g. if i want to query customer # = 12345 in the xml, how do i do it. could you clarify where the attributes and value should be maintained (your first screen shot)

    thx

  2. Unknown User (101nheipv)

    Hi, Nathan:

    Thanks drop by my wiki, however, your comment does not trigger email to me, and from here I can not also reply for you. Just add additional comments here:

    The first screen is not in XI side, it is BEA Weblogic message publisher, the screen just shows that message put into JMS queue have already has some property value assigned.

    Your question seems like you would like to pick up the message based on the payload, I am not sure if the property value can be dynamically set from payload, so I not not sure if we can do this at this level, however, you can always have option in integration directory to configure conditional routing based on the payload.

  3. Is there any way we can see the Property name like Action in JMS message received by PI. Where in PI message I can see JMS property sent ?

  4. Hi All, I tried to resolve this issue based in this wiki...anybody can help me about MQ Series (Not BEA Weblogic)..."How to do the same for MQ"? any idea, link, etc?

     

  5. Hi Martin,

     

      please try posting (referencing this Wiki page) your question in the SCN XI/PI Discussion Area (http://scn.sap.com/community/pi-and-soa-middleware/content?filterID=contentstatus%5Bpublished%5D~objecttype~objecttype%5Bthread%5D).

     

    Thanks and Regards

     

     Kenny Scott

     XI/PI SCN Moderator