0
votes

I am using WSO2 ESB 4.8.1 and RabbitMQ as a message broker. How I can set the customized replyTo queue with the producer queue. I found that in axis2 messageContext we can set the replyTo queue but it is expecting EndpointReference. Is there any way to set the string value?

2

2 Answers

0
votes

If WSO2 ESB is the producer and you want it to set the JMSReplyTo header, define a parameter named "transport.jms.replyDestination" in you uri.

Sample with ActiveMQ (I let you adapt it to RabbitMQ) :

<send>
  <endpoint>
    <address uri="jms:/dynamicQueues/RequestQueueName?transport.jms.ConnectionFactory=myQueueConnectionFactory&amp;transport.jms.ReplyDestination=ReplyQueueName/>
  </endpoint>
</send>

Define "myQueueConnectionFactory" in repository/conf/axis2/axis2.xml, inside jms transportSender definition :

<parameter name="myQueueConnectionFactory" locked="false">
    <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
    <parameter name="java.naming.provider.url" locked="false">failover:(tcp://localhost:61616)?jms.useCompression=true</parameter>
    <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
    <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
    <parameter name="transport.jms.CacheLevel" locked="false">connection</parameter>
</parameter>

--> you musn't use someting more than "connection" in CacheLevel : it won't work with "session" cache level

If this is not exacly what you need, you can try to modify the header defining such a property in transport scope :

<property name="JMSReplyTo" scope="transport" value="ReplyQueueName"/>
0
votes

When you are going to add replyTo in rabbitmq, you specify callback queue as you expect a response. That can be define in WSO2 ESB axis2.xml($ESB_HOME/repository/conf/axis2/) as a configuration.

  • rabbitmq.replyto.name

You have to give the callback queue as the value of this property.

<parameter name="rabbitmq.replyto.name" locked="false">testqueue</parameter>

And you are asking to set string value. It is bit confusing as you expect to add string value. According to amqp protocol, this property define callback queue and it expects endpoint reference as a result [1,2].

Hope this will address your issue and if you need more clarifications, please comment.

[1] https://www.rabbitmq.com/direct-reply-to.html [2] https://www.rabbitmq.com/tutorials/tutorial-six-python.html