1 package de.juplo.kafka;
3 import com.fasterxml.jackson.core.JsonGenerator;
4 import com.fasterxml.jackson.databind.JsonSerializer;
5 import com.fasterxml.jackson.databind.SerializerProvider;
6 import org.apache.kafka.common.TopicPartition;
8 import java.io.IOException;
11 public class TopicPartitionSerializer extends JsonSerializer<TopicPartition>
14 public Class<TopicPartition> handledType()
16 return TopicPartition.class;
20 public void serialize(
21 TopicPartition topicPartition,
22 JsonGenerator jsonGenerator,
23 SerializerProvider serializerProvider) throws IOException
25 jsonGenerator.writeString(topicPartition.toString());