Class BytesJsonMessageConverter

  • All Implemented Interfaces:
    MessageConverter, RecordMessageConverter

    public class BytesJsonMessageConverter
    extends JsonMessageConverter
    JSON Message converter - Bytes on output, String, Bytes, or byte[] on input. Used in conjunction with Kafka BytesSerializer/(BytesDeserializer, ByteArrayDeserializer, or StringDeserializer). More efficient than StringJsonMessageConverter because the String<->byte[] conversion is avoided.
    Since:
    2.1.7
    Author:
    Gary Russell
    • Constructor Detail

      • BytesJsonMessageConverter

        public BytesJsonMessageConverter()
      • BytesJsonMessageConverter

        public BytesJsonMessageConverter​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • 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 class JsonMessageConverter
        Parameters:
        message - the message.
        Returns:
        the payload.