public class StringJsonMessageConverter extends MessagingMessageConverter
logger
Constructor and Description |
---|
StringJsonMessageConverter() |
StringJsonMessageConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
convertPayload(org.springframework.messaging.Message<?> message)
Subclasses can convert the payload; by default, it's sent unchanged to Kafka.
|
protected java.lang.Object |
extractAndConvertValue(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record,
java.lang.reflect.Type type)
Subclasses can convert the value; by default, it's returned as provided by Kafka.
|
Jackson2JavaTypeMapper |
getTypeMapper() |
protected org.apache.kafka.common.header.Headers |
initialRecordHeaders(org.springframework.messaging.Message<?> message)
Subclasses can populate additional headers before they are mapped.
|
void |
setTypeMapper(Jackson2JavaTypeMapper typeMapper)
Set a customized type mapper.
|
fromMessage, setGenerateMessageId, setGenerateTimestamp, setHeaderMapper, toMessage
public StringJsonMessageConverter()
public StringJsonMessageConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public Jackson2JavaTypeMapper getTypeMapper()
public void setTypeMapper(Jackson2JavaTypeMapper typeMapper)
typeMapper
- the type mapper.protected org.apache.kafka.common.header.Headers initialRecordHeaders(org.springframework.messaging.Message<?> message)
MessagingMessageConverter
initialRecordHeaders
in class MessagingMessageConverter
message
- the message.protected java.lang.Object convertPayload(org.springframework.messaging.Message<?> message)
MessagingMessageConverter
convertPayload
in class MessagingMessageConverter
message
- the message.protected java.lang.Object extractAndConvertValue(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record, java.lang.reflect.Type type)
MessagingMessageConverter
extractAndConvertValue
in class MessagingMessageConverter
record
- the record.type
- the required type.