org.springframework.cloud.stream.config.ProducerMessageHandlerCustomizer Java Examples
The following examples show how to use
org.springframework.cloud.stream.config.ProducerMessageHandlerCustomizer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RabbitMessageChannelBinderConfiguration.java From spring-cloud-stream-binder-rabbit with Apache License 2.0 | 6 votes |
@Bean RabbitMessageChannelBinder rabbitMessageChannelBinder( @Nullable ListenerContainerCustomizer<AbstractMessageListenerContainer> listenerContainerCustomizer, @Nullable MessageSourceCustomizer<AmqpMessageSource> sourceCustomizer, @Nullable ProducerMessageHandlerCustomizer<AmqpOutboundEndpoint> producerMessageHandlerCustomizer, @Nullable ConsumerEndpointCustomizer<AmqpInboundChannelAdapter> consumerCustomizer, List<DeclarableCustomizer> declarableCustomizers) { RabbitMessageChannelBinder binder = new RabbitMessageChannelBinder( this.rabbitConnectionFactory, this.rabbitProperties, provisioningProvider(declarableCustomizers), listenerContainerCustomizer, sourceCustomizer); binder.setAdminAddresses( this.rabbitBinderConfigurationProperties.getAdminAddresses()); binder.setCompressingPostProcessor(gZipPostProcessor()); binder.setDecompressingPostProcessor(deCompressingPostProcessor()); binder.setNodes(this.rabbitBinderConfigurationProperties.getNodes()); binder.setExtendedBindingProperties(this.rabbitExtendedBindingProperties); binder.setProducerMessageHandlerCustomizer(producerMessageHandlerCustomizer); binder.setConsumerEndpointCustomizer(consumerCustomizer); return binder; }
Example #2
Source File: AbstractMessageChannelBinder.java From spring-cloud-stream with Apache License 2.0 | 5 votes |
/** * Configure an optional {@link ProducerMessageHandlerCustomizer} for further * configuration of producer {@link MessageHandler} instances created by the binder. * @param handlerCustomizer the {@link ProducerMessageHandlerCustomizer} to use. * @since 3.0 */ @SuppressWarnings("unchecked") public void setProducerMessageHandlerCustomizer( @Nullable ProducerMessageHandlerCustomizer<? extends MessageHandler> handlerCustomizer) { this.handlerCustomizer = handlerCustomizer == null ? (handler, destination) -> { } : (ProducerMessageHandlerCustomizer<MessageHandler>) handlerCustomizer; }
Example #3
Source File: KinesisBinderProcessorTests.java From spring-cloud-stream-binder-aws-kinesis with Apache License 2.0 | 4 votes |
@Bean public ProducerMessageHandlerCustomizer<KinesisMessageHandler> kinesisMessageHandlerCustomizer() { return (handler, destinationName) -> handler.setAsyncHandler(asyncHandler()); }
Example #4
Source File: KafkaBinderActuatorTests.java From spring-cloud-stream-binder-kafka with Apache License 2.0 | 4 votes |
@Bean public ProducerMessageHandlerCustomizer<KafkaProducerMessageHandler<?, ?>> handlerCustomizer() { return (handler, destinationName) -> handler.setBeanName("setByCustomizer:" + destinationName); }
Example #5
Source File: RabbitBinderModuleTests.java From spring-cloud-stream-binder-rabbit with Apache License 2.0 | 4 votes |
@Bean public ProducerMessageHandlerCustomizer<AmqpOutboundEndpoint> messageHandlerCustomizer() { return (handler, destinationName) -> handler.setBeanName("setByCustomizer:" + destinationName); }