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

Jason Foster edited comment on CAMEL-7009 at 11/26/13 5:07 PM:
---------------------------------------------------------------

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 looked in 
apache-camel-2.12.1\components\camel-rabbitmq\src\main\java\org\apache\camel\component\rabbitmq\RabbitMQConsumer.java
 and don't see the code you posted in the comment.  I also did a full search 
through the entire camel 2.12.1 source tree for that constant (using 
ultra-edit), and only found the following two references:

----------------------------------------
Find 'RabbitMQConstants.REPLY_TO' in 
'C:\DevJava\Workspaces\apache-camel-2.12.1\components\camel-rabbitmq\src\main\java\org\apache\camel\component\rabbitmq\RabbitMQProducer.java'
 (11/26/2013 10:01:38 AM; 9/18/2013 9:35:08 PM):
C:\DevJava\Workspaces\apache-camel-2.12.1\components\camel-rabbitmq\src\main\java\org\apache\camel\component\rabbitmq\RabbitMQProducer.java(90):
         final Object replyTo = 
exchange.getIn().getHeader(RabbitMQConstants.REPLY_TO);
Found 'RabbitMQConstants.REPLY_TO' 1 time(s).
----------------------------------------
Find 'RabbitMQConstants.REPLY_TO' in 
'C:\DevJava\Workspaces\apache-camel-2.12.1\components\camel-rabbitmq\src\test\java\org\apache\camel\component\rabbitmq\RabbitMQProducerTest.java'
 (11/26/2013 10:01:38 AM; 9/18/2013 9:35:08 PM):
C:\DevJava\Workspaces\apache-camel-2.12.1\components\camel-rabbitmq\src\test\java\org\apache\camel\component\rabbitmq\RabbitMQProducerTest.java(101):
         message.setHeader(RabbitMQConstants.REPLY_TO, "bbbbdfgdfg");
Found 'RabbitMQConstants.REPLY_TO' 1 time(s).
Search complete, found 'RabbitMQConstants.REPLY_TO' 2 time(s). (2 file(s)).

Not sure if the trunk has been updated and not released, or if we're not 
talking about the same code.

However, 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}




was (Author: jrfoster67):
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 looked in 
apache-camel-2.12.1\components\camel-rabbitmq\src\main\java\org\apache\camel\component\rabbitmq\RabbitMQConsumer.java
 and don't see the code you posted in the comment... not sure if we're talking 
about the same code...

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