[英]Using Spring Integration HttpInbound example
I am trying to use Spring-integration inside Spring-boot app in order to download HTTP file and save it to disk. 我正在尝试在Spring-boot应用程序内部使用Spring-integration,以便下载HTTP文件并将其保存到磁盘。 I couldnt find any example of doing so.
我找不到这样做的任何例子。 looking at the docs I found this:
查看我发现的文档:
<bean id="httpInbound"
class="org.springframework.integration.http.inbound.HttpRequestHandlingController">
<constructor-arg value="true" /> <!-- indicates that a reply is expected -->
<property name="requestChannel" ref="httpRequestChannel" />
<property name="replyChannel" ref="httpReplyChannel" />
<property name="viewName" value="jsonView" />
<property name="supportedMethodNames" >
<list>
<value>GET</value>
<value>DELETE</value>
</list>
</property>
</bean>
Still not sure how to connect all the dots. 仍然不确定如何连接所有点。 How dynamically I am sending the URL path?
我如何动态发送URL路径?
I only found http outbound example. 我只找到http出站示例。
The scenario is pretty simple. 场景非常简单。 just send via channel a file path to download and thats it
只是通过通道发送文件路径进行下载,就这样
Any practical example? 有实际的例子吗? thank you.
谢谢。
This sample should help you: https://github.com/artembilan/si-http-download-excel-sample . 该示例应为您提供帮助: https : //github.com/artembilan/si-http-download-excel-sample 。
Yes, it is without Boot, but there is no difference: just add Boot Plugin to the Gradle with spring-boot-starter-web
and your app will be web-app with embedded Tomcat. 是的,它没有Boot,但没有区别:只需使用
spring-boot-starter-web
将Boot Plugin添加到Gradle中,您的应用程序将是具有嵌入式Tomcat的Web应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.