Skip to content
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

Javascript Functions should default to "cardinality": "many" for EventHubs #2815

Open
mhoeger opened this issue May 8, 2018 · 5 comments
Open

Comments

@mhoeger
Copy link
Contributor

mhoeger commented May 8, 2018

The default behavior that we recommend is to batch trigger events. However, we have it as an opt-in setting right now. We should change this so that best practice = default behavior

https://stackoverflow.com/questions/46204764/eventhub-trigger-to-functions-cardinality-with-one-causing-higher-timeouts

Docs on EventHubs settings: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-hubs#trigger---configuration

@mhoeger mhoeger added the 2.0 label May 8, 2018
@paulbatum
Copy link
Member

So I think our template already defaults to many. I assume this issue is tracking that in terms of function.json, you don't need to say "cardinality:many"?

@mhoeger
Copy link
Contributor Author

mhoeger commented May 9, 2018

Yep! The change is to default to batching if "cardinality" is omitted.

@mhoeger
Copy link
Contributor Author

mhoeger commented Jul 25, 2018

Update: the way that "cardinality": "many" works is to transform any and all input data to an array type if cardinality == many on a given function. We can't default cardinality to many without a serious re-write of where this logic goes.

There is a bug where dataType had to be specified to "string" on all event hubs trigger data that is not valid json, which is a regression from v1.

The fix is here: #3170
To address this, will also make documentation more clear that "cardinality": "many" is best practice

@brettsam
Copy link
Member

brettsam commented Jun 3, 2021

Update: the way that "cardinality": "many" works is to transform any and all input data to an array type if cardinality == many on a given function. We can't default cardinality to many without a serious re-write of where this logic goes.

Judging by this comment, it seems like this is something we probably won't be doing and instead make sure templates/docs explain that this is best practices.

@pragnagopa / @fabiocav -- do either of you have context on this one?

@brettsam brettsam removed the 2.0 label Jun 3, 2021
@paulbatum
Copy link
Member

I believe the related issues spell out a strategy for fixing this. Having docs that explain that batched processing is a best practice doesnt help if the customer can't use it because their data is in a non-JSON format (see Azure/azure-functions-eventhubs-extension#118). So from my perspective this is work that should happen, and its mostly a matter of prioritization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants