Handling messages with empty string as session id inconsistency #31704
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Service Bus
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:
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.
The text was updated successfully, but these errors were encountered: