You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/migrating-to-zio-kafka-3.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
-
id: migrating-to-2.11
3
-
title: "Migrating to zio-kafka 2.11"
2
+
id: migrating-to-zio-kafka-3
3
+
title: "Migrating to zio-kafka 3"
4
4
---
5
5
6
-
Zio-kafka 2.11 paves the way for zio-kafka 3.0 by deprecating things that will be removed in zio-kafka 3.0.
7
-
8
-
If you encounter deprecated methods in your code, follow this guide.
6
+
Zio-kafka 3.0.0 removes everything that was deprecated in the zio-kafka 2.x series. In particular, this includes
7
+
accessor methods. To prepare for zio-kafka 3.0, _you should always first migrate to zio-kafka 2.11.0_ and solve all
8
+
deprecation issues, using this page as a guide.
9
9
10
10
# Renamed methods
11
11
@@ -25,7 +25,7 @@ you use these accessor methods follow one of these approaches:
25
25
## Use the ZIO Service pattern
26
26
27
27
This is the best option. For established codebases it may be a lot of work to get here. If you are already follow
28
-
this pattern, using it for zio-kafka services as well will be easy.
28
+
this pattern, using it for zio-kafka services as well will be easy. See [ZIO service pattern](https://zio.dev/reference/service-pattern/) for more information.
29
29
30
30
Here is an example with a `Consumer`, but it works the same with `Producer` and `TransactionalProducer`. We get the
31
31
`Consumer` from the environment in the layer with the `ZIO.service` method, and then inject it into the service class.
@@ -57,6 +57,9 @@ case class ServiceLive(consumer: Consumer) extends Service {
57
57
}
58
58
```
59
59
60
+
Constructing a `Consumer` layer is described in [creating a consumer](creating-a-consumer.md). Constructing a
61
+
`Producer` or `TransactionalProducer` layer works in a similar way.
62
+
60
63
## YOLO, use `ZIO.service` everywhere
61
64
62
65
The other option is to replace all accessor methods of `Consumer`, `Producer` and `TransactionalProducer` as follows:
@@ -65,7 +68,9 @@ The other option is to replace all accessor methods of `Consumer`, `Producer` an
// Using `provideSomeShared[Scope]` instead of `provideShared`
115
123
)
116
124
```
117
125
@@ -135,6 +143,10 @@ for {
135
143
} yield ()
136
144
```
137
145
146
+
# `restartStreamOnRebalancing` mode
147
+
148
+
This mode will no longer be available in zio-kafka 3. Contact us on [Discord](https://discord.com/channels/629491597070827530/629497941719121960) for alternatives.
149
+
138
150
# Other changes?
139
151
140
152
If you find a change that is not documented here then please let us know via a
0 commit comments