Class StringJsonMessageConverter

  • All Implemented Interfaces:
    MessageConverter, RecordMessageConverter

    public class StringJsonMessageConverter
    extends JsonMessageConverter
    JSON Message converter - String on output, String, Bytes, or byte[] on input. Used in conjunction with Kafka StringSerializer/(StringDeserializer, BytesDeserializer, or ByteArrayDeserializer). Consider using the ByteArrayJsonMessageConverter instead to avoid unnecessary String->byte[] conversion.
    Author:
    Gary Russell, Artem Bilan, Dariusz Szablinski
    • Constructor Detail

      • StringJsonMessageConverter

        public StringJsonMessageConverter()
      • StringJsonMessageConverter

        public StringJsonMessageConverter​(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.