Skip to content

Handling messages with empty string as session id inconsistency #31704

Open

Description

  • Package Name: azure/service-bus
  • Package Version: 7.9.4
  • Operating system: windows
  • nodejs
    • version: v20.11.0
  • browser
    • name/version:
  • [x ] typescript
    • version: 5.6.3
  • Is the bug related to documentation in

Describe the bug
Currently there are inconsistencies in behaviors when sending a message with empty string as session id. While when using null as session id the behavior looks right for all.

Logically we expect if the subscription has session enabled, that sending a message with null session id or empty string should have same behavior, and that is for message to go to the DLQ. But that is not what is happening.

The C# library seem to have the correct behavior. As it treats both null and empty string as same on send. At same time if there was already messages with empty string in the active queue, it will allow the client app to process them.

To Reproduce
Steps to reproduce the behavior:

  • Create a topic, and subscription with sessions enabled

  • Send message with empty string as session id using js library (Result: message goes to the active queue)

  • Send message with empty string as session id using Rest API (Result: message goes to the active queue)

  • Send message with empty string as session id using C# library (Result: message goes to the DLQ)

  • Try reading the message from the subscription using JS library by passing empty string as session id sbClient.acceptSession(queueName,"sub3" , ""). (Result: The app will NOT be able to read the message.)

  • Try reading the message from the subscription using C# library by passing empty string as session id sbClient.acceptSession(queueName,"sub3" , ""). (Result: The code will SUCCESSFULLY read the message.)

Expected behavior
Expect the JS library to be consistent with C# behavior on send and receive of messages with empty string as session id. That is:

  • On send message with empty string session id or with null to a session enabled subscription, then the message should go to DLQ
  • If there was a message with empty string as session id in the active queue in the subscription, then the client should be able to process it using acceptSession or acceptNextSession

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
This is related to a customer support case. Please contact me over Teams for any details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.Service Buscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions