-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12d6c68
commit e13b8f2
Showing
3 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
14 changes: 7 additions & 7 deletions
14
src/main/java/com/sngular/kloadgen/serializer/CustomStringEnrichedRecordSerializer.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package com.sngular.kloadgen.serializer; | ||
|
||
import org.apache.kafka.common.serialization.Serializer; | ||
import org.apache.kafka.common.serialization.StringSerializer; | ||
|
||
import java.util.Map; | ||
|
||
public class CustomStringEnrichedRecordSerializer<T extends EnrichedRecord> implements EnrichedRecordSerializer<T> { | ||
StringSerializer stringSerializer; | ||
import org.apache.kafka.common.serialization.StringSerializer; | ||
|
||
public final class CustomStringEnrichedRecordSerializer<T extends EnrichedRecord> implements EnrichedRecordSerializer<T> { | ||
private final StringSerializer stringSerializer; | ||
|
||
public CustomStringEnrichedRecordSerializer() { | ||
stringSerializer = new StringSerializer(); | ||
} | ||
|
||
public void configure(Map<String, ?> configs, boolean isKey) { | ||
public void configure(final Map<String, ?> configs, final boolean isKey) { | ||
stringSerializer.configure(configs, isKey); | ||
} | ||
public byte[] serialize(String topic, EnrichedRecord data) { | ||
|
||
public byte[] serialize(final String topic, final EnrichedRecord data) { | ||
return stringSerializer.serialize(topic, data.toString()); | ||
} | ||
} |