List of usage examples for org.springframework.messaging MessageChannel getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.springframework.cloud.stream.binding.MessageConverterConfigurer.java
/** * Setup data-type and message converters for the given message channel. * * @param channel message channel to set the data-type and message converters * @param channelName the channel name// www . jav a 2 s. co m * @param inbound inbound (i.e., "input") or outbound channel */ private void configureMessageChannel(MessageChannel channel, String channelName, boolean inbound) { Assert.isAssignable(AbstractMessageChannel.class, channel.getClass()); AbstractMessageChannel messageChannel = (AbstractMessageChannel) channel; BindingProperties bindingProperties = this.bindingServiceProperties.getBindingProperties(channelName); String contentType = bindingProperties.getContentType(); ProducerProperties producerProperties = bindingProperties.getProducer(); if (!inbound && producerProperties != null && producerProperties.isPartitioned()) { messageChannel.addInterceptor(new PartitioningInterceptor(bindingProperties, getPartitionKeyExtractorStrategy(producerProperties), getPartitionSelectorStrategy(producerProperties))); } ConsumerProperties consumerProperties = bindingProperties.getConsumer(); if (this.isNativeEncodingNotSet(producerProperties, consumerProperties, inbound)) { if (inbound) { messageChannel.addInterceptor(new InboundContentTypeConvertingInterceptor(contentType, this.compositeMessageConverterFactory)); } else { messageChannel.addInterceptor(new OutboundContentTypeConvertingInterceptor(contentType, this.compositeMessageConverterFactory.getMessageConverterForAllRegistered())); } } }