首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spring-Integration:如何通过网关触发文件读取

Spring-Integration:如何通过网关触发文件读取
EN

Stack Overflow用户
提问于 2019-02-28 04:27:17
回答 1查看 107关注 0票数 0

我打算通过spring集成实现使用REST服务,我有以下代码。

代码语言:javascript
复制
    <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 webservice,而是在调用网关时从文件夹中读取文件。

有什么建议吗?我尝试使用file:inbound-channel-adapter,但我被迫定义轮询器,因为我只想在调用网关时读取File。

EN

回答 1

Stack Overflow用户

发布于 2019-02-28 04:59:04

这应该和在要从service-activator调用的POJO方法中创建的new File()一样简单。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54913938

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档