[nodejs] Re: How to keep a queue active after a request is made in node.js amqp?

2012-05-19 Thread Cassio Melo
Hi Graeme, indeed it's a RPC call to a program in Python. Dan, here is the relevant code; User makes a HTTP request to /test and the program sends a message to a python and returns the result to the user. How do you think it would be the best implementation for this? var connection = amqp.create

[nodejs] Re: How to keep a queue active after a request is made in node.js amqp?

2012-05-17 Thread Graeme Foster
This seems a slightly odd way to use a queue - normally you would get the queue from the connection and subscribe once, then you get notified of each message as it is taken off the queue. Are you using it for RPC or something? Maybe if you could explain how you want to use the queue we could c

Re: [nodejs] Re: How to keep a queue active after a request is made in node.js amqp?

2012-05-17 Thread Dan Milon
Oh ok, i get it now. Well, i cannot guarantee about the publish method (but i find it highly unlikely that it needs to reinstantiate the queue). But on my app, i subscribe to a queue, and it works as expected (fires callback when a message is delivered). Could you write a gist to test it? On

[nodejs] Re: How to keep a queue active after a request is made in node.js amqp?

2012-05-17 Thread Cassio Melo
Hi Dan, by "request" I mean "exchange", sorry. I know the queue has to be configured each time. Let me rephrase the problem. In the exchange above, the result is redirected to the queue "incoming", which just prints out the message. If I publish in the exchange for the second time, i.e, "exchange