Encoding warnings when sending data to QueueTrigger

177 views Asked by At

I just updated Azure.Storage.Queues to the latest version, the old version I was running used the CloudQueue object, and the AddMessageAsync method to put a message on the queue. In the new version you need to use the QueueClient and SendMessageAsync method.

I send this message from an IoTHub, when the message arrives at the iothub it is protobuf byte array. Before the update I could just pass on the byte array to the queue. but now the new method takes either string or BinaryData.

I now pass on BinaryData that is encoded with base64, which I set in the QueueClient options (see pic). QueueOptions

But when i receive the message in my QueueTrigger i get these warnings (see pic) warnings

Anyone know why I'm getting these warnings? the data is arriving as it should so no problem, just curious why these warnings are coming.

Edit, More info how i send from IoTHub and how i receiving in the QueueTrigger:

Sending from IoTHub (message.EventBody is BinaryData type): enter image description here

QueueTrigger: enter image description here

1

There are 1 answers

5
Rajesh  Mopati On

1. Create a storage account in azure

enter image description here

2. And in storage account create a queue

enter image description here

Install the nuGet Azure.Storage.Queues

enter image description here

Used the namespace Azure.Storage.Queues and have used the same code

enter image description here

client = new QueueClient(QueueAccessKey, "msgqueue",
                new QueueClientOptions
                { 
                    MessageEncoding=QueueMessageEncoding.Base64
                });

                Console.WriteLine("Message sending to queue...");
                await client.SendMessageAsync(msg);

enter image description here

Message from the Azure Queue

enter image description here

worked in both console application and azure functions and able to send messages without any issues.

enter image description here

enter image description here