FAQ
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.

Search Discussions

  • Willem Jiang at Oct 19, 2015 at 12:03 am
    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.rashti@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.
  • Souciance at Oct 19, 2015 at 7:52 am
    Hi Willem,

    Thanks for your reply. Yes, true, another route is needed to pick up the
    message.

    However, will the camel route that is sending the message to the exchange be
    listening on the reply to queue? So if a message is published on the reply
    to queue, then the sending camel route, will pick it up? This is what I
    could not get to work. Publishing it worked, but when I put a message on the
    reply destination, the sending route didn't react.


    /Souciance



    --
    View this message in context: http://camel.465427.n5.nabble.com/Example-for-Camel-7860-tp5772668p5772853.html
    Sent from the Camel Development mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescamel
postedOct 15, '15 at 4:56a
activeOct 19, '15 at 7:52a
posts3
users2
websitecamel.apache.org

2 users in discussion

Souciance: 2 posts Willem Jiang: 1 post

People

Translate

site design / logo © 2021 Grokbase