Skip to content

Feature request: Kafka Event Data Class #1484

Closed

Description

@lyoung-confluent

Use case

When using a Kafka event source either from self-managed Apache Kafka or Amazon MSK there should be a relevant data class for easy iteration/decoding.

Such functionality is implemented already in aws-lambda-go and in aws-lambda-java-libs.

Solution/User Experience

Similar to other streaming data sources a records property should be iterable returning a KafkaEventRecord that transparently decodes the values from JSON:

from aws_lambda_powertools.utilities.data_classes import event_source, KafkaEvent

@event_source(data_class=KafkaEvent)
def handler(event: KafkaEvent, context: LambdaContext):
	for record in event.records:
		print(record.decoded_key, record.json_value)

Alternative solutions

No response

Acknowledgment

Activity

  1. added
    feature-request
    triage
    on Aug 30, 2022
  2. boring-cyborg commented on Aug 30, 2022

    @boring-cyborg

    Thanks for opening your first issue here! We'll come back to you as soon as we can.

  3. removed
    triage
    on Aug 31, 2022
  4. rubenfonseca commented on Aug 31, 2022

    @rubenfonseca
    Contributor

    Thank you so much for the feature request @lyoung-confluent! It makes a lot of sense to cover Kafka events too. We're looking forward to review your PR tomorrow!

  5. ran-isenberg commented on Sep 2, 2022

    @ran-isenberg
    Contributor

    @rubenfonseca i think we should also create a similar parser event for this one. what do you think?

  6. ran-isenberg commented on Sep 4, 2022

    @ran-isenberg
    Contributor

    see also #1499

  7. added
    pending-release
    on Sep 5, 2022
  8. github-actions commented on Sep 13, 2022

    @github-actions
    Contributor

    This is now released under 1.29.0 version!

  9. removed
    pending-release
    on Sep 13, 2022
  10. added
    pending-release
    on Sep 13, 2022
  11. github-actions commented on Sep 13, 2022

    @github-actions
    Contributor

    This is now released under 1.29.1 version!

  12. removed
    pending-release
    on Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions