Repository navigation
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2e4ed3e. Configure here.
evanh
left a comment
There was a problem hiding this comment.
Mostly looks good, couple style things.
| use super::consumer::{CommitClient, Event, KafkaContext, KafkaMessage, MessageQueue}; | ||
| use super::message::MessageBackend; | ||
|
|
||
| pub enum ConsumerBackend { |
There was a problem hiding this comment.
I think I would rather this be a Trait, and then have the logic for the two backends split up, instead of having if statements throughout the functions. Is that possible?
There was a problem hiding this comment.
It's possible but since we eventually want to be on the Arroyo consumer, I don't think we need an abstraction around a backend we're going to remove. The backend is also picked at runtime, so a trait would just move the branch to main.rs (start_consumer::<ArroyoConsumer> vs start_consumer::<RdkafkaConsumer>)
|
|
||
| upkeep-retry-integration-test: | ||
| name: Upkeep retry integration test | ||
| name: Upkeep retry integration test${{ matrix.consumer_backend == 'arroyo' && ' (arroyo)' || '' }} |
There was a problem hiding this comment.
is upkeep even related to kafka consumer backends?

Adds the
TASKBROKER_USE_ARROYO_CONSUMERconfig. When it is set, the broker consumes with Arroyo'sAsyncKafkaConsumerinstead of rdkafka'sStreamConsumer.Since it is a static config, switching consumer backend requires a restart, but I think the tradeoff of extra simplicity on the consumer is worth it as we avoid having to tear down the running consumer mid-process, and avoid introducing the runtime config lifecycle into the consumer code.
Implemented:
ConsumerBackendwrapping both clients. It creates them from the same client config and hands out partition queues.PartitionQueueBackendwrapping rdkafka'sStreamPartitionQueueand Arroyo'sAsyncPartitionQueuebehindMessageQueue, so themapactors stream messages from either.on_assignandon_revokesend the same events on the same channel as rdkafka'spre_rebalance, and block untilhandle_eventscompletes the rendezvous.handle_eventsandprocessing_strategy!are shared.Some more context:
poll_consumer_client. On revoke and shutdown, its aborted actors are joined, so none stores offsets after the revoke or still holds the consumer when it closes.start_consumerdrops the consumer (for both rdkafka and Arroyo consumers) inspawn_blockingafterhandle_eventsreturns, so the blocking close and final commit stay off the async workers.start_consumerholds the last reference.CI was also updated to run on both consumer backends.
Refs STREAM-1859