on 03-24-2014 11:41 AM
Hi
I would like to be able to set the ReplyTo Queue Name dynamically when sending to a JMS receiver channel. I tried doing that by setting the ReplyTo queue name in a UDF using this code:
String x = container.getInputParameters().getString("replyToQueueName");
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION) ;
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS", "DCJMSReplyTo") ;
conf1.put(key1, x);
That part seems to work; the Dynamic configuration variable DCJMSReplyTo is set to the correct value according to the message monitor.
My problem is though, that the receiver JMS channel is sending the actual message to this (ReplyTo) queue and not the queue that I specified in the configuration for the JMS receiver channel.
My configuration is like this:
Transport protocol: Access JMS Provider with JNDI
JNDI Lookup Name of Topic/QueueConnectionFactory: ConnectionFactory
JNDI Lookup Name of JMS Queue/Topic: dynamicQueues/TEST.ENDUR.DEAL.REQUEST.STP
Name of JNDI Initial Context Factory: org.apache.activemq.jndi.ActiveMQInitialContextFactory
JNDI Server Address: tcp://os......
Under Adapter Specific Message Attributes I have ticked "JMS Message ReplyTo Destination"
Under Additional Parameters I have specified "JMS.Message.DynamicDestination" + "true"
Any suggestions how I get the channel to send to the configured queue (TEST.ENDUR.DEAL.REQUEST.STP) with the value of the DCJMSReplyTo variable being set via the UDF?
Regards
MIkael
Hi
Remove the parameter JMS.Message.DynamicDestination from the receiver communication channel and uncheck ASMA , then the mesasge will go to the hard coded queue name that you will be specified in the channel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sure I can Indrajit
I would like the message to be sent to a certain JMS queue. We can call this queue "1". And I would like the attribute "ReplyTo Queue"on that message to be the name of another queue, let's call this queue "2".
So I specify "1" in the Queue Name field in the JMS receiver channel and I leave the ReplyTo Queue Name" field in the JMS receiver channel blank because I would like to set this value via Dynamic Configuration to "2".
The problem is though, that the message is sent to "2".The ReplyTo Queue attribute of the message is also "2" which is what I want so that s fine.
I hope this clarifies the problem.
/Mikael
I found that if I in the JMS receiver queue tick Specify Additional JMS Message Properties (Maximum of 10) and provide the name JMSReplyTo and the value Sting I can collect the ReplyTo queue name via a parameter in the operation mapping and the value of that parameter I can set to the Dynamic Configuration variable DCJMSMessageProperty0 in a UDF like this:
String x = container.getInputParameters().getString("replyToQueueName");
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION) ;
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS", "DCJMSMessageProperty0") ;
conf1.put(key1, x);
return "";
Hi Mikael,
Thanks for explaining ,we are having requirement on IDOC to JMS bypass scenario ,here we have to update (Websphere MQ) JMS channel(Queue,host name,port) dynamically from mapping.
I have tried your code but i got mapping error with "com.sap.aii.mapping.api.UndefinedParameterException: The input-parameter replyToQueueName does not exist.] in class com.sap.xi.tf ".Pleas help me to achieve this requirement .
Thanks in advance .
Thanks & Regards:
Ganesh Gullipalli
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.