Java 使用zookeper服务器的群集环境中的FTP入站适配器

Java 使用zookeper服务器的群集环境中的FTP入站适配器,java,ftp,spring-integration,apache-zookeeper,Java,Ftp,Spring Integration,Apache Zookeeper,我有一个FTP入站适配器,它将部署在tomcat的多个实例上。问题是,所有实例都将从远程目录中提取文件,但我需要一个文件只提取一次,而不是由所有实例提取。因此,我使用Zookeeper元数据存储,但它在启动时给了我错误 错误 我的问题现在已经解决了。将ftpperAssistanceAcceptonFileListFilter的constructor参数从foo/bar/更改为下面提到的空字符串代码后,问题得到了解决 <beans:bean class="org.springframewo

我有一个FTP入站适配器,它将部署在tomcat的多个实例上。问题是,所有实例都将从远程目录中提取文件,但我需要一个文件只提取一次,而不是由所有实例提取。因此,我使用Zookeeper元数据存储,但它在启动时给了我错误

错误


我的问题现在已经解决了。将ftpperAssistanceAcceptonFileListFilter的constructor参数从foo/bar/更改为下面提到的空字符串代码后,问题得到了解决

<beans:bean class="org.springframework.integration.ftp.filters.FtpPersistentAcceptOnceFileListFilter">
                    <beans:constructor-arg name="store" ref="metadataStore"/>
                    <beans:constructor-arg value=""/>
</beans:bean>

我的问题现在得到了解决。将ftppersistentAcceptonFileListFilter的constructor参数从foo/bar/更改为下面提到的空字符串代码后,问题得到了解决

<beans:bean class="org.springframework.integration.ftp.filters.FtpPersistentAcceptOnceFileListFilter">
                    <beans:constructor-arg name="store" ref="metadataStore"/>
                    <beans:constructor-arg value=""/>
</beans:bean>


您只需要
spring集成zookeeper
就可以了。但无论如何,堆栈跟踪与配置无关。堆栈跟踪是否包含目标
@Configuration
中的问题在哪里的信息?通过将POM条目更改为spring integration zookeeper,我的问题已得到解决,感谢Artem BilanI有一个查询我现在应该向CuratorFrameworkFactoryBean传递什么值我正在传递下面的zookeeper端口是代码。但是,在zookeeper元数据存储中添加值时,它给出了error.keeperrorcode=NoNode for/SpringIntegration元数据存储/foo/bar/20160626S001\u 20160626.xml编辑有问题老实说,我不喜欢你的
“0.0.0.0
IP。如何放置ZK节点的真实IP地址?当传递我机器的IP地址时,因为我在本地机器上运行ZK服务器,所以它也会给出相同的错误。您只需要
spring integration zookeer
。但无论如何,堆栈跟踪与配置无关。堆栈跟踪是否包含目标
@Configuration
中的问题在哪里的信息?通过将POM条目更改为spring integration zookeeper,我的问题已得到解决,感谢Artem BilanI有一个查询我现在应该向CuratorFrameworkFactoryBean传递什么值我正在传递下面的zookeeper端口是代码。但是,在zookeeper元数据存储中添加值时,它给出了error.keeperrorcode=NoNode for/SpringIntegration元数据存储/foo/bar/20160626S001\u 20160626.xml编辑有问题老实说,我不喜欢你的
“0.0.0.0
IP。如何放置ZK节点的真实IP地址?当传递我的机器的IP地址时,因为我在本地机器上运行ZK服务器,那么它也会给出相同的错误。
2016-09-06 12:53:38.072 ERROR 11456 --- [ask-scheduler-2] o.s.integration.handler.LoggingHandler   : org.springframework.messaging.MessagingException: Problem occurred while synchronizing remote to local directory; nested exception is org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStoreException: Error while trying to set 'foo/bar/20160626S001_20160626.xml':
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:266)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:193)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:59)
    at org.springframework.integration.endpoint.AbstractMessageSource.receive(AbstractMessageSource.java:134)
    at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:175)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:224)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:57)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:176)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:173)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:330)
    at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
    at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:51)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:324)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStoreException: Error while trying to set 'foo/bar/20160626S001_20160626.xml':
    at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:419)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:223)
    ... 22 more
Caused by: org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStoreException: Error while trying to set 'foo/bar/20160626S001_20160626.xml':
    at org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStore.putIfAbsent(ZookeeperMetadataStore.java:132)
    at org.springframework.integration.file.filters.AbstractPersistentAcceptOnceFileListFilter.accept(AbstractPersistentAcceptOnceFileListFilter.java:77)
    at org.springframework.integration.file.filters.AbstractFileListFilter.filterFiles(AbstractFileListFilter.java:40)
    at org.springframework.integration.file.filters.CompositeFileListFilter.filterFiles(CompositeFileListFilter.java:108)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.filterFiles(AbstractInboundFileSynchronizer.java:206)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:230)
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:223)
    at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:410)
    ... 23 more
Caused by: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /SpringIntegration-MetadataStore/foo/bar/20160626S001_20160626.xml
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:111)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
    at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:696)
    at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:679)
    at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:107)
    at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:676)
    at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:453)
    at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:443)
    at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
    at org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStore.createNode(ZookeeperMetadataStore.java:256)
    at org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStore.putIfAbsent(ZookeeperMetadataStore.java:118)
    ... 30 more
<beans:bean class="org.springframework.integration.ftp.filters.FtpPersistentAcceptOnceFileListFilter">
                    <beans:constructor-arg name="store" ref="metadataStore"/>
                    <beans:constructor-arg value=""/>
</beans:bean>