Skip to content

Commit 7ec8687

Browse files
committed
Fix retry-and-more Sample Bug
Incorrect SpEL for rename.
1 parent b335846 commit 7ec8687

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

intermediate/retry-and-more/src/main/java/org/springframework/integration/samples/advice/FileTransferRenameAfterFailureDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception {
6262
+ "\n "
6363
+ "\n Press 'Enter' to terminate. "
6464
+ "\n "
65-
+ "\n Place a file in ${java.io.tmpdir}/adviceDemo ending "
65+
+ "\n Place a file in "+ System.getProperty("java.io.tmpdir") +"/adviceDemo ending "
6666
+ "\n with .txt "
6767
+ "\n The demo simulates a file transfer failure followed "
6868
+ "\n by the Advice renaming the file; the result of the "

intermediate/retry-and-more/src/main/resources/META-INF/spring/integration/expression-advice-context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice">
3535
<property name="onSuccessExpression" value="payload.delete()" />
3636
<property name="successChannel" ref="afterSuccessDeleteChannel" />
37-
<property name="onFailureExpression" value="payload.renameTo(payload.absolutePath + '.failed.to.send')" />
37+
<property name="onFailureExpression" value="payload.renameTo(new java.io.File(payload.absolutePath + '.failed.to.send'))" />
3838
<property name="failureChannel" ref="afterFailRenameChannel" />
3939
</bean>
4040
</int-ftp:request-handler-advice-chain>

0 commit comments

Comments
 (0)