cancel
Showing results for 
Search instead for 
Did you mean: 

JMS Queue - how to determine dynamically

che_eky
Active Contributor
0 Kudos

Hi,

I have the following scenario File -> PI -> JMS Queue

Based on the above I would like to dynamically determine the JMS Queue name based on the source file name, for example:

XXX_data_file.xml should route to JMS Queue XXX_JMS_Q

YYY_data_file.xml should route to JMS Queue YYY_JMS_Q

<any>_data_file.xml should route to JMS Queue <any>_JMS_Q

How can I dynamically set the JMS Queue name?

There are several suggestions which say to use 'DCJMSReplyTo' but they make no sense to me. I have looked in WIKI "FAQ J2EE JMS Adapter" and "Note 856346 - J2EE JMS Adapter: Frequently Asked Questions (FAQ).

I can get the source file name in a UDF but how to set the target JMS Queue in the same UDF?

Che

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

too sure if this work ...but worth a try...

I have used something called - varible substitution in the File adapter wherein the filename comes from a field in ur target message. I think the same concept may work for JMS too...

Herezz how its done -

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

U already know have the filename...in the advanced section of the JMS adapter create a variable and point it to the JMS name. and use this variable in the JMS queue name..

Good luck!1

Regards,

Arvind R

Former Member
0 Kudos

Check the following link for how to get the name of the file:

http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm

In your target strucuture, add one elment to hold the above file name:

In your receiver determination, you use conditonal routing, you can say

if file name element = file 1, then select your queue1 receiving system

if file name element = file 2, then select your queue2 receiving system

.....

If you do not want to have many receiving system, you can also use conditional interface determination as well, that way, you need to have number of inbound interfaces that corresponding to your queue.

in this case, you just have one receiving system.

Regards.

Liang

Edited by: Liang Ji on Jun 2, 2009 8:07 PM