@Singleton public class JsonPubSubMessageSerDes extends java.lang.Object implements PubSubMessageSerDes
PubSubMessageSerDes
implementation that uses Jackson ObjectMapper
to convert
application/json mime types.Constructor and Description |
---|
JsonPubSubMessageSerDes(com.fasterxml.jackson.databind.ObjectMapper mapper)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deserialize(byte[] data,
io.micronaut.core.type.Argument<?> type)
Deserializes data into a target type.
|
byte[] |
serialize(java.lang.Object data)
Serializes the message.
|
java.lang.String |
supportedType() |
public JsonPubSubMessageSerDes(com.fasterxml.jackson.databind.ObjectMapper mapper)
mapper
- Jackson ObjectMapperpublic java.lang.Object deserialize(byte[] data, io.micronaut.core.type.Argument<?> type)
PubSubMessageSerDes
deserialize
in interface PubSubMessageSerDes
data
- byte data to deserializetype
- target typepublic byte[] serialize(java.lang.Object data)
PubSubMessageSerDes
serialize
in interface PubSubMessageSerDes
data
- data to serializepublic java.lang.String supportedType()
supportedType
in interface PubSubMessageSerDes