emeraldjava
emeraldjava

Reputation: 11190

Spring Integration - file poller stalls at SourcePollingChannelAdapter

I have the following spring integration flow, which polls a directory, transfer and then processes a file. Everything is working fine until i change the ${esg.inbound.folder} value from a local directory to a network directory. My flow just stops processing and shows the log details below

<file:inbound-channel-adapter directory="${esg.inbound.folder}" channel="esgCopyFileChannel"  filter="esgFileReadyListFilter">
    <int:poller error-channel="esgLogFileChannel" fixed-delay="${esg.file.poller.fixed-delay}" max-messages-per-poll="${esg.file.poller.max-messages-per-poll}"/>
</file:inbound-channel-adapter>
<!-- copy to the sql server directory -->
<file:outbound-gateway id="filesOut" request-channel="esgCopyFileChannel" reply-channel="esgProcessFileChannel" directory="${esg.processing.folder}" delete-source-files="true"/>
<!-- process the file -->
<int:service-activator input-channel="esgProcessFileChannel" ref="esgProcessManager" method="processEsgFile" output-channel="esgLogFileChannel"/>
<int:logging-channel-adapter id="loggingChannelAdapter" channel="esgLogFileChannel" level="DEBUG"/>

I have set my log4j setting to

<logger name="org.springframework.integration">
    <level value="DEBUG"/>
</logger>

and the output in my log is

[2014-May-22 14:41:18] INFO  DirectChannel: Channel 'esgCopyFileChannel' has 1 subscriber(s). 
[2014-May-22 14:41:18] INFO  EventDrivenConsumer: started filesOut 
[2014-May-22 14:41:18] INFO  EventDrivenConsumer: Adding {service-activator} as a subscriber to the 'esgProcessFileChannel' channel 
[2014-May-22 14:41:18] INFO  DirectChannel: Channel 'esgProcessFileChannel' has 1 subscriber(s). 
[2014-May-22 14:41:18] INFO  EventDrivenConsumer: started org.springframework.integration.config.ConsumerEndpointFactoryBean#1 
[2014-May-22 14:41:18] INFO  EventDrivenConsumer: Adding {logging-channel-adapter:loggingChannelAdapter} as a subscriber to the 'esgLogFileChannel' channel 
[2014-May-22 14:41:18] INFO  DirectChannel: Channel 'esgLogFileChannel' has 1 subscriber(s). 
[2014-May-22 14:41:18] INFO  EventDrivenConsumer: started loggingChannelAdapter 
[2014-May-22 14:41:18] INFO  EventDrivenConsumer: Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel 
[2014-May-22 14:41:18] INFO  PublishSubscribeChannel: Channel 'errorChannel' has 1 subscriber(s). 
[2014-May-22 14:41:18] INFO  EventDrivenConsumer: started _org.springframework.integration.errorLogger 
[2014-May-22 14:41:18] INFO  SourcePollingChannelAdapter: started org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean#0 

the flow seems to just stall at the SourcePollingChannelAdapter level. I might expect to see a more clear exception message saying the new network location is un-readable or non-contactable. My question is how can i increase the logging level around the 'inbound-channel-adapter' to show the detailed reason why the folder is not being polled?

Upvotes: 0

Views: 654

Answers (1)

Gary Russell
Gary Russell

Reputation: 174494

You should see poller activity in the log each fixed delay. If you are not seeing anything, the thread must be blocked somewhere (maybe in the OS waiting for network).

Take a thread dump (jstack or visualVM) to see what the poller is doing.

Upvotes: 1

Related Questions