azureservicebusservicebusbrokeredmessage

Compatibility between Azure Message and BrokeredMessage


We have two projects. One with .NET FrameWork and one with .NET Core. For .NET Core, we have to use the Azure ServiceBus, and for .NET Framework, we have to use the old ServiceBus as we are still working with 5.4. The .NET Framework receives a BrokeredMessage, and .NET Core sends an Azure Message. How can I make this compatible? Do I have to write my own serializer?


Solution

  • The .NET Framework receives a BrokeredMessage, and .NET Core sends an Azure Message. How can I make this compatible? Do I have to write my own serializer?

    This topic has been covered a few times. In your case, if it's truly uni-directional the way you describe it, to process messages of type Message sent from the Standard Service Bus library, you will need to receive those message using the old client and process as a Stream. The stream will provide you with the bytes, which you'll be able to deserialize utilizing the same method used to serialize the content. More on this topic in the (now decommissioned) Service Bus client issue here.

    In case you cannot modify how BrokeredMessages are handled, this Stack Overflow question has an answer to handle interop the other way around.