Class StringOrBytesSerializer
java.lang.Object
org.springframework.kafka.support.serializer.StringOrBytesSerializer
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.kafka.common.serialization.Serializer<Object>
public class StringOrBytesSerializer
extends Object
implements org.apache.kafka.common.serialization.Serializer<Object>
A serializer that can handle
byte[]
, Bytes
and String
.
Convenient when used with one of the Json message converters.- Since:
- 2.3
- Author:
- Gary Russell
-
Constructor Details
-
StringOrBytesSerializer
public StringOrBytesSerializer()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceorg.apache.kafka.common.serialization.Serializer<Object>
-
serialize
- Specified by:
serialize
in interfaceorg.apache.kafka.common.serialization.Serializer<Object>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.kafka.common.serialization.Serializer<Object>
-