cancel
Showing results for 
Search instead for 
Did you mean: 

setting the ReplyTo Queue Name dynamically in JMS receiver channel SAP PI 7.31 SP10

Former Member
0 Kudos


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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Indrajit

thanks for replying but I don't think you have understood the issue here. The whole point is to have ReplyTo Queue Name set dynamically via dynamic conf and not as you suggest via a hard coded value in the JMS receiver channel.

Former Member
0 Kudos

Hi Mikael

Can you please explain what this line means

'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'??





Former Member
0 Kudos

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

Former Member
0 Kudos

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 "";

gganesh15051
Explorer
0 Kudos

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

Answers (0)