Add KafkaSharedStreamProducer and KafkaSharedStreamTrigger - #68625
Add KafkaSharedStreamProducer and KafkaSharedStreamTrigger#68625FrankYang0529 wants to merge 1 commit into
Conversation
b474778 to
08fbbae
Compare
08fbbae to
edb9f0f
Compare
1613ce3 to
aa8444b
Compare
jason810496
left a comment
There was a problem hiding this comment.
Nice! LGTM overall.
It would be nice to manually test with breeze start-airflow --integration kafka setup when you have a moment, thanks.
155d89a to
ee0eccc
Compare
Lee-W
left a comment
There was a problem hiding this comment.
will need some time to look it through, but found one nit
8b4fa30 to
8f21ce3
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
jason810496
left a comment
There was a problem hiding this comment.
It would be nice to manually test with breeze start-airflow --integration kafka setup when you have a moment, thanks.
Looking forward for the real integration setup to exercise this feature when you have a moment, thanks.
Event-driven triggers and asset watchers that watch the same Kafka topics each open their own consumer in the triggerer, which does not scale as event-driven schedules grow. Backing them with the shared-stream producer-side ack channel (apache#67523) lets siblings on the same topics and connection share one consumer, while offset commits remain gated on trigger-event persistence so a triggerer crash cannot drop a message the broker already considers delivered (at-least-once). Signed-off-by: PoAn Yang <payang@apache.org>
8f21ce3 to
c2a34f6
Compare
|
@jason810496 I update real integration setup to PR description and verify it can work. Thank you. |
Adds
KafkaSharedStreamProducerandKafkaSharedStreamTriggerto the Apache Kafka provider, backing the producer-side ack channel for shared-stream triggers (#67523). Many event-driven triggers / asset watchers on the same Kafka topics can now share a single consumer in the trigger, with offset commits gated on trigger-event persistence (at-least-once).Verification
These environment variables are needed to avoid a but. #72138 will fix it.
docker exec broker kafka-topics --bootstrap-server localhost:9092 --create --topic shared-stream-demo --partitions 1 --replication-factor 1breeze execairflow connections add kafka_shared_demo --conn-type kafka --conn-extra '{"bootstrap.servers": "broker:29092", "group.id": "shared-stream-demo-group", "enable.auto.commit": false, "auto.offset.reset": "beginning"}'Expected output:
docker exec broker kafka-consumer-groups --bootstrap-server localhost:9092 --describe --group shared-stream-demo-group --membersdocker exec broker kafka-consumer-groups --bootstrap-server localhost:9092 --describe --group shared-stream-demo-grouprelated: #67523
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.