Class MessageConverterConfigurer

java.lang.Object
org.springframework.cloud.stream.binding.MessageConverterConfigurer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, MessageChannelAndSourceConfigurer, MessageChannelConfigurer

public class MessageConverterConfigurer extends Object implements MessageChannelAndSourceConfigurer, org.springframework.beans.factory.BeanFactoryAware
A MessageChannelConfigurer that sets data types and message converters based on BindingProperties.contentType. Also adds a ChannelInterceptor to the message channel to set the `ContentType` header for the message (if not already set) based on the `ContentType` binding property of the channel.
Author:
Ilayaperumal Gopinathan, Marius Bogoevici, Maxim Kirilov, Gary Russell, Soby Chacko, Oleg Zhurakousky
  • Constructor Details

    • MessageConverterConfigurer

      public MessageConverterConfigurer(BindingServiceProperties bindingServiceProperties, org.springframework.messaging.converter.CompositeMessageConverter compositeMessageConverter, StreamFunctionProperties streamFunctionProperties)
    • MessageConverterConfigurer

      public MessageConverterConfigurer(BindingServiceProperties bindingServiceProperties, org.springframework.messaging.converter.CompositeMessageConverter compositeMessageConverter)
  • Method Details

    • setBeanFactory

      public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Throws:
      org.springframework.beans.BeansException
    • configureInputChannel

      public void configureInputChannel(org.springframework.messaging.MessageChannel messageChannel, String channelName)
      Description copied from interface: MessageChannelConfigurer
      Configure the given input message channel.
      Specified by:
      configureInputChannel in interface MessageChannelConfigurer
      Parameters:
      messageChannel - the message channel
      channelName - name of the message channel
    • configureOutputChannel

      public void configureOutputChannel(org.springframework.messaging.MessageChannel messageChannel, String channelName)
      Description copied from interface: MessageChannelConfigurer
      Configure the given output message channel.
      Specified by:
      configureOutputChannel in interface MessageChannelConfigurer
      Parameters:
      messageChannel - the message channel
      channelName - name of the message channel
    • configurePolledMessageSource

      public void configurePolledMessageSource(PollableMessageSource binding, String name)
      Description copied from interface: MessageChannelAndSourceConfigurer
      Configure the provided message source binding.
      Specified by:
      configurePolledMessageSource in interface MessageChannelAndSourceConfigurer
      Parameters:
      binding - the binding.
      name - the name.