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

Add trigger binding to offset, timestamp as params #59

Conversation

fbeltrao
Copy link
Contributor

@fbeltrao fbeltrao commented Apr 4, 2019

Changes

  • Polishes the automatic binding of topic, partition, offset, timestamp and key in trigger functions
  • Sample function modified to illustrate how to use automatic binding

Sample:

[FunctionName(nameof(PageViews))]
public static void PageViews(
    [KafkaTrigger("LocalBroker", "pageviews", AvroSchema = PageViewsSchema, ConsumerGroup = "azfunc")] KafkaEventData[] kafkaEvents,
    long[] offsetArray,
    int[] partitionArray,
    string[] topicArray,
    DateTime[] timestampArray)
{
    // offsetArray will contain the offsets of each message
    // same for partitionArray, topicArray and timestampArray
}

Part of #44

Copy link
Member

@brandonh-msft brandonh-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced this adds value to anything if the same information is available off an individual KafkaEventData but I'll trust your judgement ;)

@brandonh-msft brandonh-msft merged commit 49276ef into master Apr 4, 2019
@fbeltrao
Copy link
Contributor Author

fbeltrao commented Apr 4, 2019

It is useful if you are binding to poco objects. I am mirroring the same feature from EventHubs trigger

@fbeltrao fbeltrao deleted the fbeltrao/expose-kafka-event-properties-as-trigger-params branch April 5, 2019 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants