-
Notifications
You must be signed in to change notification settings - Fork 457
need a way to retrieve event hub message headers #465
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
Comments
In the case of C# functions, you can bind to the raw SB messaging What language is your Function written in? |
NodeJS, however I will also be interested to know if there is a C# example. |
For C#, you'd just change your parameter type to For Node, there is no way currently, but we have some existing issues (e.g. #364) tracking the general issue of providing more trigger input data/control to Node functions. |
@reyang -
|
@MikeStall to answer your 2nd question, we want to access EventData.SystemProperties. Property keys we want to access are:
And I think people might also would like to access EventData.Properties for custom properties in their event data. Although we don't have such requirement yet, it is giving more flexibility to user when dealing with complicated scenarios. |
We also need to add the ability for people to set EventData properties like PartitionKey etc. for output bindings. Currently for languages like Node.js. E.g., support an 'object' binding which will allow users to specify a json object with all the relevant components that we then map to EventData. |
Addressed via #1337. You can now access all the EventData properties via Example for single event: https://github.com/Azure/azure-webjobs-sdk-script/blob/dev/test/WebJobs.Script.Tests.Integration/TestScripts/Node/EventHubTrigger/index.js#L4 Example for multiple events: https://github.com/Azure/azure-webjobs-sdk-script/blob/dev/sample/EventHubTrigger/index.js#L11 |
See wiki page here for more info: https://github.com/Azure/azure-webjobs-sdk-script/wiki/Trigger-Binding-Data |
Great, thank you! 👍 |
A small improvement proposal to the code in above page. There is line Also, should this be already in production? I created a new function, but with a quick look, the |
Tested again today and now the properties were there - thanks! @mathewc The small error in the sample code seems to still be there (see my previous comment). |
For eventHubTrigger, is there a way to get the event hub message headers? Currently only the message payload is provided – while there are a lot of useful information from the headers I wish to retrieve.
Also, it'll be very helpful if there is an example of how to properly handle error - for example, if exception happened while trying to process the event, instead of removing the event from the service bus, leave it and have a chance to retry. This would require access to the retry count, lease time, etc.
The text was updated successfully, but these errors were encountered: