Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring integration Spring集成元数据存储_Spring Integration - Fatal编程技术网

Spring integration Spring集成元数据存储

Spring integration Spring集成元数据存储,spring-integration,Spring Integration,我已经在我的spring boot+spring集成应用程序中添加了一个名为metadataStore的bean,并期望ftp同步即使在服务器重新启动后也能保持不变。 尽管如此,我的早期测试表明情况并非如此;如果我启动服务器,让它拾取并处理3个测试文件,然后重新启动服务器,那么同样的3个文件将被再次拾取并处理,就好像根本没有定义持久性元数据存储一样 我想知道在设置数据存储时是否缺少一些配置细节 @Configuration public class MetadataStoreConfigurat

我已经在我的spring boot+spring集成应用程序中添加了一个名为metadataStore的bean,并期望ftp同步即使在服务器重新启动后也能保持不变。 尽管如此,我的早期测试表明情况并非如此;如果我启动服务器,让它拾取并处理3个测试文件,然后重新启动服务器,那么同样的3个文件将被再次拾取并处理,就好像根本没有定义持久性元数据存储一样

我想知道在设置数据存储时是否缺少一些配置细节

@Configuration
public class MetadataStoreConfiguration {

    @Bean
    public PropertiesPersistingMetadataStore metadataStore() {
        PropertiesPersistingMetadataStore metadataStore = new PropertiesPersistingMetadataStore();
        return metadataStore;
    }
}
另外,我在spring集成参考手册中看到了一个关于如何设置幂等接收器和元数据存储的简短示例。这就是我的实现所缺少的吗

如果是这样,如果我必须像示例中那样进行设置,我将在哪里定义metadataStore.get和metadataStore.put调用?我正在使用的出站适配器没有为我提供表达式属性。。。以下是我天真而不完整的尝试:

<int-file:inbound-channel-adapter id="inboundLogFile"
                                  auto-create-directory="true"
                                  directory="${sftp.local.dir}"
                                  channel="fileInboundChannel"
                                  prevent-duplicates="true">
    <int:poller fixed-rate="${setup.inbound.poller.rate}"/>
</int-file:inbound-channel-adapter>


<int:filter id="fileFilter" input-channel="fileInboundChannel"
                output-channel="idempotentServiceChannel"
                discard-channel="fileDiscardChannel"
                expression="@metadataStore.get(payload.name) == null"/>

这是示例中使用的出站适配器:

<int:outbound-channel-adapter channel="idempotentServiceChannel" expression="@metadataStore.put(payload.name, '')"/>

在我的ftp出站适配器中,无法插入上述表达式:(


默认情况下,
属性PersistingMetadatastore
仅在正常应用程序关闭时保持该状态;在此之前,它一直保存在内存中

在4.1.2中,我们将其更改为实现
Flushable
,以便用户可以随时刷新状态

考虑在入站适配器上的
本地筛选器中使用
FileSystemTempersistentAcceptOnceFileListFilter
,而不是单独的筛选器元素。有关详细信息,请参阅

从版本
4.1.5开始
this到
flush()
每次更新时的元数据存储


使用外部服务器的其他元数据存储(Redis、Mongo、Gemfire)不需要刷新。

我不确定如何继续使用此方法,因此我尝试使用此方法,但仍然没有成功,在测试该方法时,我在我的临时文件夹中看到metadata-store.properties,但它保持为空。不应该有一些关于我处理的文件的持久化信息吗?无论如何,我将创建一个新问题f我无法追根究底:)
<int-ftp:outbound-channel-adapter id="sdkOutboundFtp"
                                      channel="idempotentServiceChannel"
                                      session-factory="ftpsCachingSessionFactory"
                                      charset="UTF-8"
                                      auto-create-directory="true"
                                      use-temporary-file-name="false"
                                      remote-file-separator="/"
                                      remote-directory-expression="${egnyte.remote.dir}"
                                      * NO EXPRESSION POSSIBLE HERE *
                                      mode="REPLACE">
    </int-ftp:outbound-channel-adapter>