简体   繁体   中英

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. 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?

I only found http outbound example.

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM