question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EventHub output binding: set partitionKey for output event

See original GitHub issue

Context

The EventHub SDK allows to specify the partitionKey for a batch of events, as shown here:

batch = hub_client.create_batch(partition_key=mykey)
batch.add(EventData(json.dumps({ ... })))
hub_client.send_batch(batch)

Issue

The documentation for Azure Functions shows how to use a function return value to send an event to EventHub, using the following configuration and function:

{
    "type": "eventHub",
    "name": "$return",
    "eventHubName": "myeventhub",
    "connection": "MyEventHubSendAppSetting",
    "direction": "out"
}
import logging
import azure.functions as func

def main(timer: func.TimerRequest) -> str:
    return 'Hello world'

How can we modify the example above to set the partitionKey on the output message ?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cgreco-cmcommented, Oct 19, 2022

I’d also be interested in utilizing this functionality!

1reaction
barbara-desousa-krogercommented, Jun 2, 2022

Any update on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set partitionKey for the event hub output binding
I have a javascript function app, which defines output binding pointing to an Event Hub as described here. I'm sending multiple messages at ......
Read more >
Azure Event Hubs output binding for Azure Functions
Use the Event Hubs output binding to write events to an event stream. You must have send permission to an event hub to...
Read more >
Eventhub triggered Azure function: Replays and Retries
Since all 10 events are sent to partition 0 as a batch and batchCheckpointFrequency is set to 2, azure function will mark the...
Read more >
Processing 100000 Events Per Second on Azure Functions
Functions picks up messages from the ingestion event hub, ... outputWeatherData, IAsyncCollector<EventData> outputSeismicData, ...
Read more >
Building an event streaming app with Azure Functions, Event ...
For this module, I've created three outputs: One for the name of our ... We set this up for our Event Hub Namespace...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found