Merge pull request #689 from ghillert/INT-2843

* INT-2843: Doc: with 2.2 Java serialization over HTTP not enabled by default

* INT-2842: Doc: Re-order 'What's New in 2.2' section
This commit is contained in:
Mark Fisher
2012-11-30 16:19:42 -05:00
2 changed files with 151 additions and 125 deletions

View File

@@ -110,14 +110,20 @@
<para>
To configure the <classname>HttpRequestExecutingMessageHandler</classname> write a bean definition like this:
</para>
<programlisting language="xml"><![CDATA[<bean id="httpOutbound"
class="org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler">
<constructor-arg value="http://localhost:8080/example" />
<property name="outputChannel" ref="responseChannel" />
</bean>]]></programlisting>
<para>
This bean definition will execute HTTP requests by delegating to a <classname>RestTemplate</classname>. That template in turn delegates
to a list of HttpMessageConverters to generate the HTTP request body from the Message payload. You can configure those converters as well
as the ClientHttpRequestFactory instance to use:
</para>
<programlisting language="xml"><![CDATA[<bean id="httpOutbound"
class="org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler">
<constructor-arg value="http://localhost:8080/example" />
@@ -125,6 +131,8 @@
<property name="messageConverters" ref="messageConverterList" />
<property name="requestFactory" ref="customRequestFactory" />
</bean>]]></programlisting>
<para>
By default the HTTP request will be generated using an instance of <classname>SimpleClientHttpRequestFactory</classname> which uses the JDK
<classname>HttpURLConnection</classname>. Use of the Apache Commons HTTP Client is also supported through the provided
<classname>CommonsClientHttpRequestFactory</classname> which can be injected as shown above.
@@ -281,9 +289,14 @@ In the case of the Outbound Gateway, the reply message produced by the gateway w
<para>
To configure the outbound gateway you can use the namespace support as well. The following code snippet shows the different configuration options for an outbound Http gateway. Most importantly, notice that the 'http-method' and 'expected-response-type' are provided. Those are two of the most commonly configured values. The
default http-method is POST, and the default response type is <emphasis>null</emphasis>. With a null response type, the payload of the reply Message would
contain the ResponseEntity as long as it's http status is a success (non-successful status codes will throw Exceptions). If you are expecting a different
type, such as a <classname>String</classname>, then provide that fully-qualified class name as shown below.
contain the ResponseEntity as long as it's http status is a success (non-successful status codes will throw Exceptions).
If you are expecting a different type, such as a <classname>String</classname>, then provide that fully-qualified class name as shown below.
</para>
<important>
Beginning with Spring Integration 2.1 the <emphasis>request-timeout</emphasis> attribute
of the HTTP Outbound Gateway was renamed to <emphasis>reply-timeout</emphasis>
to better reflect the intent.
</important>
<programlisting language="xml"><![CDATA[<int-http:outbound-gateway id="example"
request-channel="requests"
url="http://localhost/test"
@@ -294,11 +307,28 @@ In the case of the Outbound Gateway, the reply message produced by the gateway w
request-factory="requestFactory"
reply-timeout="1234"
reply-channel="replies"/>]]></programlisting>
<important>
Beginning with Spring Integration 2.1 the <emphasis>request-timeout</emphasis> attribute
of the HTTP Outbound Gateway was renamed to <emphasis>reply-timeout</emphasis>
to better reflect the intent.
</important>
<important>
<para>
Since <emphasis>Spring Integration 2.2</emphasis>, Java serialization
over HTTP is no longer enabled by default. Previously, when setting
the <code>expected-response-type</code>
attribute to a <code>Serializable</code> object, the <code>Accept</code>
header was not properly set up. Since <emphasis>Spring Integration 2.2</emphasis>,
the <classname>SerializingHttpMessageConverter</classname> has now been
updated to set the <code>Accept</code> header to
<code>application/x-java-serialized-object</code>.
</para>
<para>
However, because this could cause incompatibility with existing applications,
it was decided to no longer automatically add this converter to the HTTP endpoints.
If you wish to use Java serialization, you will need to add the
<classname>SerializingHttpMessageConverter</classname> to the appropriate
endpoints, using the <code>message-converters</code> attribute, when using
XML configuration, or using the <code>setMessageConverters()</code> method.
Alternatively, you may wish to consider using JSON instead which is enabled
by simply having <code>Jackson</code> on the classpath.
</para>
</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>

View File

