Handling service bus deadletter queue

Yang Chowmun 411 Reputation points

I am trying to read from dead letter queue and pass the msg back into original queue.

I am using the code in this link to do it except that I did not include the 'subject'

I have also tried to use the codes below to do the same.

dlq_receiver = servicebus_client.get_queue_receiver(queue_name=Queue_name, sub_queue=ServiceBusSubQueue.DEAD_LETTER)
msgs_to_send = []
with dlq_receiver:
    received_dlq_msgs = dlq_receiver.receive_messages(max_message_count=1, max_wait_time=1)
    for msg in received_dlq_msgs:

with ServiceBusClient.from_connection_string(connectionString) as client:
    with client.get_queue_sender(Queue_name) as sender:

Both of the codes can read and send dead letter message back to the original queue but the sent message was not able to be consumed by trigger function. After restarting the function, the problem is solved.

Is there any steps missing which lead to this error?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
572 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,512 questions
{count} votes