My client .NET Core application uses AMQP.Net Lite library to work with Azure Service Bus. When the topic in the service bus namespace is NOT partitioned (Enable Partitioning
is turned OFF), everything works fine - I'm able to connect and create ReceiverLink
object to receive messages.
However, as soon as the topic is partitioned (Enable Partitioning
is turned ON), I get the following error immediately after ReceiverLink
object creation.
The error description is: "Cannot open a Topic client for entity type Subscriber."
The error code translates to the AMQP map as amqp:not-allowed
. According to the docs, it means "The peer tried to use a frame in a manner that is inconsistent with the semantics defined in the specification." To be honest, I can hardly understand what it means in terms of Azure Service Bus abstractions, but it sounds depressing and similar to "not possible" to me...
On the other hand, the MS docs state that AMQP can be used to send and receive messages:
AMQP is now supported for sending and receiving messages to and from a partitioned entity.
So, the question is whether it is at all possible to use AMQP.NET Lite library to receive messages from a partitioned topic in Azure Service Bus?
Apparently, it turns out to be a bug in Azure Service Bus. There's a workaround, however.
Instead of creating the
ReceiverLink
like this:Create it like this:
NOTE: the second parameter can be any string.
See this Github thread for details.