Azure WebJob Queues are not triggering WebJobs If I pass message in binary format to Queues?
I have Pushed GOOGLE PROTOBUF Bytes as CloudMessage into the Azure Queue Storage. But, Azure Queue storage is not pinging and Passing that CloudMessage to my Azure Continuous running WebJob instead of that, those Messages are moving to the Poison Queues?
Following Code is my WebJob for pooling the Queue Message.
Program file:
public class Program
{
// Please set the following connection strings in app.config for this WebJob to run:
// AzureWebJobsDashboard and AzureWebJobsStorage
public static void Main()
{
try
{
JobHost host = new JobHost();
//Following code ensures that the WebJob will be running continuously
host.RunAndBlock();
}
catch (Exception ex)
{
throw ex;
}
}
}
Function.cs
public class Function
{
//This function will get triggered/Executed when new message is written on an Azure Queue called messagequeue
public static void ProcessMessageQueue([QueueTrigger("messagequeue")] string message)
{
#region WebAPI Call
#endregion
}
}
Code for Adding Message Bytes into Azure Queue:
private void PushPayloadBytesToAzureQueueStorage(byte[] payload)
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["AzureWebJobsStorage"]);
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
CloudQueue queue = queueClient.GetQueueReference("messagequeue");
queue.CreateIfNotExists();
CloudQueueMessage msg = new CloudQueueMessage(payload);
queue.AddMessage(msg);
}
My case is, I will add the message as Bytes in the Queue then That Queue Storage have to send a message and trigger my Web job which is published/running in the Azure Cloud.
I have a doubt about the below Method Signature.
public static void ProcessMessageQueue([QueueTrigger("messagequeue")] string message)
What datatype should I use for the message parameter in the above method signature since Messages are added into the Queue Storage Successfully but Queue does not trigger Azure function and all the Queue Messages are moved to Poison Queue.
What am I missing here?
Appreciate your thoughts on this.
Thanks in Advance!