I have a service bus message that gets transferred to deadletter queue without triggering the function.

Stefan Vesely 0 Reputation points
2024-12-10T14:55:57.76+00:00

Hello Community,
I have a service bus that is related to a queue
every second message the service bus is sending the message to dead letter queue and the function that is supposed to be consuming the message is not even triggering.

so The queue is set to lock a message for 10 minutes once it is delivered once
there is also 10 retry attempts
the function does not trigger as there is logging where "stated" is logged even before it does anything.

When we had the retry steps to 1 it would fail every second message, now it fails every 5 messages.

I have reviewed the logs and everything but I have yet to find any reason why it is doing this, it just states that retry limit is succeeded, why would this be if the function consuming the message doesnt even receive anything?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
657 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Vahid Ghafarpour 22,300 Reputation points
    2024-12-25T19:31:10.92+00:00

    Since the messages are being moved to the DLQ, it's important to check the DLQ for any error messages or reasons why the messages are being dead-lettered. This can give us clues about what's going wrong. You can also check function logs for more information

    https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues


  2. Stefan Vesely 0 Reputation points
    2024-12-30T07:34:56.69+00:00

    Sorry I maybe didn't specify when I said I reviewed the logs and everything -> This includes the dead letter queue, all it said was "retry limit is exceeded" even though the function had not received the message.

    I figured out the issue, and maybe this is something that can be added into your "troubleshooting"
    For some reason someone in our team loaded my functions into his publish there were 2 functions consuming the message.


  3. Shireesha Eeraboina (Quadrant Resource LLC) 660 Reputation points Microsoft Vendor
    2024-12-30T09:19:22.4833333+00:00

    @Stefan Vesely Thanks for posting your question in Microsoft Q&A, apologize for any inconvenience caused on this.

    As you mentioned, having multiple functions consuming the same message can cause conflicts. Ensure that only one function is configured to consume messages from the queue. This can prevent messages from being dead-lettered due to retry limits being exceeded and verify that the function is correctly configured to trigger on messages from the Service Bus queue. Ensure that the connection string and queue name are correctly specified in the function's configuration.

    • Check the DLQ for any error messages or reasons why the messages are being dead-lettered. This can provide clues about what might be going wrong. The error message "retry limit is exceeded" indicates that the message was not processed successfully within the allowed retry attempts also ensure that your function has adequate logging to capture any errors or issues that occur during message processing. This can help identify why the function is not triggering or processing messages as expected.
    • Also review the retry policy settings for your Service Bus queue. If the retry attempts are set too low, messages may be dead lettered before the function has a chance to process them. Adjust the retry attempts and lock duration as needed.

    If you have any concerns, feel free to reach out to us.

    Thankyou.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.