Results 1 to 9 of 9

Thread: integration feed - startup

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Location
    Minneapolis, MN
    Posts
    137

    Question integration feed - startup

    Hello,

    This might have been asked before but didnt find any reference. I have a feed integration which needs to start polling after my application context finishes loading. Is there a way to start this polling after the application start up ? i know i could increase the poller time a bit but looking for other options

    Thanks
    srinivas

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Are you talking about feed as RSS/ATOM feed?

  3. #3
    Join Date
    Oct 2009
    Location
    Minneapolis, MN
    Posts
    137

    Default

    yes feed:inbound-channel-adapter

    This fires up before my application server is fully up. Probably this is the case for all inbound-channel-adapter's as well, but think it will be nice to delay the polling until the Application context is fully started/ loaded and your web application is up and running.

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Yeah, its simple. Set auto-startup to 'false'
    Code:
    <int-feed:inbound-channel-adapter id="feedAdapter" 
    			channel="feedChannel" 
    			auto-startup="false" 
    			url="http://rss.cnn.com/rss/cnn_topstories.rss">
    	<int:poller fixed-rate="10000" max-messages-per-poll="100" />
    </int-feed:inbound-channel-adapter>
    And then the code you can do this:
    Code:
    SourcePollingChannelAdapter spca = ac.getBean("feedAdapter", SourcePollingChannelAdapter.class);
    spca.start();

  5. #5
    Join Date
    Oct 2009
    Location
    Minneapolis, MN
    Posts
    137

    Default

    Have seen the auto-startup flag i can turn off i understand. The concern is somewhere i need to write the code to manually start this channel back maybe via custom context listener, so im wondering if springs application context can do it for me? instead after it finishes loading.

    trying to avoid to manually invoke and achieve the same via another parameter or configuration?

    Thanks

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    I guess I am not following. start method is executed right before AC is returned to you. It is the last step in the lifecycle, so I am not sure what you mean when you say it is started before AC is loaded. Can you elaborate?

Posting Permissions

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