Add message header to EventData writing to EventHub
See original GitHub issueThis is a feature request to allow sending message headers along with the message body when streaming to an EventHub sink. In our system the backend relies on the message headers, so we needed to implement our own ForeachWriter in Spark, just to add the message header to the EventData object. In our custom ForeachWriter we do it like this
import com.microsoft.azure.eventhubs.{EventData, EventHubClient}
...
val data: EventData = EventData.create(eventByteArray)
data.getProperties.put("EventType", messageHeader)
Having our own ForeachWriter we can not benefit from all the optimizations you put into this library. We would be very happy to be able to use a syntax like this:
// Write body data from a DataFrame to EventHubs with a message header
val ds = df
.selectExpr("header", "body")
.writeStream
.format("eventhubs")
.options(ehWriteConf.toMap) // EventHubsConf containing the destination EventHub connection string.
.start()
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Sending header data in Azure eventhub using Python
In this I am trying to send properties in the form of a dict along with message body , the below is the...
Read more >Send event - Microsoft Learn
Request Headers. See Common parameters and headers for headers and parameters that are used by all requests related to Event Hubs.
Read more >5 Message handling with Event Hubs - liveBook · Manning
An Event Hub ingests messages from applications. It records the details of each message in a journal and saves the message data for...
Read more >Azure Event Hubs - Apache Camel
Send and receive events to/from Azure Event Hubs using AMQP protocol. ... Async Consumer and Producer; Usage; Message Headers; Message body type ...
Read more >Azure.Messaging.EventHubs 5.7.5 - NuGet
Install the package. Install the Azure Event Hubs client library for .NET with NuGet: dotnet add package Azure.Messaging.EventHubs ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jpsimen yea, adding a single
String, String
tuple doesn’t make much sense to me. I’m going to add it as aMap[String, String]
- you should be able to have multiple properties perEventData
👍@sabeegrewal no objections to adding it to the EventHubsSink. 😃 Regarding your question: Yes, a key value pair of type (String, String) to set the EventData properties would be nice.