You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jason Foster (JIRA)" <ji...@apache.org> on 2013/12/02 22:00:35 UTC

[jira] [Commented] (CAMEL-7009) RabbitMQ Consumer does not pick up REPLY_TO

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

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

I looked at  and re-tested with 2.12.2 I can now see that the REPLY_TO header (and others) do get correctly set on the consumer, so must have been code in the trunk you were looking at.

> 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)