Interoperability Azure Service Bus Message Queue Messages

前端 未结 3 2008
星月不相逢
星月不相逢 2020-12-10 21:53

I have a Java App and a NodeJS App both using a single Azure Service Bus Message Queue.

I witness some strange effects with my clients, as follow.

JAVA MESSA

3条回答
  •  再見小時候
    2020-12-10 22:57

    I had the same issue with the message body being prefixed by this "@\u0006string\b3http://schemas.microsoft.com/2003/10/Serialization/\u0001".

    I was using Nodejs, with the azure-iot-device-mqtt and azure-iot-device packages, to send messages to IoT hub. I was using a Stream Analytics Job to receive the messages from IoT hub and publish them to a queue. I was using Nodejs, with the amqp10 package, to receive the events from the queue.

    The problem was not caused by the way I was sending or receiving the messages. Rather, the problem was with the Stream Analytics compatibility level! Compatibility level 1.0 (the default at least when I deployed) uses the DataContractSerializer which serializes the message into an XML stream! Microsoft changed (fixed) this with compatibility level 1.1. So you may just need to change the compatibility level (CONFIGURE->Compatibility level) for your Stream Analytics job to 1.1.

    See: https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-compatibility-level#major-changes-in-the-latest-compatibility-level-11:

提交回复
热议问题