Results 1 to 3 of 3

Thread: Create feed inbound channel adapters at runtime?

  1. #1
    Join Date
    Jun 2012
    Posts
    2

    Default Create feed inbound channel adapters at runtime?

    Greetings,

    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.

    Cheers,
    Bernhard

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    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 ...

    https://github.com/SpringSource/spri...ed/dynamic-ftp

    ... 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.

    See http://forum.springsource.org/showth...840#post413840
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Jun 2012
    Posts
    2

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •