Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse AMQP Payload from EventHub Properly #39711

Open
EvanR-Dev opened this issue Feb 13, 2025 · 1 comment
Open

Parse AMQP Payload from EventHub Properly #39711

EvanR-Dev opened this issue Feb 13, 2025 · 1 comment
Assignees
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. Event Hubs feature-request This issue requires a new behavior in the product in order be resolved. Messaging Messaging crew needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team

Comments

@EvanR-Dev
Copy link

Is your feature request related to a problem? Please describe.
To support EventHub SDK-type Bindings for the Python worker, we need to parse the incoming content (from ModelBindingData) that the Functions Host sends us. Here is an example:

Raw data:
"\000Sr\301\207\010\243\033x-opt-sequence-number-epochT\377\243\025x-opt-sequence-numberU\000\243\014x-opt-offsetU\000\243\023x-opt-enqueued-time\000\243\035com.microsoft:datetime-offset\201\010\335F\333\247\202\022 \000St\301I\002\241\rDiagnostic-Id\241700-1aa201483d464ac3c3d2ab796fbccb36-72e947bb22f404fc-00\000Su\240\010message1"

The representation of this in code (from the debugger):
b'\x00Sr\xc1\x87\x08\xa3\x1bx-opt-sequence-number-epochT\xff\xa3\x15x-opt-sequence-numberU\x00\xa3\x0cx-opt-offsetU\x00\xa3\x13x-opt-enqueued-time\x00\xa3\x1dcom.microsoft:datetime-offset\x81\x08\xddF\xdb\xa7\x82\x12 \x00St\xc1I\x02\xa1\rDiagnostic-Id\xa1700-1aa201483d464ac3c3d2ab796fbccb36-72e947bb22f404fc-00\x00Su\xa0\x08message1'

Describe the solution you'd like
The goal is to be able to construct an azure.eventhub.EventData object out of this. Today, the Dotnet worker does exactly this by parsing using the Azure.Core.Amqp library (FromBytes).

Is there a proper way to parse this data in Python, like how the Dotnet worker does it? That is, there should be a FromBytes method that will easily convert this data into an EventHub object.

Describe alternatives you've considered
We have tried using similar libraries in Python such as azure.eventhub.amqp and uamqp but are met with decoding errors or an invalid/empty EventData object.

Additional context
From thread "Azure Functions Python - Parsing EventHub Message"

@github-actions github-actions bot added 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. Event Hubs needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 13, 2025
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@kashifkhan kashifkhan added the Messaging Messaging crew label Feb 13, 2025
@kristapratico kristapratico added feature-request This issue requires a new behavior in the product in order be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. Event Hubs feature-request This issue requires a new behavior in the product in order be resolved. Messaging Messaging crew needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team
Projects
None yet
Development

No branches or pull requests

5 participants