-
Notifications
You must be signed in to change notification settings - Fork 9
Implement Kafka middleware for CloudEvents and raw message handling #140
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: aliok <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Copilot The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Copilot The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Co-authored-by: aliok <[email protected]>
Co-authored-by: aliok <[email protected]>
|
@copilot you should create 2 mains
|
Co-authored-by: aliok <[email protected]>
Done. Created separate commands:
Removed the old Commit: 2ba569f |
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Adds Kafka consumer middleware following the existing patterns from
cloudeventsandhttppackages.Implementation
Core Package (
kafka/)service.go- Kafka consumer with automatic CloudEvents detection (structured/binary mode) and raw message handlinginstance.go- Handler interfaces supporting bothHandle(context.Context, event.Event)andHandle(context.Context, kafka.Message)signatureslogs.go- Logging configuration matching existing packagesservice_test.go- Tests for lifecycle, configuration parsing, and handler detectionmock/function.go- Test mock avoiding import cyclesREADME.md- Comprehensive documentation for the kafka packageExample Commands
Following the repository pattern of separate commands for different handler types:
cmd/fcekafka/main.go- CloudEvents handler example (similar tofce)cmd/frawkafka/main.go- Raw message handler example (similar tofhttp)Configuration
Environment variables:
KAFKA_BROKERS- Comma-separated broker list (default:localhost:9092)KAFKA_TOPICS- Comma-separated topics (default:func-topic)KAFKA_CONSUMER_GROUP- Consumer group ID (default:func-go-consumer)Dependencies
Added
github.com/segmentio/[email protected]- standard Go Kafka client with no known vulnerabilities.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.