Skip to content

Commit

Permalink
Configure Serdes from TestTopology
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Apr 8, 2024
1 parent 1967dde commit 2129eec
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,28 @@ public void stop() {
}
}

/**
* Configure a {@code Serde} for values using {@link #properties}
* @param serde serde to configure
* @return configured {@code Serde}
* @param <T> type to be (de-)serialized
*/
public <T> Serde<T> configureValueSerde(final Serde<T> serde) {
serde.configure(this.properties, false);
return serde;
}

/**
* Configure a {@code Serde} for keys using {@link #properties}
* @param serde serde to configure
* @return configured {@code Serde}
* @param <T> type to be (de-)serialized
*/
public <T> Serde<T> configureKeySerde(final Serde<T> serde) {
serde.configure(this.properties, true);
return serde;
}

private Properties getProperties() {
final Properties props = new Properties();
props.putAll(this.properties);
Expand Down

0 comments on commit 2129eec

Please sign in to comment.