Using an output binding for Eventhub it was possible to add furhter message properties like Key/Headers in the v3 programming model, as shown in the examples:
context.bindings.outputKafkaMessage = ["{ "Offset":364,"Partition":0,"Topic":"kafkaeventhubtest1","Timestamp":"2022-04-09T03:20:06.591Z", "Value": "one", "Headers": [{ "Key": "test", "Value": "javascript" }] }",
"{ "Offset":364,"Partition":0,"Topic":"kafkaeventhubtest1","Timestamp":"2022-04-09T03:20:06.591Z", "Value": "two", "Headers": [{ "Key": "test", "Value": "javascript" }] }"]
This also worked for the Eventhub bindings. But it fails in the v4 programming model, as the whole object is just produced as a message to Eventhub.
Migrated my existing Azure function to v4, set the specific output.eventHub
property and testes producing messages to this binding.
Instead of receiving the Value
property as a message with the Key
and Headers
properties set as Key and Headers respectively the whole object was published as a message to Eventhub, with no set Key or Headers.
Sebastian Kramer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.