fh-amqp-js
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -86,2 +86,22 @@ var amqp = require('amqp'); | ||
// Publish task to a queue | ||
this.publishTask = function(exchangeName, qName, message, callback){ | ||
var self = this; | ||
exchange(exchangeName, function(err, exchange){ | ||
if(err) return callback(err); | ||
// TODO - opts can obviously be passed in in future.. important here tho that the deliveryMode is persistent(2) | ||
var opts = { | ||
contentType: 'application/json', | ||
deliveryMode: 2 | ||
}; | ||
exchange.publish(qName, message, opts, function(ack){ | ||
// Note: oddly, ack will be false if the message succeeds | ||
if (ack !== false) return callback("Error publishing task to queue, ack: " + ack); | ||
return callback(); | ||
}); | ||
}); | ||
}; | ||
// Subscribe to messages on a topic | ||
@@ -88,0 +108,0 @@ // 'subscribeFunc' is the function that gets called each time a message happens |
{ | ||
"name": "fh-amqp-js", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "FeedHenry AMQP Client", | ||
@@ -5,0 +5,0 @@ "main": "./lib/amqpjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24612
486