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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
Partitioning channel interceptor. -
Constructor Summary
ConstructorsConstructorDescriptionMessageConverterConfigurer
(BindingServiceProperties bindingServiceProperties, org.springframework.messaging.converter.CompositeMessageConverter compositeMessageConverter) MessageConverterConfigurer
(BindingServiceProperties bindingServiceProperties, org.springframework.messaging.converter.CompositeMessageConverter compositeMessageConverter, StreamFunctionProperties streamFunctionProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
configureInputChannel
(org.springframework.messaging.MessageChannel messageChannel, String channelName) Configure the given input message channel.void
configureOutputChannel
(org.springframework.messaging.MessageChannel messageChannel, String channelName) Configure the given output message channel.void
configurePolledMessageSource
(PollableMessageSource binding, String name) Configure the provided message source binding.void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory)
-
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 interfaceorg.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 interfaceMessageChannelConfigurer
- Parameters:
messageChannel
- the message channelchannelName
- 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 interfaceMessageChannelConfigurer
- Parameters:
messageChannel
- the message channelchannelName
- name of the message channel
-
configurePolledMessageSource
Description copied from interface:MessageChannelAndSourceConfigurer
Configure the provided message source binding.- Specified by:
configurePolledMessageSource
in interfaceMessageChannelAndSourceConfigurer
- Parameters:
binding
- the binding.name
- the name.
-