【问题标题】:Spring-Integration: How to trigger file reading via GatewaySpring-Integration:如何通过网关触发文件读取
【发布时间】:2019-02-27 20:27:17
【问题描述】:

我将通过 Spring 集成实现使用 REST 服务,并且我有以下代码。

    <int:gateway id="myGateway" service-interface="org.moonshiner.MyGateway"/>

<int:channel id="myInputChannel"/>

<int:chain input-channel="myInputChannel">
    <int-http:outbound-gateway
            url="${url}"
            http-method="GET"
            rest-template="oAuth2RestTemplate"
            expected-response-type="java.lang.String">
    </int-http:outbound-gateway>
    <int:transformer ref="myTransformer"/>
</int:chain>

一切正常,但我想做同样的实现,但我不想使用 REST web 服务,而是想在调用网关时从文件夹中读取文件。

有什么建议吗?我尝试使用 file:inbound-channel-adapter,但我不得不定义 poller,我不想这样做,因为我只想在调用网关时读取文件。

【问题讨论】:

    标签: java spring spring-integration


    【解决方案1】:

    这应该像在一些 POJO 方法中创建的 new File() 一样简单,以便从 service-activator 调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-05
      • 2015-03-26
      • 1970-01-01
      • 2014-11-14
      • 1970-01-01
      • 2020-10-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多