If you want to just use camel to implement the RPC invocation, you have to 
setup another route to pick up the RPC invocation and send out the response 
just like this

from(“rabbitmq://xxxx”)… 

Camel won’t pick up the message from the request queue without setting up the 
route just like that.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 15, 2015 at 12:56:08 PM, souciance 
(souciance.eqdam.ras...@gmail.com) wrote:
> Hello,
>  
> I am trying to get the request/reply RabbitMQ to work as stated in :
> https://issues.apache.org/jira/browse/CAMEL-7860
>  
> This is the code I have written:
>  
> from("direct:monkey").setExchangePattern(ExchangePattern.InOut)
> .setBody(constant(monkey))
> .setHeader("rabbitmq.EXCHANGE_NAME", constant("marc"))
> .setHeader("rabbitmq.ROUTING_KEY", constant("test"))
> .setHeader("rabbitmq.REPLY_TO", constant("MARCMESSAGE.REPLY"))
> .setHeader("rabbitmq.CORRELATIONID", constant(correlationid))
>  
> .to("rabbitmq://localhost:5672/marc?routingKey=test&username=souciance&password=souciance&exchangeType=topic&autoDelete=false&declare=false")
>   
> .log("${body}");
>  
> What I don't understand is, will Camel pick up message sent by the backend
> to the queue MARCMESSAGE.REPLY and match against the correlation_id? I have
> tried to do that manually but nothing is picked up by Camel. I am a bit
> confused on how the actual scenario is similar to the RPC as stated in jira
> since in the RPC model you combine request/reply with correlationids. Is
> that also what happens here?
>  
> Thanks for any hints.
> Souciance
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Example-for-Camel-7860-tp5772659.html  
> Sent from the Camel Development mailing list archive at Nabble.com.
>  

Reply via email to