Loading...

[Azure Service Bus] JMS messages getting dead-lettered

[Azure Service Bus] JMS messages getting dead-lettered

The article discusses a problem where numerous messages end up in the dead letter queue (DLQ) when the JMS service bus consumer connects to the Azure Service Bus using Qpid jars. The reason for the messages being dead-lettered is that they have reached the maximum delivery count.

 

The fundamental issue stems from Apache Qpid's message handling. Qpid utilizes a local buffer to prefetch messages from the Azure Service Bus, storing them prior to delivery to the consumer. The complication occurs when Qpid prefetches an excessive number of messages that the consumer is unable to process within the lock duration. Consequently, the consumer is unable to acknowledge or finalize the processing of these messages before the lock expires, leading to an accumulation of messages in the Dead Letter Queue (DLQ).

 

To address this problem, it is crucial to either turn off Qpid's local buffer or modify the prefetch count. Disabling prefetching is achievable by setting jms.prefetchPolicy.all=0 in the JMS URL. This configuration allows the JMS client to directly consume messages from the Azure Service Bus, circumventing Qpid's local buffer. Consequently, the consumer can process messages at a suitable pace, guaranteeing smooth processing and issue-free completion.

 

Why is Prefetch not the default option in Microsoft .NET/Java/Python libs?

 

 

Published on:

Learn more
Azure PaaS Blog articles
Azure PaaS Blog articles

Azure PaaS Blog articles

Share post:

Related posts

Moving to TLS 1.2 for Azure Cosmos DB: Ensuring Secure Connections

Security and reliability are at the core of modern cloud applications. To strengthen data protection and align with industry best practices, w...

1 day ago

GitHub Copilot for Azure DevOps users

Azure DevOps customers frequently ask us when GitHub Copilot will be available to them. What many don’t realize is that GitHub Copilot for Bus...

2 days ago

Rust in time! Announcing the Azure SDK for Rust Beta. 🎉

Announcing the first beta release of the Azure SDK for Rust. This release includes libraries for Identity, Key Vault secrets & keys, Event...

2 days ago

Go passwordless when calling Azure OpenAI from Azure SQL using Managed Identities

Security is a significant topic today, and the ability to access a service requiring authentication without using an API key, password, or sec...

3 days ago

Spring Cloud Azure updates and troubleshooting tips for Java on AKS

This post shows the latest Spring Cloud Azure updates. The post Spring Cloud Azure updates and troubleshooting tips for Java on AKS appeared f...

4 days ago

Episode 395 – Getting Started with VDI in Azure with Azure Virtual Desktop

Welcome to Episode 395 of the Microsoft Cloud IT Pro Podcast. In this episode, we dive into Azure Virtual Desktop (AVD) and how it enables org...

8 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy