Spring Integration - 文件轮询器在SourcePollingChannelAdapter处停顿

时间:2014-05-22 14:19:27

标签: spring-integration

我有以下spring集成流程,它会轮询目录,传输然后处理文件。一切正常,直到我将$ {esg.inbound.folder}值从本地目录更改为网络目录。我的流程只是停止处理并显示下面的日志详细信息

<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"/>

我已将log4j设置为

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

并且我的日志中的输出是

[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 

流程似乎只是在SourcePollingChannelAdapter级别停止。我可能希望看到更清晰的异常消息,说新网络位置不可读或不可联系。我的问题是如何增加'入站通道适配器'周围的日志记录级别,以显示文件夹未被轮询的详细原因?

1 个答案:

答案 0 :(得分:1)

您应该在日志中看到每个固定延迟的轮询器活动。如果您没有看到任何内容,则必须在某处阻止该线程(可能在等待网络的操作系统中)。

进行线程转储(jstack或visualVM)以查看轮询器正在做什么。