refactor: remove Alpakka Kafka deprecated APIs - #587
Draft
He-Pin wants to merge 3 commits into
Draft
Conversation
Motivation: ManualSubscription.rebalanceListener/withRebalanceListener were deprecated since Alpakka Kafka 1.0-RC1. DrainingControl.shutdown() was deprecated since Alpakka Kafka 2.0.0 in favor of drainAndShutdown(). Modification: Remove deprecated rebalanceListener/withRebalanceListener from ManualSubscription trait. Simplify DrainingControl.shutdown() to delegate to control.shutdown() without the deprecated drain behavior. Result: ManualSubscription no longer exposes misleading rebalance listener methods. DrainingControl.shutdown() delegates consistently with other Control methods. Tests: Not run - deprecated API cleanup References: None - deprecated API cleanup
He-Pin
marked this pull request as draft
July 4, 2026 20:33
He-Pin
marked this pull request as ready for review
July 5, 2026 04:25
pjfanning
reviewed
Jul 5, 2026
|
|
||
| /** @deprecated Manual subscriptions never rebalances, since Alpakka Kafka 1.0-RC1 */ | ||
| @deprecated("Manual subscription never rebalances", "Alpakka Kafka 1.0-RC1") | ||
| def rebalanceListener: Option[ActorRef] = None |
Member
There was a problem hiding this comment.
do we need to keep this function?
pjfanning
reviewed
Jul 5, 2026
|
|
||
| override def stop(): Future[Done] = control.stop() | ||
|
|
||
| @deprecated("Use `drainAndShutdown` for proper shutdown of the stream.", "Alpakka Kafka 2.0.0") |
Member
There was a problem hiding this comment.
should we keep this function deprecated?
Member
There was a problem hiding this comment.
I don't mean to revert it but since we are keeping the function, should we keep the retained function deprecated and continue to encourage users to use drainAndShutdown?
He-Pin
marked this pull request as draft
July 5, 2026 19:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ManualSubscription.rebalanceListener/withRebalanceListenerwere deprecated since Alpakka Kafka 1.0-RC1 (manual subscriptions never rebalance).DrainingControl.shutdown()was deprecated since Alpakka Kafka 2.0.0 in favor ofdrainAndShutdown().Modification
rebalanceListenerandwithRebalanceListenerfromManualSubscriptiontrait. Concrete case classes (Assignment,AssignmentWithOffset,AssignmentOffsetsForTimes) already implementwithRebalanceListenerand now inheritrebalanceListener = Nonefrom the trait.DrainingControl.shutdown()to delegate tocontrol.shutdown()without the deprecated drain-and-wait behavior, making it consistent with otherControlimplementations.Result
ManualSubscriptionno longer exposes misleading rebalance listener methods.DrainingControl.shutdown()delegates consistently with otherControlmethods.Tests
Not run - deprecated API cleanup
References
None - deprecated API cleanup