English 中文(简体)
如何在请求发出后保持僵局。 j 紧?吗?
原标题:How to keep a queue active after a request is made in node.js amqp?

Do I really need to instantiate the queue "queue = connection.queue(...)" every time I want to use it?

服务器(node.js):

 queue = connection.queue( incoming , { // <--- DO I REALLY NEED THAT FOR EVERY REQUEST?
        durable : true,
        exclusive : false }, function() {});

 queue.subscribe(function(msg) {
      // Unsubcribe here. Maybe there is something like a once listener?
     console.log("RECEIVED: "+msg)
      //res.send(msg.data);
      queue.unsubscribe(ctag);
     res.redirect( /home );

   }).addCallback(function(ok) { ctag = ok.consumerTag; });

   exchange.publish( msg_queue ,  functional! , {  // request
      replyTo:  incoming 
   }); 

如果queue = 链接.queue(......);与服务器一起即时发出,使用查询组的第一个请求是成功的,但以下请求却有误:

Error: NOT_FOUND - no queue  incoming  in vhost  / 
at Queue._onMethod (/Users/cassiomelo/code/cubix/cubix_nodejs/node_modules/amqp/amqp.js:1720:15)
最佳回答

缩略语 • 如何在Rabbit.js上建立REP/REQ

问题回答

暂无回答




相关问题
what the default max length of rabbit queue

For any given queue, the maximum length (of either type) can be defined using a policy (this option is highly recommended) or by clients using the queue s optional arguments. In the case where both ...

Retrieve messages from RabbitMQ queue(s)

I m looking to implement RabbitMQ into my PHP application, and am using the php-amqp extension. My only question is this, how do I easily query to return the contents of the queue in PHP? php-amqp ...

How to use listen on basic.return in python client of AMQP

I d like to make sure that my message was delivered to a queue. To do so I m adding the mandatory param to the basic_publish. What else should I do to receive the basic.return message if my message ...

Is AMQP production ready?

I d like to use AMQP to join two services one written in C# and other written in python. I m expecting quite large volume of messages per second. Is there any AMQP Broker that is production ready? ...

Multiple consumer one queue

Is it possible to make multiple consumers to share one single queue in RabbitMQ? I am currently using this php library to work with RabbitMQ, from what I observe, although I have 2 identical instances ...

Why use AMQP/ZeroMQ/RabbitMQ

as opposed to writing your own library. We re working on a project here that will be a self-dividing server pool, if one section grows too heavy, the manager would divide it and put it on another ...

How to wait for messages on multiple queues using py-amqplib

I m using py-amqplib to access RabbitMQ in Python. The application receives requests to listen on certain MQ topics from time to time. The first time it receives such a request it creates an AMQP ...

热门标签