Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to retrieve dead letter messages for a specific sessionId in Azure Service Bus #2721

Open
JosefBackovsky opened this issue Sep 19, 2024 · 0 comments
Labels
Needs: Triage (Functions) potential-bug Items opened using the bug report template, not yet triaged and confirmed as a bug

Comments

@JosefBackovsky
Copy link

JosefBackovsky commented Sep 19, 2024

Description

When trying to process and permanently delete dead letter messages for a specific sessionId, there is no way to create a ServiceBusSessionReceiver that can target the dead letter queue.

Current working approach without sessions:
1. Create a receiver with SubQueue.DeadLetter.
2. Retrieve messages via ReceiveMessagesAsync.
3. Remove messages using CompleteMessageAsync.

However, when using sessions:
• AcceptSessionAsync is required to target specific sessions.
• But, ServiceBusSessionReceiver lacks a SubQueue option, making it impossible to filter for dead letter messages in a specific session.

A standard receiver retrieves all dead letter messages without session filtering.

How to retrieve dead letter messages for a specific sessionId?

Tested on Azure.Messaging.ServiceBus version 7.18.1

THX

Steps to reproduce

  1. Setup Azure Service Bus with Sessions and Dead Letter Queue:

    • Create a Service Bus queue with session support enabled.
    • Ensure there are messages in the Dead Letter queue for multiple specific sessionId.
  2. Try to retrieve dead letter messages for one specific session:

    • Use ServiceBusClient.AcceptSessionAsync(queueName, sessionId) to create a session receiver.
    • Notice that there is no option to specify the Dead Letter subqueue for session-based receivers.
   var sessionReceiver = await serviceBusClient.AcceptSessionAsync(queueName, sessionId,
       cancellationToken: cancellationToken);
  1. Attempt to retrieve messages from the Dead Letter queue:
    • With the session receiver, attempt to access the Dead Letter queue messages. There is no direct way to target the Dead Letter subqueue while using the session receiver.
  2. Expected Behavior:
    • You should be able to retrieve only the dead letter messages for the specified sessionId from the Dead Letter queue.
  3. Actual Behavior:
    • There is no way to configure the sessionReceiver to filter for messages in the Dead Letter queue.
    • A standard receiver that targets the Dead Letter queue retrieves all messages, but it cannot filter by sessionId.
@JosefBackovsky JosefBackovsky added the potential-bug Items opened using the bug report template, not yet triaged and confirmed as a bug label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage (Functions) potential-bug Items opened using the bug report template, not yet triaged and confirmed as a bug
Projects
None yet
Development

No branches or pull requests

1 participant