Announcement Announcement Module
Collapse
No announcement yet.
How do you know when a file poller fails? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do you know when a file poller fails?

    If I setup a File poller such as the following example:

    Code:
    <file:inbound-channel-adapter id="fileInput" directory="${folder.location}">
    	  <int:poller>
          <int:interval-trigger interval="${poll.interval}"/>
        </int:poller>
      </file:inbound-channel-adapter>
    Is there anything built into Spring Integration which I can leverage for the unusual case that the file poller may stop actually polling?

    Basically I need to be able to issue an email or submit a ticket to an internal ticketing system in case the file poller fails. However being new to Spring Integration I have no idea if there is already a solution for this?

    Any suggestions would be most appreciated!

  • #2
    You can configure an error-channel on the poller. Every failure of the poller will result in the ErrorMessage sent to the specified error-channel. If error-channel is not explicitly specified, then the ErrorMessage will still be generated and will go to the default error-channel named 'errorChannel' which is always created by the framework unless explicitly created by the user.
    So, even now you can add a subscriber to the error-channel to catch all errors coming form the poller.

    Although I'd still recommend an explicit error channel
    [CODE]
    <intoller . . . . error-channel="myErrorChannel"/>

    <int:channel id="myErrorChannel"/>

    <int:service-activator input-channel="myErrorChannel". . ./>
    [CODE]

    Comment


    • #3
      Hi there, thank you for your response!

      Ok that sounds good but - and this may be a stupid question- but what if the thread that the poller is running in just inexplicitly quits working? It doesnt actually throw an error, it just dies out or gets stuck on something forever. Is there some built in monitoring to Spring integration that would catch this situation, and use that error channel to send the message?

      Comment


      • #4
        Well, aside from JVM crashes, threads don't usually just die with no reason. Its the tasks executed by threads are the usual cause of the problems (e.g., deadlocks, exceptions etc.) and thread pool configurations. Exceptions are going to be caught by the error-channel and as far as deadlocks, I would suggest various thread monitoring tools.

        Comment

        Working...
        X