Azure / azure-service-bus

☁️ Azure Service Bus service issue tracking and samples
https://azure.microsoft.com/services/service-bus
MIT License
580 stars 775 forks source link

Auto-forwarding with session enabled queues and forwarding ordering #660

Closed sergevm closed 1 year ago

sergevm commented 1 year ago

Hi,

It does not seem possible to enable auto-forwarding a session-enabled queue to another session-enabled queue. We receive a rather vague exception "Sub code=40000. Bad request. To know more visit https://aka.ms/sbResourceMgrExceptions", which is referred to in https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-resource-manager-exceptions#error-bad-request. Is this by design, what is the reasoning behind this?

Couldn't find this documented. Can you confirm that this is not allowed?

Another question that popped up, is whether auto-forwarding is guaranteed to keep the order messages come in on the queue that is forwarding?

Posted this question at https://stackoverflow.com/questions/75996148/azure-service-bus-auto-forwarding-session-enabled-queue-to-another-session-ena?noredirect=1#comment134044447_75996148 where it was suggested to repeat the question here.

EldertGrootenboer commented 1 year ago

This is not possible indeed. I have opened an investigation task to get the exact details, and we will update the documentation accordingly. As for your second question, ordering is not guaranteed when using forwarding, we will also update the documentation with this.

yvgopal commented 1 year ago

Yes. It is not allowed. Sessions are used only to receive messages belonging a particular session in order, by a single receiver. If an entity is auto forwarding to another entity, why should the source entity be session enabled? It is enough if the destination entity alone is session-enabled.

Only way a session enabled source entity (only queue) helps in this case by rejecting messages without a sessionid property. If the source entity is a topic/subscription, that won't even reject incoming messages without a sessionid property.

We don't support because there is no good use case for it.

Source queue tries to forward messages in the same order it got. But destination could be a topic which may not respect ordering. If either the source or destination entity is a partitioned entity, order is not guaranteed.

sergevm commented 1 year ago

Thanks!