@@ -10,16 +10,121 @@
were resolved as part of the 2.2 development process:
</para>
<section id="2.2-general">
<title>General</title>
<section id="2.2-spring-31">
<title>Spring 3.1</title>
<section id="2.2-new-components">
<title>New Components</title>
<section id="2.2-redis-store-adapters">
<title>RedisStore Inbound and Outbound Channel Adapters</title>
<para>
Spring Integration now uses Spring 3.1.
Spring Integration now has RedisStore Inbound and Outbound Channel Adapters
allowing you to write and read Message payloads to/from Redis collection(s).
For more information please see
<xref linkend="redis-store-outbound-channel-adapter"/> and
<xref linkend="redis-store-inbound-channel-adapter"/>.
</para>
</section>
<section id="2.2-mongo-adapters">
<title>MongoDB Inbound and Outbound Channel Adapters</title>
<para>
Spring Integration now has MongoDB Inbound and Outbound Channel Adapters
allowing you to write and read Message payloads to/from a MongoDB document store.
For more information please see
<xref linkend="mongodb-outbound-channel-adapter"/> and
<xref linkend="mongodb-inbound-channel-adapter"/>.
</para>
</section>
<section id="2.2-jpa">
<title>JPA Endpoints</title>
<para>
Spring Integration now includes components for the Java Persistence
API (JPA) for retrieving and persisting JPA entity objects. The
JPA Adapter includes the following components:
</para>
<itemizedlist>
<listitem>
<para><emphasis><link linkend='jpa-inbound-channel-adapter'>Inbound Channel Adapter</link></emphasis></para>
</listitem>
<listitem>
<para><emphasis><link linkend='jpa-outbound-channel-adapter'>Outbound Channel Adapter</link></emphasis></para>
</listitem>
<listitem>
<para><emphasis><link linkend='jpa-updating-outbound-gateway'>Updating Outbound Gateway</link></emphasis></para>
</listitem>
<listitem>
<para><emphasis><link linkend='jpa-retrieving-outbound-gateway'>Retrieving Outbound Gateway</link></emphasis></para>
</listitem>
</itemizedlist>
<para>
For more information please see <xref linkend="jpa"/>
</para>
</section>
</section>
<section id="2.2-general">
<title>General Changes</title>
<section id="2.2-spring-31">
<title>Spring 3.1 Used by Default</title>
<para>
Spring Integration now uses Spring 3.1.
</para>
</section>
<section id="2.2-handler-advice">
<title>Adding Behavior to Endpoints</title>
<para>
The ability to add an &lt;advice-chain/&gt; to a poller has been available for some time.
However, the behavior added by this affects the entire integration flow.
It did not address the ability to add, say, retry, to an individual
endpoint. The 2.2. release introduces the &lt;request-handler-advice-chain/&gt;
to many endpoints.
</para>
<para>
In addition, 3 standard Advice classes have been provided for this purpose:
</para>
<itemizedlist>
<listitem>MessageHandlerRetryAdvice</listitem>
<listitem>MessageHandlerCircuitBreakerAdvice</listitem>
<listitem>ExpressionEvaluatingMessageHandlerAdvice</listitem>
</itemizedlist>
<para>
For more information, see <xref linkend="message-handler-advice-chain"/>.
</para>
</section>
<section id="2.2-transaction-sync">
<title>Transaction Synchronization and Pseudo Transactions</title>
<para>
Pollers can now participate in Spring's <emphasis>Transaction Synchronization</emphasis>
feature. This allows for synchronizing such operations as renaming files by an inbound channel
adapter depending on whether the transaction commits, or rolls back.
</para>
<para>
In addition, these features can be enabled when there is not a 'real' transaction present,
by means of a <classname>PseudoTransactionManager</classname>.
</para>
<para>
For more information see <xref linkend="transaction-synchronization"/>.
</para>
</section>
<section id="2.2-file-adapter">
<title>File Adapter - Improved File Overwrite/Append Handling</title>
<para>
When using the <emphasis>File Oubound Channel Adapter</emphasis>
or the <emphasis>File Outbound Gateway</emphasis>, a new
<emphasis>mode</emphasis> property was added. Prior to
<emphasis>Spring Integration 2.2</emphasis>, target files were
replaced when they existed. Now you can specify
the following options:
</para>
<itemizedlist>
<listitem>REPLACE (Default)</listitem>
<listitem>APPEND</listitem>
<listitem>FAIL</listitem>
<listitem>IGNORE</listitem>
</itemizedlist>
<para>
For more information please see <xref linkend="file-writing-destination-exists"/>.
</para>
</section>
<section id="2.2-outbound-gateways">
<title>Outbound Gateways</title>
<title>Reply-Timeout added to more Outbound Gateways</title>
<para>
The XML Namespace support adds the <emphasis>reply-timeout</emphasis>
attribute to the following <emphasis>Outbound Gateways</emphasis>:
@@ -46,26 +151,6 @@
<listitem>Support for Dead Letter Exchanges/Dead Letter Queues</listitem>
</itemizedlist>
</section>
<section id="2.2-redis-store-adapters">
<title>RedisStore Inbound and Outbound Channel Adapters</title>
<para>
Spring Integration now has RedisStore Inbound and Outbound Channel Adapters
allowing you to write and read Message payloads to/from Redis collection(s).
For more information please see
<xref linkend="redis-store-outbound-channel-adapter"/> and
<xref linkend="redis-store-inbound-channel-adapter"/>.
</para>
</section>
<section id="2.2-mongo-adapters">
<title>MongoDB Inbound and Outbound Channel Adapters</title>
<para>
Spring Integration now has MongoDB Inbound and Outbound Channel Adapters
allowing you to write and read Message payloads to/from a MongoDB document store.
For more information please see
<xref linkend="mongodb-outbound-channel-adapter"/> and
<xref linkend="mongodb-inbound-channel-adapter"/>.
</para>
</section>
<section id="2.2-jdbc-11">
<title>JDBC Support - Stored Procedures Components</title>
<para><emphasis>SpEL Support</emphasis></para>
@@ -108,26 +193,6 @@
see: <xref linkend="jdbc-message-store-channels"/>.
</para>
</section>
<section id="2.2-file-adapter">
<title>File Adapter - Improved File Overwrite/Append Handling</title>
<para>
When using the <emphasis>File Oubound Channel Adapter</emphasis>
or the <emphasis>File Outbound Gateway</emphasis>, a new
<emphasis>mode</emphasis> property was added. Prior to
<emphasis>Spring Integration 2.2</emphasis>, target files were
replaced when they existed. Now you can specify
the following options:
</para>
<itemizedlist>
<listitem>REPLACE (Default)</listitem>
<listitem>APPEND</listitem>
<listitem>FAIL</listitem>
<listitem>IGNORE</listitem>
</itemizedlist>
<para>
For more information please see <xref linkend="file-writing-destination-exists"/>.
</para>
</section>
<section id="2.2-shutdown">
<title>Orderly Shutdown</title>
<para>
@@ -138,42 +203,6 @@
messages to complete.
</para>
</section>
<section id="2.2-handler-advice">
<title>Adding Behavior to Endpoints</title>
<para>
The ability to add an &lt;advice-chain/&gt; to a poller has been available for some time.
However, the behavior added by this affects the entire integration flow.
It did not address the ability to add, say, retry, to an individual
endpoint. The 2.2. release introduces the &lt;request-handler-advice-chain/&gt;
to many endpoints.
</para>
<para>
In addition, 3 standard Advice classes have been provided for this purpose:
</para>
<itemizedlist>
<listitem>MessageHandlerRetryAdvice</listitem>
<listitem>MessageHandlerCircuitBreakerAdvice</listitem>
<listitem>ExpressionEvaluatingMessageHandlerAdvice</listitem>
</itemizedlist>
<para>
For more information, see <xref linkend="message-handler-advice-chain"/>.
</para>
</section>
<section id="2.2-transaction-sync">
<title>Transaction Synchronization and Pseudo Transactions</title>
<para>
Pollers can now participate in Spring's <emphasis>Transaction Synchronization</emphasis>
feature. This allows for synchronizing such operations as renaming files by an inbound channel
adapter depending on whether the transaction commits, or rolls back.
</para>
<para>
In addition, these features can be enabled when there is not a 'real' transaction present,
by means of a <classname>PseudoTransactionManager</classname>.
</para>
<para>
For more information see <xref linkend="transaction-synchronization"/>.
</para>
</section>
<section id="2.2-jms-og">
<title>JMS Oubound Gateway Improvements</title>
<para>
@@ -191,15 +220,15 @@
</para>
</section>
<section id="httpChanges">
<title>Http Support</title>
<title>HTTP Support</title>
<para>
Java serialization over http is no longer enabled by default. Previously, when
Java serialization over HTTP is no longer enabled by default. Previously, when
setting a <code>expected-response-type</code> to a <code>Serializable</code>
object, the <code>Accept</code> header was not properly set up. The
<classname>SerializingHttpMessageConverter</classname> has now been updated
to set the Accept header to <code>application/x-java-serialized-object</code>.
However, because this could cause incompatibility with existing applications,
it was decided to no longer automatically add this converter to the http endpoints.
it was decided to no longer automatically add this converter to the HTTP endpoints.
</para>
<para>
If you wish to use Java serialization, you will need to add the
@@ -213,37 +242,4 @@
</para>
</section>
</section>
<section id="2.2-new-components">
<title>New Components</title>
<section id="2.2-jpa">
<title>JPA Endpoints</title>
<para>
Spring Integration now includes components for the Java Persistence
API (JPA) for retrieving and persisting JPA entity objects. The
JPA Adapter includes the following components:
</para>
<itemizedlist>
<listitem>
<para><emphasis><link linkend='jpa-inbound-channel-adapter'>Inbound Channel Adapter</link></emphasis></para>
</listitem>
<listitem>
<para><emphasis><link linkend='jpa-outbound-channel-adapter'>Outbound Channel Adapter</link></emphasis></para>
</listitem>
<listitem>
<para><emphasis><link linkend='jpa-updating-outbound-gateway'>Updating Outbound Gateway</link></emphasis></para>
</listitem>
<listitem>
<para><emphasis><link linkend='jpa-retrieving-outbound-gateway'>Retrieving Outbound Gateway</link></emphasis></para>
</listitem>
</itemizedlist>
<para>
For more information please see <xref linkend="jpa"/>
</para>
</section>
</section>
<section id="2.2-framework-refactorings">
<title>Framework Refactoring</title>
</section>
</chapter>