I've an XML config for mail service in spring, that I'd like to transform to JAVA config.
XML Looks like this
<int:chain id="chain"
input-channel="outMailError"
output-channel="outMailEntry">
<int:poller max-messages-per-poll="1" fixed-rate="20000" />
<int:transformer ref="mailSendErrorTransformer" />
</int:chain>
<int:channel id="outMailError">
<int:queue capacity="500" />
</int:channel>
<int:channel id="outboundMailEntry" />
I was able to convert the channels to
@Bean
public DirectChannel outboundMailEntry() {
return new DirectChannel();
}
@Bean
public QueueChannel outboundMailErrorChannel() {
return new QueueChannel(500);
}
But I don't know how to the same for int:chain. I was able to debug and find out what type of bean does spring instantiate for "chain" part of xml - it is PollingConsumer that takes 2 params PollableChannel inputChannel, MessageHandler handler.
The first one is not a problem since I already have that, it is the
@Qualifier("outMailError")
QueueChannel channel
But I do not know about the second one... Spring itself initializes some MessageHandlerChain but I was unable to to set the outMailEntry to it and also dont know about the poller and transformer.. any ídeas?