0
votes

I have a javascript Azure function that puts a message on a Service Bus queue:

module.exports = function (context, req) {
  var flatten = require('flat')

  var message = flatten(req.body);
  context.bindings.outputSbMsg = message;
  context.done();
};

When it runs via a Http trigger, the function completes successfully. However, the message ends up on the Dead Letter queue in Service Bus. I can't see any error in the logs. Where should I look to investigate what the cause of this is?

1
Can you check the DeadLetterReason and DeadLetterErrorDescription properties on messages in the dead letter queue? Find common reasons messages are moved to the dead letter queue at docs.microsoft.com/en-us/azure/service-bus-messaging/…Evandro Paula
That probably means there is somebody who processes those messages, and it crashes while doing soMikhail Shilkov
How do I examine the dead letter queue? I can't see it in the portal, or in Service Bus Explorer.Aidan

1 Answers

0
votes

Messages have a deliveryCount property on them, maxDeliveryCount is settable on a queue when the queue is created or being updated.

A message in the queue can only be received as many times as the maxDeliveryCount, i.e., once the delivery-count reaches the max-delivery-count, the message can't be received using a receiver for a queue since it will be moved to the deadletter queue.

If you want to receive the message after it is moved to the deadletter queue, you need to create a receiver for the deadletter queue.

Refer to this sample processMessageFromDLQ.js which does the same with version 7.0.0 @azure/service-bus.

Moreover, you can also explicitly send messages to deadletter queue by specifying the reason, refer to the sample movingMessagesToDLQ.js

Version 7.0.0 has been recently published. Refer to the links below.