Skip to content

Commit

Permalink
Debug breaking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cressie176 committed May 27, 2024
1 parent 11e751d commit c439164
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/amqp/SubscriberError.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const setTimeoutUnref = require('../utils/setTimeoutUnref');

module.exports = function SubscriptionRecovery(broker, vhost) {
this.handle = function (session, message, err, recoveryOptions, next) {
debug('Handling subscriber error for message: %s', message.properties.messageId);
debug('Handling subscriber error for message: %s with error: %s', message.properties.messageId, err.message);

async.eachSeries(
[].concat(recoveryOptions || []).concat({ strategy: 'fallback-nack' }),
Expand Down Expand Up @@ -86,7 +86,7 @@ module.exports = function SubscriptionRecovery(broker, vhost) {

if (strategyConfig.immediateNack) {
const xDeathRecords = message.properties.headers['x-death'] || [];
const xDeath = xDeathRecords.find(({ queue, reason }) => queue === originalQueue && reason === 'rejected') || { count: 0 };
const xDeath = xDeathRecords.find(({ queue, reason }) => queue === originalQueue && reason === 'rejected') || { count: 0, queue: originalQueue };
_.set(publishOptions, ['headers', 'rascal', 'recovery', originalQueue], { immediateNack: true, xDeath });
}

Expand Down
2 changes: 1 addition & 1 deletion test/subscriptions.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ describe('Subscriptions', () => {
count++;
if (count <= 2) {
assert.ok(message);
ackOrNack(new Error('immediate nack'), {
ackOrNack(new Error(`immediate nack: ${count}`), {
strategy: 'republish',
immediateNack: true,
});
Expand Down

0 comments on commit c439164

Please sign in to comment.