[ 
https://issues.apache.org/jira/browse/CAMEL-7009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13832757#comment-13832757
 ] 

Jason Foster commented on CAMEL-7009:
-------------------------------------

I downloaded the source from here 
http://www.interior-dsgn.com/apache/camel/apache-camel/2.12.1/apache-camel-2.12.1-src.zip
 and don't see the code you've pasted in... not sure if we're talking about the 
same code...The only reference I can see to REPLY_TO in any of the source in 
that jar is in the RabbitMQProducer class.

If I run the above route in camel, and run the above python script, these are 
the headers I see:

[) thread #2 - RabbitMQConsumer] route1                         INFO  Headers: 
{rabbitmq.EXCHANGE_NAME=talentsprout.rpc, 
breadcrumbId=ID-DENORALT852-61351-1385483624264-0-1, rabbitmq.ROUTING_KEY=ping, 
rabbitmq.DELIVERY_TAG=1}



> RabbitMQ Consumer does not pick up REPLY_TO
> -------------------------------------------
>
>                 Key: CAMEL-7009
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7009
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-rabbitmq
>    Affects Versions: 2.12.1
>            Reporter: Jason Foster
>            Assignee: Willem Jiang
>
> When using RPC in RabbitMQ, the producer sets up an exclusive queue and 
> specifies that queue as the reply_to on outgoing messages.  When the consumer 
> in camel-rabbitmq receives the messages, the reply_to isn't available on the 
> exchange, so no RPC calls can be completed.
> The following Python script (from RabbitMQ In Action) produces the message 
> with a reply_to property:
> import time, json, pika
> creds_broker = pika.PlainCredentials("guest", "guest")
> conn_params = pika.ConnectionParameters("localhost",
>                                          virtual_host = "/",
>                                          credentials = creds_broker)
> conn_broker = pika.BlockingConnection(conn_params)
> channel = conn_broker.channel()
> msg = json.dumps({"client_name": "RPC Client 1.0",
>                   "time" : time.time()})
> result = channel.queue_declare(exclusive=True, auto_delete=True)
> msg_props = pika.BasicProperties()
> msg_props.reply_to = result.method.queue
> channel.basic_publish(body=msg,
>                       exchange="talentsprout.rpc",
>                       properties=msg_props,
>                       routing_key="ping")
> print "Sent 'Ping' RPC call.  Waiting for reply..."
> def reply_callback(channel, method, header, body):
>      """Receives RPC server replies."""
>      print "RPC Reply --- " + body
>      channel.stop_consuming()
> channel.basic_consume(reply_callback,
>                       queue=result.method.queue,
>                       consumer_tag=result.method.queue)
> channel.start_consuming()
> The following route in Camel would consume messages from this queue:
>               
> from("rabbitmq://192.168.213.130/talentsprout.rpc?queue=ping&routingKey=ping&durable=False&autoDelete=False&autoAck=False&username=guest&password=guest")
>               .log("Headers: ${headers}");
> The log statement from that route shows that no reply_to header is added.
> Without this feature, RPC from external producers cannot work.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to