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.

Is there way to run a timer based function connected to Event Hubs?

See original GitHub issue

The event hub trigger is executed every time a single event is sent. I’d like to perform various operations on a batch of data from event hub based on a time interval, is there a way to set this up? There wasn’t an option to use Event Hubs as an input when choosing a timer based function.

I saw that there is an archive option on event hubs which will put the data into a blob every X minutes or Y MB in size. I figured I could use a blob trigger for when those created. However, in retrieving that data, I’m not sure how exactly to parse out my data easily:

2016-09-14T18:41:53.190 Objavro.codecnullavro.schema�{"type":"record","name":"EventData","namespace":"Microsoft.ServiceBus.Messaging",
"fields":[{"name":"SequenceNumber","type":"long"},
{"name":"Offset","type":"string"},
{"name":"EnqueuedTimeUtc","type":"string"},
{"name":"SystemProperties","type":{"type":"map","values":["long","double","string","bytes"]}},
{"name":"Properties","type":{"type":"map","values":["long","double","string","bytes"]}},
{"name":"Body","type":["null","bytes"]}]}
�^|�Q�w���9�}�����1922536(9/14/2016 6:40:50 PM�{"Temperature":"37.0","Humidity":"0.4"}
�^|�Q�w���9�}�����1922672(9/14/2016 6:40:50 PM�{"Temperature":"37.0","Humidity":"0.4"}
�^|�Q�w���9�}�����1922808(9/14/2016 6:40:50 PM�{"Temperature":"37.0","Humidity":"0.4"}
�^|�Q�w���9�}�����1922944(9/14/2016 6:40:51 PM�{"Temperature":"37.0","Humidity":"0.4"}
�^|�Q�w���9�}�����1923080(9/14/2016 6:40:51 PM�{"Temperature":"37.0","Humidity":"0.4"}
�^|�Q�w���9�}��

Even if that does work, I was concerned about the 10,000 blob limit documented here: https://azure.microsoft.com/en-us/documentation/articles/functions-bindings-storage/

In a 24 hour period @ 1 min archive intervals we are already at 1,400 blobs. The recommendation is then to use a queue trigger. However I don’t see any way to use Event Hubs with a queue trigger in this way.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rsdmikecommented, Oct 3, 2016

Woohoo!

0reactions
mathewccommented, Oct 2, 2016

Batch support for Node EventHub trigger functions has been added in https://github.com/Azure/azure-webjobs-sdk-script/commit/53977df26cbaab9765ae1d107b3460d41ae52c38.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create an azure timer function to fetch events from ...
A Timer triggered function is tricky in this case since you then have to manually abort the function after two minutes and manually...
Read more >
Azure Event Hubs trigger for Azure Functions
Use the function trigger to respond to an event sent to an event hub event stream. You must have read access to the...
Read more >
Azure Functions and Event Hubs: Optimising for Throughput
I take a fairly standard serverless event processing scenario — an Azure Function triggered by messages in an Event Hub — and talk...
Read more >
Explained Use Case - Azure event hubs and Azure functions
Learn how to provision and use Microsoft Azure Event Hubs & Serverless Azure Functions to ingest and consume events from connected devices ...
Read more >
Microsoft.Azure.WebJobs.Extensions.EventHubs 5.5.0
You can send individual events to an Event Hub by applying the EventHubAttribute the function return value. The return value can be of...
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