INT-2397 http-method-expression

Add support for http-method-expression attribute to the HTTP Outbound Gateway/Adapter

INT-2397 polishing

INT-2397 polishing based on PR comments

INT-2397 more polishing based on PR comments

INT-2397 polishing

INT-2397 plishing PR comments

INT-2397 polishing
This commit is contained in:
Oleg Zhurakousky
2012-05-31 20:53:23 -04:00
committed by Gary Russell
parent a011f9dda7
commit b105872bb7
12 changed files with 307 additions and 47 deletions

View File

@@ -265,6 +265,20 @@ In the case of the Outbound Gateway, the reply message produced by the gateway w
of the HTTP Outbound Gateway was renamed to <emphasis>reply-timeout</emphasis>
to better reflect the intent.
</important>
<para>
Beginning with Spring Integration 2.2 you can also determine the HTTP Method dynamically using SpEL and the <emphasis>http-method-expression</emphasis> attribute.
Note that this attribute is obviously murually exclusive with <emphasis>http-method</emphasis>
<programlisting language="xml"><![CDATA[<int-http:outbound-gateway id="example"
request-channel="requests"
url="http://localhost/test"
http-method-expression="headers.httpMethod"
extract-request-payload="false"
expected-response-type="java.lang.String"
charset="UTF-8"
request-factory="requestFactory"
reply-timeout="1234"
reply-channel="replies"/>]]></programlisting>
</para>
<para>If your outbound adapter is to be used in a unidirectional way, then you can use an outbound-channel-adapter instead. This means that
a successful response will simply execute without sending any Messages to a reply channel. In the case of any non-successful response
status code, it will throw an exception. The configuration looks very similar to the gateway: