azure-functions-java-worker icon indicating copy to clipboard operation
azure-functions-java-worker copied to clipboard

message is null in service bus topic trigger

Open VikramNisarga opened this issue 4 years ago • 3 comments

Investigative information

Hi Team, I'm not sure if this needs to be logged against azure-service-bus-java SDK or here. Basically, the issue is, if the message body is set using the method com.microsoft.azure.servicebus.Message.setMessageBody(MessageBody body), the message body will be null when the message is delivered to the java function which uses service bus topic trigger. It is working if the body is set using the method void com.microsoft.azure.servicebus.Message.setBody(byte[] body), but this method is deprecated. I tried debugging the code, looks like inputData of StreamingMessage object has empty data body. I'm still developing the function, so i've not yet deployed it in azure.

I'm facing the same issue in a python function as well.

  • Timestamp:2020-03-03T09:53:19.996
  • Function id:2eeeb4b8-545b-4b58-9a89-d066a23ade84
  • Function version: V3
  • Invocation ID:38836a62-d02f-40e2-9150-23e726a8eeb6
  • Region: central india

StreamingMessage

invocation_request { invocation_id: "38836a62-d02f-40e2-9150-23e726a8eeb6" function_id: "2eeeb4b8-545b-4b58-9a89-d066a23ade84" input_data { name: "test" data { } } trigger_metadata { key: "DeliveryCount" value { json: "1" } } trigger_metadata { key: "LockToken" value { string: "e5753878-83c1-4896-9ce9-f18a0f13f883" } } trigger_metadata { key: "ExpiresAtUtc" value { json: "\"2020-03-03T09:53:19.996Z\"" } } trigger_metadata { key: "EnqueuedTimeUtc" value { json: "\"2020-03-02T09:53:19.996Z\"" } } trigger_metadata { key: "MessageId" value { string: "2c178972-0931-4f82-9024-fddf4d14ad64" } } trigger_metadata { key: "SequenceNumber" value { json: "131" } } trigger_metadata { key: "CorrelationId" value { string: "azureedge-0" } } trigger_metadata { key: "UserProperties" value { json: "{\"Priority\":\"URGENT\"}" } } trigger_metadata { key: "MessageReceiver" value { json: "{\"RegisteredPlugins\":[],\"ReceiveMode\":0,\"PrefetchCount\":0,\"LastPeekedSequenceNumber\":0,\"Path\":\"azureedge/Subscriptions/URGENT\",\"OperationTimeout\":\"00:01:00\",\"ServiceBusConnection\":{\"Endpoint\":\"sb://cind-dd-sbus-s1.servicebus.windows.net\",\"OperationTimeout\":\"00:01:00\",\"RetryPolicy\":{\"MinimalBackoff\":\"00:00:00\",\"MaximumBackoff\":\"00:00:30\",\"DeltaBackoff\":\"00:00:03\",\"MaxRetryCount\":5,\"IsServerBusy\":false,\"ServerBusyExceptionMessage\":null},\"TransportType\":0,\"TokenProvider\":{},\"IsClosedOrClosing\":false},\"IsClosedOrClosing\":false,\"OwnsConnection\":true,\"ClientId\":\"MessageReceiver1azureedge/Subscriptions/URGENT\",\"RetryPolicy\":{\"MinimalBackoff\":\"00:00:00\",\"MaximumBackoff\":\"00:00:30\",\"DeltaBackoff\":\"00:00:03\",\"MaxRetryCount\":5,\"IsServerBusy\":false,\"ServerBusyExceptionMessage\":null}}" } } trigger_metadata { key: "sys" value { json: "{\"MethodName\":\"SubmitTaskToBatch\",\"UtcNow\":\"2020-03-02T09:53:20.4546575Z\",\"RandGuid\":\"cf200ea2-3f0f-4692-9635-45c55401157f\"}" } } trace_context { } }

Repro steps

steps required to reproduce the problem:

  1. Construct Message by using com.microsoft.azure.servicebus.Message.setMessageBody(MessageBody body) and post it to topic
  2. Consume the message using java function

Expected behavior

Message should not be null.

Actual behavior

Message is null

Known workarounds

Setting the message body using void com.microsoft.azure.servicebus.Message.setBody(byte[] body)

VikramNisarga avatar Mar 02 '20 11:03 VikramNisarga

Possibly related to https://github.com/Azure/azure-sdk-for-net/issues/6912?

DamonStamper avatar Oct 14 '20 13:10 DamonStamper

@joshfree should we move this issue to azure sdk? Thank you so much

amamounelsayed avatar Oct 19 '20 20:10 amamounelsayed

Yes, this Service Bus Java SDK ("Track 1") issue can be moved to https://github.com/azure/azure-sdk-for-java/

/cc @hemanttanwar

joshfree avatar Oct 19 '20 22:10 joshfree

Closing this issue here as it is related to azure sdk for java

shreyas-gopalakrishna avatar Mar 01 '23 05:03 shreyas-gopalakrishna