final Producer<Integer, byte[]> producer = new Producer<Integer, byte[]>(producerConfig);
final ProducerConfiguration<Integer, byte[]> producerConfiguration = new ProducerConfiguration<Integer, byte[]>(
producerMetadata, producer);
MessageHandler messageHandler = new AbstractMessageHandler() {
@Override
protected void handleMessageInternal(Message<?> message) throws Exception {
producerConfiguration.send(message);
}
};
Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel);
MessageHandler handler = new SendingHandler(messageHandler, topicName, accessor);
EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler);
consumer.setBeanFactory(this.getBeanFactory());
consumer.setBeanName("outbound." + name);
consumer.afterPropertiesSet();
Binding producerBinding = Binding.forProducer(name, moduleOutputChannel, consumer, accessor);