Search in sources :

Example 1 with DefaultPollableMessageSource

use of org.springframework.cloud.stream.binder.DefaultPollableMessageSource in project spring-cloud-stream by spring-cloud.

the class MessageConverterConfigurer method configurePolledMessageSource.

@Override
public void configurePolledMessageSource(PollableMessageSource binding, String name) {
    BindingProperties bindingProperties = this.bindingServiceProperties.getBindingProperties(name);
    String contentType = bindingProperties.getContentType();
    ConsumerProperties consumerProperties = bindingProperties.getConsumer();
    if ((consumerProperties == null || !consumerProperties.isUseNativeDecoding()) && binding instanceof DefaultPollableMessageSource) {
        ((DefaultPollableMessageSource) binding).addInterceptor(new InboundContentTypeEnhancingInterceptor(contentType));
    }
}
Also used : BindingProperties(org.springframework.cloud.stream.config.BindingProperties) ConsumerProperties(org.springframework.cloud.stream.binder.ConsumerProperties) DefaultPollableMessageSource(org.springframework.cloud.stream.binder.DefaultPollableMessageSource)

Example 2 with DefaultPollableMessageSource

use of org.springframework.cloud.stream.binder.DefaultPollableMessageSource in project spring-cloud-stream by spring-cloud.

the class MessageSourceBindingTargetFactory method createInput.

@Override
public PollableMessageSource createInput(String name) {
    DefaultPollableMessageSource binding = new DefaultPollableMessageSource(this.messageConverter);
    this.messageSourceConfigurer.configurePolledMessageSource(binding, name);
    return binding;
}
Also used : DefaultPollableMessageSource(org.springframework.cloud.stream.binder.DefaultPollableMessageSource)

Aggregations

DefaultPollableMessageSource (org.springframework.cloud.stream.binder.DefaultPollableMessageSource)2 ConsumerProperties (org.springframework.cloud.stream.binder.ConsumerProperties)1 BindingProperties (org.springframework.cloud.stream.config.BindingProperties)1