Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix references to SerdesUtils #270

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ Note that all the Kafka Streams properties have been moved under `kafka.properti

## Avro Serializer and Deserializer

Whenever you need to serialize or deserialize records with Avro schemas, you can use the `SerdeUtils` class as follows:
Whenever you need to serialize or deserialize records with Avro schemas, you can use the `SerdesUtils` class as follows:

```java
SerdeUtils.<MyAvroValue>getValueSerde()
SerdesUtils.<MyAvroValue>getValueSerde()
```

or

```java
SerdeUtils.<MyAvroValue>getKeySerde()
SerdesUtils.<MyAvroValue>getKeySerde()
```

Here is an example of using these methods in your topology:
Expand All @@ -193,8 +193,8 @@ public class MyKafkaStreams extends KafkaStreamsStarter {
@Override
public void topology(StreamsBuilder streamsBuilder) {
streamsBuilder
.stream("INPUT_TOPIC", Consumed.with(Serdes.String(), SerdeUtils.<KafkaPerson>getValueSerde()))
.to("OUTPUT_TOPIC", Produced.with(Serdes.String(), SerdeUtils.<KafkaPerson>getValueSerde()));
.stream("INPUT_TOPIC", Consumed.with(Serdes.String(), SerdesUtils.<KafkaPerson>getValueSerde()))
.to("OUTPUT_TOPIC", Produced.with(Serdes.String(), SerdesUtils.<KafkaPerson>getValueSerde()));
}
}
```
Expand Down Expand Up @@ -234,11 +234,11 @@ public class MyKafkaStreams extends KafkaStreamsStarter {
@Override
public void topology(StreamsBuilder streamsBuilder) {
KStream<String, KafkaPerson> stream = streamsBuilder
.stream("INPUT_TOPIC", Consumed.with(Serdes.String(), SerdeUtils.getValueSerde()));
.stream("INPUT_TOPIC", Consumed.with(Serdes.String(), SerdesUtils.getValueSerde()));

TopologyErrorHandler
.catchErrors(stream.mapValues(MyKafkaStreams::toUpperCase))
.to("OUTPUT_TOPIC", Produced.with(Serdes.String(), SerdeUtils.getValueSerde()));
.to("OUTPUT_TOPIC", Produced.with(Serdes.String(), SerdesUtils.getValueSerde()));
}

@Override
Expand Down Expand Up @@ -522,10 +522,10 @@ public class MyKafkaStreamsTest extends KafkaStreamsStarterTest {
@BeforeEach
void setUp() {
inputTopic = testDriver.createInputTopic("INPUT_TOPIC", new StringSerializer(),
SerdeUtils.<KafkaPerson>getValueSerde().serializer());
SerdesUtils.<KafkaPerson>getValueSerde().serializer());

outputTopic = testDriver.createOutputTopic("OUTPUT_TOPIC", new StringDeserializer(),
SerdeUtils.<KafkaPerson>getValueSerde().deserializer());
SerdesUtils.<KafkaPerson>getValueSerde().deserializer());
}

@Test
Expand Down