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

Feature request: Kafka Event Data Class #1484

Closed
2 tasks done
lyoung-confluent opened this issue Aug 30, 2022 · 6 comments
Closed
2 tasks done

Feature request: Kafka Event Data Class #1484

lyoung-confluent opened this issue Aug 30, 2022 · 6 comments
Assignees
Labels
feature-request feature request

Comments

@lyoung-confluent
Copy link
Contributor

lyoung-confluent commented Aug 30, 2022

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

@lyoung-confluent lyoung-confluent added feature-request feature request triage Pending triage from maintainers labels Aug 30, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 30, 2022

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

@rubenfonseca rubenfonseca removed the triage Pending triage from maintainers label Aug 31, 2022
@rubenfonseca
Copy link
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!

@ran-isenberg
Copy link
Contributor

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

@ran-isenberg
Copy link
Contributor

see also #1499

@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Sep 5, 2022
@github-actions
Copy link
Contributor

This is now released under 1.29.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Sep 13, 2022
@leandrodamascena leandrodamascena added the pending-release Fix or implementation already in dev waiting to be released label Sep 13, 2022
@github-actions
Copy link
Contributor

This is now released under 1.29.1 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request
Projects
None yet
Development

No branches or pull requests

4 participants