I'm using Azure functions to send and receive messages from service bus. I want to send and receive correlationId in service bus message header to track message lifecycle.
I'm sending first JSON payload from ServiceBusExplore, and getting text If using string insted of BrokeredMessage
Receiver Code
public static async Task RunAsync([ServiceBusTrigger("validate-trade", AccessRights.Manage,
Connection = "ServiceBusConnection")]BrokeredMessage message,
TraceWriter log)
{
string queueData = message.GetBody<string>();
}
getting below error
'message.GetBody<string>()' threw an exception of type 'System.Runtime.Serialization.SerializationException' string {System.Runtime.Serialization.SerializationException}
I tried this as well
string s = receiveMessage.GetBody<string>(new DataContractSerializer(typeof(string)))