我打算通过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 webservice,而是在调用网关时从文件夹中读取文件。
有什么建议吗?我尝试使用file:inbound-channel-adapter,但我被迫定义轮询器,因为我只想在调用网关时读取File。
发布于 2019-02-28 04:59:04
这应该和在要从service-activator调用的POJO方法中创建的new File()一样简单。
https://stackoverflow.com/questions/54913938
复制相似问题