简体   繁体   中英

How to use RabbitMq Direct reply-to queue extension

I created one Client and a Server. How can I use RabbitMq Direct reply-to queue extension?

client code

AMQPExchange * ex = amqp.createExchange("");
AMQPQueue * ReplyToQueue = amqp.createQueue("amq.rabbitmq.reply-to");  
ReplyToQueue->Consume(AMQP_NOACK);

In the above code, Consume gives the following exception

server error 404, message 'NOT_FOUND - no queue 'amq.rabbitmq.reply-to' in vhost '/'' class=60 method=20 

I follow Direct reply-to rabbitmq

I'd say you are missing to call

ReplyToQueue.Declare()

That declare a queue

Edit

I add the oldsound comments, since my answer it is not property correct:

You can't name queues with the amq. prefix, but the reply to is an exception to the rule, see: rabbitmq.com/direct-reply-to.html and https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_channel.erl#L1264

"There is no need to declare this "queue" first, although the client can do so if it wants." That's form the reply-to queue docs –

As per the comments, the error message NOT_FOUND - no queue 'amq.rabbitmq.reply-to' in vhost '/' most likely means that the RabbitMQ instance you're connecting to is too old to support the "direct reply-to" extension . It was introduced in RabbitMQ 3.4.0; see the release notes .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM