Merge remote-tracking branch 'upstream/master' into 4.0.0-WIP

Conflicts:
	spring-integration-core/src/main/java/org/springframework/integration/core/MessagingTemplate.java

Resolved.
This commit is contained in:
Gary Russell
2013-12-09 15:49:19 -05:00
6 changed files with 70 additions and 19 deletions

View File

@@ -168,7 +168,8 @@
<section id="file-tailing">
<title>'Tail'ing Files</title>
<para>
Another popular use case is to get 'lines' from the end (or tail) of a file. Two implementations are provided;
Another popular use case is to get 'lines' from the end (or tail) of a file, capturing new lines when
they are added. Two implementations are provided;
the first, <classname>OSDelegatingFileTailingMessageProducer</classname>, uses the native <code>tail</code>
command (on operating systems that have one). This is likely the most efficient implementation on those
platforms. For operating systems that do not have a <code>tail</code> command, the second implementation
@@ -213,12 +214,12 @@
</para>
<programlisting language="xml"><![CDATA[<int-file:tail-inbound-channel-adapter id="native"
channel="input"
native-options="-F -n 6"
native-options="-F -n +0"
task-executor="exec"
file-delay=10000
file="/tmp/foo"/>]]></programlisting>
<para>
This creates a native adapter with '-F -n 6' options (follow the file name, emit up to 6 lines before the current end).
This creates a native adapter with '-F -n +0' options (follow the file name, emitting all existing lines).
If the tail command fails (on some platforms, a missing file causes the <code>tail</code> to fail, even with
<code>-F</code> specified), the command will be retried every 10 seconds.
</para>
@@ -231,11 +232,18 @@
reopen="true"
file-delay="10000"/>]]></programlisting>
<para>
This creates a commons-io <classname>Tailer</classname> adapter that examines the file for new lines every
This creates an Apache commons-io <classname>Tailer</classname> adapter that examines the file for new lines every
2 seconds, and checks for existence of a missing file every 10 seconds. The file will be tailed from the
beginning (<code>end="false"</code>) instead of the end (which is the default). The file will be
reopened for each chunk (the default is to keep the file open).
</para>
<important>
<para>
Specifying the <code>delay</code>, <code>end</code> or <code>reopen</code> attributes,
forces the use of the Apache commons-io adapter and the <code>native-options</code> attribute is not
allowed.
</para>
</important>
</section>
</section>
<section id="file-writing">

View File

@@ -78,7 +78,7 @@
<para>
The retry advice (<classname>o.s.i.handler.advice.RequestHandlerRetryAdvice</classname>)
leverages the rich retry mechanisms provided by the
<ulink url="https://github.com/SpringSource/spring-retry">spring-retry</ulink> project. The core component
<ulink url="https://github.com/SpringSource/spring-retry">Spring Retry</ulink> project. The core component
of <emphasis>spring-retry</emphasis> is the <classname>RetryTemplate</classname>, which allows configuration
of sophisticated retry scenarios, including <classname>RetryPolicy</classname> and <classname>BackoffPolicy</classname>
strategies, with a number of implementations,
@@ -288,6 +288,32 @@ Caused by: java.lang.RuntimeException: foo
exception is thrown to the caller on each failure.
</para>
</section>
<para>
<emphasis>Exception Classification for Retry</emphasis>
</para>
<para>
Spring Retry has a great deal of flexibility for determining which
exceptions can invoke retry. The default configuration will retry
for all exceptions. Given that, user exceptions may be wrapped in
a <classname>MessagingException</classname> in the underlying handler,
we need to ensure that the classification examines the exception causes.
The default classifier just looks at the top level exception.
</para>
<para>
Since <emphasis>Spring Retry 1.0.3</emphasis>, the
<classname>BinaryExceptionClassifier</classname> has a property
<code>traverseCauses</code> (default <code>false</code>). When
<code>true</code> it will traverse exception causes until it
finds a match or there is no cause.
</para>
<para>
To use this classifier for retry, use a <classname>SimpleRetryPolicy</classname>
created with the constructor that takes the max attempts, the
<interfacename>Map</interfacename> of <classname>Exception</classname>s
and the boolean (traverseCauses), and inject this policy into the
<classname>RetryTemplate</classname>.
</para>
</section>
<section id="circuit-breaker-advice">
<title>Circuit Breaker Advice</title>