Skip to content

Commit

Permalink
Make message timestamp optional
Browse files Browse the repository at this point in the history
  • Loading branch information
birkholz authored May 12, 2017
1 parent a5ccc4d commit 9012c7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/amqp/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function publish( channel, options, topology, log, serializers, message ) {
correlationId: message.correlationId || "",
replyTo: message.replyTo || topology.replyQueue.name || "",
messageId: message.messageId || message.id || "",
timestamp: message.timestamp || Date.now(),
appId: message.appId || info.id,
headers: message.headers || {},
expiration: message.expiresAfter || undefined,
Expand All @@ -93,6 +92,9 @@ function publish( channel, options, topology, log, serializers, message ) {
if ( options.persistent || message.persistent ) {
publishOptions.persistent = true;
}
if (message.timestamp) {
publishOptions.timestamp = message.timestamp;
}

var effectiveKey = message.routingKey === '' ? '' : message.routingKey || publishOptions.type;
exLog.debug( "Publishing message ( type: '%s' topic: '%s', sequence: '%s', correlation: '%s', replyTo: '%s' ) to %s exchange '%s' on connection '%s'",
Expand Down

0 comments on commit 9012c7f

Please sign in to comment.