Class ByteArrayJsonMessageConverter
- java.lang.Object
-
- org.springframework.kafka.support.converter.MessagingMessageConverter
-
- org.springframework.kafka.support.converter.JsonMessageConverter
-
- org.springframework.kafka.support.converter.ByteArrayJsonMessageConverter
-
- All Implemented Interfaces:
MessageConverter
,RecordMessageConverter
public class ByteArrayJsonMessageConverter extends JsonMessageConverter
JSON Message converter -byte[]
on output, String, Bytes, or byte[] on input. Used in conjunction with KafkaByteArraySerializer/(ByteArrayDeserializer, BytesDeserializer, or StringDeserializer)
. More efficient thanStringJsonMessageConverter
because theString<->byte[]
conversion is avoided.- Since:
- 2.3
- Author:
- Gary Russell
-
-
Field Summary
-
Fields inherited from class org.springframework.kafka.support.converter.MessagingMessageConverter
logger
-
-
Constructor Summary
Constructors Constructor Description ByteArrayJsonMessageConverter()
ByteArrayJsonMessageConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
convertPayload(org.springframework.messaging.Message<?> message)
Subclasses can convert the payload; by default, it's sent unchanged to Kafka.-
Methods inherited from class org.springframework.kafka.support.converter.JsonMessageConverter
extractAndConvertValue, getObjectMapper, getTypeMapper, initialRecordHeaders, setTypeMapper
-
Methods inherited from class org.springframework.kafka.support.converter.MessagingMessageConverter
fromMessage, getMessagingConverter, setGenerateMessageId, setGenerateTimestamp, setHeaderMapper, setMessagingConverter, setRawRecordHeader, toMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.kafka.support.converter.MessageConverter
commonHeaders
-
-
-
-
Method Detail
-
convertPayload
protected java.lang.Object convertPayload(org.springframework.messaging.Message<?> message)
Description copied from class:MessagingMessageConverter
Subclasses can convert the payload; by default, it's sent unchanged to Kafka.- Overrides:
convertPayload
in classJsonMessageConverter
- Parameters:
message
- the message.- Returns:
- the payload.
-
-