Skip to content

Commit

Permalink
Adding a default messageId to each published message.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnachlinger committed Oct 13, 2014
1 parent 0cd5748 commit 52695f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions index.js
@@ -1,4 +1,4 @@
"use strict";
"use strict";
var amqp = require('amqp');

var util = require('util');
Expand Down Expand Up @@ -43,7 +43,11 @@ function connected(conn, name, callback) {
conn.exchange(name + 'Xch', {type: 'fanout', durable: true, autoDelete: false}, function (exchange) {

function publish(message) {
exchange.publish("msg", message, {mandatory: true, deliveryMode: 2});
exchange.publish("msg", message, {
mandatory: true,
deliveryMode: 2,
messageId: process.pid + "-" + Date.now()
});
}

function subscribeToWorkQueue(cb, fetchCount) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name":"amqputil",
"version":"0.0.22",
"version":"0.0.23",
"description":"A thin wrapper around the amqp node module",
"main":"index.js",
"dependencies":{
Expand Down

0 comments on commit 52695f9

Please sign in to comment.