Announcement Announcement Module
No announcement yet.
Create feed inbound channel adapters at runtime? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Create feed inbound channel adapters at runtime?


    This is a newbie question: I have several RSS feeds I want to integrate. The problem is that the URLs of those feeds are only known at runtime, so I cannot use a static XML configuration for the inbound channel adapters. As far as I understand it, I need to instantiate a SourcePollingChannelAdapter (tied to a FeedEntryMessageSource with the right URL, and a channel, which would be a QueueChannel in my case) for each RSS feed. I was unable to find any example of how to accomplish this at runtime. Any help is appreciated.


  • #2
    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.



    • #3
      Thanks Gary, I'll have a look at those.