Skip to content

Commit

Permalink
Deprecate restartStreamOnRebalancing (#1439)
Browse files Browse the repository at this point in the history
The feature `restartStreamOnRebalancing` is no longer needed in
zio-kafka 3.x as transactional producing will work without it.
  • Loading branch information
erikvanoosten authored Jan 16, 2025
1 parent 5c579cc commit 2de285c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import zio.stream.ZStream

import java.io.File
import java.nio.file.{ Files, StandardCopyOption }
import scala.annotation.nowarn

object KafkaTestUtils {

Expand Down Expand Up @@ -127,6 +128,10 @@ object KafkaTestUtils {
clientInstanceId: Option[String] = None,
allowAutoCreateTopics: Boolean = true,
offsetRetrieval: OffsetRetrieval = OffsetRetrieval.Auto(AutoOffsetStrategy.Earliest),
// @deprecated
// starting zio-kafka 3.0.0 `restartStreamOnRebalancing` is no longer available. As far as the zio-kafka
// contributors know, this feature is only used for transactional producing. Zio-kafka 3.0.0 no longer needs it for
// that.
restartStreamOnRebalancing: Boolean = false,
rebalanceSafeCommits: Boolean = false,
maxRebalanceDuration: Duration = 3.minutes,
Expand All @@ -136,6 +141,7 @@ object KafkaTestUtils {
properties: Map[String, String] = Map.empty
): URIO[Kafka, ConsumerSettings] =
ZIO.serviceWith[Kafka] { (kafka: Kafka) =>
@nowarn("msg=deprecated")
val settings = ConsumerSettings(kafka.bootstrapServers)
.withClientId(clientId)
.withCloseTimeout(5.seconds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,13 @@ final case class ConsumerSettings(
* @param value
* When `true` _all_ streams are restarted during a rebalance, including those streams that are not revoked. The
* default is `false`.
*
* @deprecated
* starting zio-kafka 3.0.0 `restartStreamOnRebalancing` is no longer available. As far as the zio-kafka
* contributors know, this feature is only used for transactional producing. Zio-kafka 3.0.0 no longer needs it for
* that.
*/
@deprecated("`restartStreamOnRebalancing` will be removed in zio-kafka 3.0", "2.10.0")
def withRestartStreamOnRebalancing(value: Boolean): ConsumerSettings =
copy(restartStreamOnRebalancing = value)

Expand Down

0 comments on commit 2de285c

Please sign in to comment.