Open kevinohara80 opened 11 years ago
+1
Try to amend the 'amqp' dependency in package.json with "https://codeload.github.com/postwait/node-amqp/tar.gz/master".
+1
I've just run into this, looks like there's an issue in the code to do with comparison of 64bit integers.
This seems to be "fixed" in master by casting the value down to a 32 bit for comparison - I guess as long as you don't try to confirm more than MAXINT messages this will work.
Any idea when there might be another release to npm, anything I can do to help?
can you add confirm : true option? var opts = { mandatory: true, confirm : ture };
Hi, any help with this? I'm using already declared exchange - CB function is never called but data is received in exchange.
var exchangeConn = amqp.createConnection( { url: connString } );
exchangeConn.on( 'ready', function() {
exchangeConn.exchange( 'MyExchange', { noDeclare: true, confirm: true }, function( exchange ) {
exchange.publish( '', 'Some data', { mandatory: true }, function( error ) {
// never in, but data got in exchange
});
});
});
I can confirm that the confirm: true option does not help. The confirm callback on exchange.publish is never called.
Can you confirm what client & server versions you are seeing this behaviour on?
In my case
amqp 0.9.1 RabbitMQ 3.0.4 node-amqp 0.2.0
In the rabbit management interface client you can check the the channel you're publishing with is in confirm mode. If its not thats You can also try https://github.com/dropbox/amqp-coffee if you're writing a new app it may be easier, if not the api changes may make it tough.
Where would that be indicated in the interface exactly?
localhost:15672/#/channels there should be a "c" int he Mode column. That indicates that publish confirms are enabled on that channel.
Thanks for that tip. As for amqp-coffee, that looks interesting. I don't know much coffee, does it require me to be using coffee? And can I use multiple callbacks for parallelll queue bindings? If so, I might just switch :-)
You don't have to be using coffee script, to run amqp-coffee. You can use multiple in parallel, for different publishes. But that should also work for node-amqp.
As per #298, queue.bind will overwrite the callback for each call. So any bind operations going on at the same time, only the last callback passed in will be called, rather than each individual callback being called its bind completes.
Back on-topic. Using:
{
noDeclare: true,
confirm: true
},
Does not seem to put channel in confirm mode:
The mode column is the third column
The code at https://github.com/postwait/node-amqp/blob/master/lib/exchange.js certainly looks like it should respect the confirm option, however it appears that when used with noDeclare that code path isn't hit.
@glenjamin - Versions: node-amqp 0.2.1 (also tried pulling master from git - doesn't work) RabbitMQ 3.2.4
@davidmba - channel doesn't show "c" option in mode column like @testower says
https://github.com/postwait/node-amqp/blob/master/lib/exchange.js#L91 only happens after exchangeDeclareOk which doesn't happen with no-declare. This is for sure a bug. You can just not use no-declare. You should be able to redeclare a exchange with no problem. Ill plug https://github.com/dropbox/amqp-coffee again, with it you don't publish on a exchange. You publish on the connection which solves the whole no-declare thing.
So an "ugly" fix like https://github.com/postwait/node-amqp/pull/328 works for me
+1
@jensbjork pull the latest version from github, npm installation doesn't shift changes from #328
I've specified the git repo through npm as well but the problem still remains. What was the conclusion around this issue if not only to update to the latest repo?
All I really want to do is to close the connection when publishing to a queue. Simply calling connection.disconnect() outside a callback does not seem to terminate the connection, it is still visible as a running connection in rabbitmq.
var raw_text = req.param('text');
var from_identifier = req.param('msisdn');
var timestamp = req.param('message-timestamp');
if (raw_text && from_identifier && timestamp) {
app.conn = amqp.createConnection({
host: 'localhost',
login: '{{ rabbitmq_username }}',
password: '{{ rabbitmq_password }}',
connectionTimeout: 30000
});
app.conn.on('ready', function() {
console.log("Connected to RabbitMQ");
app.e = app.conn.exchange('amq.fanout', { confirm: true });
app.q = app.conn.queue('events');
app.e.publish('', { raw_text: raw_text, from_identifier: from_identifier, timestamp: timestamp }, {}, function(status) {
console.log("Sent message and disconnecting");
app.conn.disconnect();
});
});
}
Are there any alternative methods that can be used in order to achieve this? All input is highly appriciated!
This appears to work for me.
rabbit: 3.2.4
node-amqp: both 2.0
and master
node: v0.10.31
I can run sudo rabbitmqctl list_channels name confirm
and I see that my channels are in confirm mode.
+1
Having the same problem on.
RabbitMQ: 3.5.1 node-amqp: 0.2.4 nodejs: v0.10.36
I am not using noDeclare option, so I am not sure how to go around this problem..
conn.exchange('topic-test', {type: 'topic', confirm: true}, function(ex) {...}
I have an API process that I am attempting to do the following:
Everything works for me except the publisher confirm. The publish succeeds, I see it hit the queue, and a worker picks it up. My API process never gets a publisher confirm despite setting
confirm:true
.I've tried setting it up using both the callback method and the EventEmitter method. The callback never fires and I am never able to receive an ack event message from the publish.
I've looked at the examples in the tests and I am setting them up in the same way. Is there a bug here or am I missing something? I'm using amqp version 0.1.7.
Here is my code using the EE method:
And here it is using the callback method: