Skip to content

Commit b7aa54a

Browse files
committed
INT-2456: Polish http.adoc
JIRA: https://jira.spring.io/browse/INT-2456 Note: I don't see reason to extract separate paragraphs for gateway/adapter pairs.
1 parent 758a6bd commit b7aa54a

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

src/reference/asciidoc/http.adoc

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ The HTTP support allows for the execution of HTTP requests and the processing of
88
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`.
99

1010
[[http-inbound]]
11-
=== Http Inbound Gateway
11+
=== Http Inbound Components
1212

1313
To receive messages over HTTP, you need to use an _HTTP Inbound
1414
Channel Adapter_ or _Gateway_.
1515
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:
16+
The easiest way to do this is to use Spring's
17+
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/context/support/HttpRequestHandlerServlet.html[HttpRequestHandlerServlet],
18+
by providing the following servlet definition in the _web.xml_ file:
1719

1820
[source,xml]
1921
----
@@ -24,14 +26,17 @@ The easiest way to do this is to use Spring's http://static.springsource.org/spr
2426
----
2527

2628
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.
2832

2933
If you are running within a Spring MVC application, then the aforementioned explicit servlet definition is not necessary.
3034
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.
3237

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

3641
Below is an example bean definition for a simple HTTP inbound endpoint.
3742

@@ -56,7 +61,8 @@ If the request has been wrapped as a _MultipartHttpServletRequest_, when using t
5661
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).
5762
If it does in fact locate that bean, then the support for MultipartFiles will be enabled on the inbound request mapper.
5863
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
65+
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-multipart[Spring Reference Manual].
6066

6167
[NOTE]
6268
====
@@ -113,7 +119,7 @@ The reply message will be available in the Model map.
113119
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.
114120

115121
[[http-outbound]]
116-
=== Http Outbound Gateway
122+
=== Http Outbound Components
117123

118124
To configure the `HttpRequestExecutingMessageHandler` write a bean definition like this:
119125

@@ -158,7 +164,7 @@ This enables simple stateful interactions, such as...
158164
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.
159165

160166
[NOTE]
161-
.Note: Empty Repsonse Bodies
167+
.Note: Empty Response Bodies
162168
=====
163169
HTTP is a request/response protocol.
164170
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
610616
.How timeout settings apply to an HTTP Outbound Gateway
611617
image::images/http-outbound-gateway.png[align="center"]
612618

613-
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.
615622

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.
617624
Spring provides the following implementations of the `ClientHttpRequestFactory` interface:
618625

619626
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_
665672

666673
For the _HTTP Outbound Gateway_, the XML Schema defines only the _reply-timeout_.
667674
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`.
669676

670677
The value of the _sendTimeout_ property defaults to "-1" and will be applied to the connected `MessageChannel`.
671678
This means, that depending on the implementation, the Message Channel's_send_ method may block indefinitely.

0 commit comments

Comments
 (0)