AVRO deserialization fails on Service Bus Subscription Trigger to Azure Function #19759
Closed
2 of 6 tasks
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
issue-addressed
Workflow: The Azure SDK team believes it to be addressed and ready to close.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Schema Registry
Describe the bug
We are using Azure Service Bus (topic/subscription) to decouple a producer which is a Java Microservice and a consumer which is a Node/Typescript Azure Function.
The AF is triggered everytime a message arrives on a particular subscription.
Although we are not using Event Hubs, we created one to use the Schema Registry as we want to use AVRO as protocol for the messages exchanged on service bus.
For simple AVRO Message, it works fine by just passing the Uint8Array conversion of the message received:
const received = await serializer.deserialize(new Uint8Array(Buffer.from(serviceBusMessage)));
But with a more complex AVRO message, it seems the byte array produced by the Java application and sent to the service bus is not the same we get when we parse the triggered message.
To Reproduce
Steps to reproduce the behavior:
application/octect-stream
(we triedavro/binary
with same results, changed it as suggested here )avsc
a. the AVRO Schema as defined on the Schema Registry
b. arr2 which is the byte array I get from the Java Log of the producer
c. arr3 which is the byte array I get in my Azure Function using
JSON.stringify(Object.values(Buffer.from(serviceBusMessage))
Expected behavior
arr3 should be equal to arr2 and be correctly parsed.
Arr2 is correctly parsed, it seems the Serivce Bus is doing something wrong with the message before invoking the Azure Function.
Screenshots


Additional context
This is the Azure Function code
This is the parsing code:
Already asked help to
avsc
maintainer with helped me but no luck in solving it: mtth/avsc#376Thanks a lot
The text was updated successfully, but these errors were encountered: