1
votes

I would like process the message programmatically using message-driven-channel-adapter. Here is scenario which I have to implement: My application during the startup read the configuration from a service. The configuration provides information about the queues which will contain the messages. Hence I would like to create a message-driven-channel-adapter for each queue to listen to messages asynchronously.

Any example which initializes all the spring integration context programatically instead of using XML will be useful.

1

1 Answers

0
votes

If you are going to do everything programmatically, I'd suggest you bypass Spring Integration magic and just use DefaultMessageListenerContainer directly.

Afterwards you can send messages to an existing MessageChannel directly from the MessageListener implementation or using Messaging Gateway.

Please, be careful with programmatic configuration with that do not miss important attributes like ApplicationContext or invocation for afterPropertiesSet().