We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
when I tried prepare simple publish procedure, callback after publishing message is never executed.
var amqp = require('amqp')
var connection = amqp.createConnection({ host: 'localhost', port: 5672 })
// add this for better debuging connection.on('error', function(e) { console.log("Error from amqp: ", e) })
// Wait for connection to become established. connection.on('ready', function () { console.log('Connected.') connection.publish('my-queue', '', {}, _ => { console.log('Not executed') connection.end() }) })
The text was updated successfully, but these errors were encountered:
callback is a function that will get called if the exchange is in confirm mode
You're forced to setup an exchange with the option {confirm: true} to use the callback:
{confirm: true}
connection.on('ready', function () { console.log('Connected.') connection.exchange('', {confirm: true}, function(exchange) { exchange.publish('my-queue', '', {}, _ => { console.log('Executed') connection.end() }); }); });
Sorry, something went wrong.
No branches or pull requests
Hello,
when I tried prepare simple publish procedure, callback after publishing message is never executed.
var amqp = require('amqp')
var connection = amqp.createConnection({ host: 'localhost', port: 5672 })
// add this for better debuging
connection.on('error', function(e) {
console.log("Error from amqp: ", e)
})
// Wait for connection to become established.
connection.on('ready', function () {
console.log('Connected.')
connection.publish('my-queue', '', {}, _ => {
console.log('Not executed')
connection.end()
})
})
The text was updated successfully, but these errors were encountered: