Announcement Announcement Module
Collapse
No announcement yet.
integration feed - startup Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Are you talking about feed as RSS/ATOM feed?

    Comment


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

      Comment


      • #4
        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();

        Comment


        • #5
          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

          Comment


          • #6
            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?

            Comment


            • #7
              Maybe peculiar case,

              I have a RSS feed being published in the same webapp where my integration is also running so the feed inbound channel adaptor is configured to this same url. Because i'm just starting my tomcat server the webapp URL is not accessible immediately during start up but the channel is started before my webapp is ready and throws Null pointers,


              Does this help ?

              Comment


              • #8
                Are they both in the same context or do you have a root context (via ContextLoaderListener) and a separate servlet-context (via DispatcherServlet)?

                Comment


                • #9
                  Both are loaded in the same application context (im assuming) , the publisher is simple @controller serving rss feed and i have the integration file imported in the same applicationcontext.
                  There is only one context if im not missing something.

                  Comment

                  Working...
                  X