Open mlakshminara opened 3 years ago
I used Apache Qpid libraries to publish messages to Queue using AMQPS protocol. I wanted to know whether publishing text message (Json text) to queue using AMQPS does it provide a null data in Azure Function trigger.
If I publish it as Bytes Message (same Json text as bytes) then am able to get the data in Azure Function properly. Is this a constraint while using AMQPS protocol
I can confirm from personal experience: I was publishing a string containing xml by using spring jms template, that leads to a message with extra prefix chars being stored in the queue. When the function get triggered the message in this case is always null. For the publishing I switched to com.azure:azure-messaging-servicebus; when the message is correct the trigger works.
When I deploy an Azure Function locally using Spring Boot and spring-cloud-function-adapter-azure library. I was able to build, package and deploy the Function Application locally. I have installed: 1) Azure CLI version 2.16 2) Azure Function CLI (func) version 3.0.31 3) .NET SDK 3.1.404 4) Also installed Azurite V3 Visual Studio Code extension for local blob storage connection string
I have executed func settings add AzureWebJobsStorage "useDevelopmentStorage=$true" to utilize local blob storage, AzureServiceBusConnection connecction string as "Endpoint-sb://my-service-bus-server.servicebus.windows.net/;SharedAccessKeyName=Root;SharedAccessKey=xyz;, FUNCTIONS_EXTENSION_VERSION as 2, FUNCTIONS_WORKER_RUNTIME as java, MAIN_CLASS as Spring Boot Application Main Classname.
The Function Application starts properly I have deployed 2 functions (1) HttpTrigger and (2) ServiceBusQueueTrigger. HttpTrigger works properly but when I publish a message to the Queue to which I have configured ServiceBusQueueTrigger the trigger gets executed properly but the message is always null. This is the stack-trace as given below:
See line #18 which logs the JMS message as received by Function and it show null all the time. The actual Java Class is as given below
Do we have a solution to execute Service Bus Queue Triggers locally ?