Work is currently under way to make this easier using Scala and Groovy DSLs; we also hope to make it easier using Java too.
In the meantime, the easiest way to determine what is needed to do this programmatically would be to look at FeedInboundChannelAdapterParser and it's super class AbstractPollingInboundChannelAdapterParser.
Essentially, you need a SourcePollingChannelAdapterFactoryBean, a PollerMetaData, a FeedEntryMessageSource and a reference to a channel.
Or, you can use the technique used in this sample ...
... to dynamically create a parameterized flow snippet at run time. For the inbound case, you'd have to make the snippet's context a child of the main context, so you can reference a channel in the main context. When creating the snippet context, set the parent context in the constructor.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware