You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/reference/asciidoc/http.adoc
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,14 @@ The HTTP support allows for the execution of HTTP requests and the processing of
8
8
Because interaction over HTTP is always synchronous, even if all that is returned is a 200 status code, the HTTP support consists of two gateway implementations: `HttpInboundEndpoint` and `HttpRequestExecutingMessageHandler`.
9
9
10
10
[[http-inbound]]
11
-
=== Http Inbound Gateway
11
+
=== Http Inbound Components
12
12
13
13
To receive messages over HTTP, you need to use an _HTTP Inbound
14
14
Channel Adapter_ or _Gateway_.
15
15
To support the _HTTP Inbound Adapters_, they need to be deployed within a servlet container such as http://tomcat.apache.org/[Apache Tomcat] or http://www.eclipse.org/jetty/[Jetty].
16
-
The easiest way to do this is to use Spring's http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/context/support/HttpRequestHandlerServlet.html[HttpRequestHandlerServlet], by providing the following servlet definition in the _web.xml_ file:
by providing the following servlet definition in the _web.xml_ file:
17
19
18
20
[source,xml]
19
21
----
@@ -24,14 +26,17 @@ The easiest way to do this is to use Spring's http://static.springsource.org/spr
24
26
----
25
27
26
28
Notice that the servlet name matches the bean name.
27
-
For more information on using the `HttpRequestHandlerServlet`, see chapter "http://static.springsource.org/spring/docs/current/spring-framework-reference/html/remoting.html[Remoting and web services using Spring]", which is part of the Spring Framework Reference documentation.
29
+
For more information on using the `HttpRequestHandlerServlet`, see chapter
30
+
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/remoting.html[Remoting and web services using Spring],
31
+
which is part of the Spring Framework Reference documentation.
28
32
29
33
If you are running within a Spring MVC application, then the aforementioned explicit servlet definition is not necessary.
30
34
In that case, the bean name for your gateway can be matched against the URL path just like a Spring MVC Controller bean.
31
-
For more information, please see the chapter "http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html[Web MVC framework]", which is part of the Spring Framework Reference documentation.
35
+
For more information, please see the chapter
36
+
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html[Web MVC framework], which is part of the Spring Framework Reference documentation.
32
37
33
-
TIP: For a sample application and the corresponding configuration, please see the https://github.com/SpringSource/spring-integration-samples[Spring Integration Samples] repository.
34
-
It contains the https://github.com/SpringSource/spring-integration-samples/tree/master/basic/http[Http Sample] application demonstrating Spring Integration's HTTP support.
38
+
TIP: For a sample application and the corresponding configuration, please see the https://github.com/spring-projects/spring-integration-samples[Spring Integration Samples] repository.
39
+
It contains the https://github.com/spring-projects/spring-integration-samples/tree/master/basic/http[Http Sample] application demonstrating Spring Integration's HTTP support.
35
40
36
41
Below is an example bean definition for a simple HTTP inbound endpoint.
37
42
@@ -56,7 +61,8 @@ If the request has been wrapped as a _MultipartHttpServletRequest_, when using t
56
61
NOTE: The HTTP inbound Endpoint will locate a MultipartResolver in the context if one exists with the bean name "multipartResolver" (the same name expected by Spring's DispatcherServlet).
57
62
If it does in fact locate that bean, then the support for MultipartFiles will be enabled on the inbound request mapper.
58
63
Otherwise, it will fail when trying to map a multipart-file request to a Spring Integration Message.
59
-
For more on Spring's support for MultipartResolvers, refer to the http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-multipart[Spring Reference Manual].
64
+
For more on Spring's support for MultipartResolvers, refer to the
@@ -113,7 +119,7 @@ The reply message will be available in the Model map.
113
119
The key that is used for that map entry by default is 'reply', but this can be overridden by setting the 'replyKey' property on the endpoint's configuration.
114
120
115
121
[[http-outbound]]
116
-
=== Http Outbound Gateway
122
+
=== Http Outbound Components
117
123
118
124
To configure the `HttpRequestExecutingMessageHandler` write a bean definition like this:
119
125
@@ -158,7 +164,7 @@ This enables simple stateful interactions, such as...
158
164
If _transfer-cookies_ is false, any _Set-Cookie_ header received will remain as _Set-Cookie_ in the reply message, and will be dropped on subsequent sends.
159
165
160
166
[NOTE]
161
-
.Note: Empty Repsonse Bodies
167
+
.Note: Empty Response Bodies
162
168
=====
163
169
HTTP is a request/response protocol.
164
170
However the response may not have a body, just headers.
@@ -610,10 +616,11 @@ For outbound endpoints, the second thing to consider is timing while interacting
610
616
.How timeout settings apply to an HTTP Outbound Gateway
You may want to configure the HTTP related timeout behavior, when making active HTTP requests using the _HTTP Oubound Gateway_ or the _HTTP Outbound Channel Adapter_.
614
-
In those instances, these two components use Spring'shttp://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/client/RestTemplate.html[RestTemplate] support to execute HTTP requests.
619
+
You may want to configure the HTTP related timeout behavior, when making active HTTP requests using the _HTTP Outbound Gateway_ or the _HTTP Outbound Channel Adapter_.
620
+
In those instances, these two components use Spring's
621
+
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/client/RestTemplate.html[RestTemplate] support to execute HTTP requests.
615
622
616
-
In order to configure timeouts for the _HTTP Oubound Gateway_ and the _HTTP Outbound Channel Adapter_, you can either reference a `RestTemplate` bean directly, using the _rest-template_ attribute, or you can provide a reference to a http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/http/client/ClientHttpRequestFactory.html[ClientHttpRequestFactory] bean using the _request-factory_ attribute.
623
+
In order to configure timeouts for the _HTTP Outbound Gateway_ and the _HTTP Outbound Channel Adapter_, you can either reference a `RestTemplate` bean directly, using the _rest-template_ attribute, or you can provide a reference to a http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/http/client/ClientHttpRequestFactory.html[ClientHttpRequestFactory] bean using the _request-factory_ attribute.
617
624
Spring provides the following implementations of the `ClientHttpRequestFactory` interface:
618
625
619
626
http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/http/client/SimpleClientHttpRequestFactory.html[SimpleClientHttpRequestFactory] - Uses standard J2SE facilities for making HTTP Requests
@@ -665,7 +672,7 @@ _HTTP Outbound Gateway_
665
672
666
673
For the _HTTP Outbound Gateway_, the XML Schema defines only the _reply-timeout_.
667
674
The _reply-timeout_ maps to the _sendTimeout_ property of the _org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler_ class.
668
-
More precisely, the property is set on the extended `AbstractReplyProducingMessageHandler` class, which ultimatelly sets the property on the _MessagingTemplate_.
675
+
More precisely, the property is set on the extended `AbstractReplyProducingMessageHandler` class, which ultimately sets the property on the `MessagingTemplate`.
669
676
670
677
The value of the _sendTimeout_ property defaults to "-1" and will be applied to the connected `MessageChannel`.
671
678
This means, that depending on the implementation, the Message Channel's_send_ method may block indefinitely.
0 commit comments