INT-2727 PseudoTX Refactoring
Remove the need for pseudo-transactional element INT-2727 PseudoTX Add PseudoTransactionalTransactionManager INT-2727 addressed PR comments cherry picked previous code for mail module to eliminate breaking change INT-2727 initial refactoring pseudo-tx support to use common configuration INT-2727 finalizing pseudo-tx synchronization support INT-2727 polishing INT-2727 polishing based on PR comments INT-2727 addressed PR comments INT-2727 polishing INT-2727 Remove PseudoTransactionalMessageSource Instead of getResource, bind the resource holder before receive() and then add attributes to the holder. INT-2727 polishing INT-2727 Polishing Remove bind of #resource; add beforeCommit() test; add TransactionTemplate tests.
This commit is contained in:
committed by
Gary Russell
parent
5828f70321
commit
94cc5a73e2
@@ -50,13 +50,14 @@
|
||||
comparator="comparator"
|
||||
delete-remote-files="${delete.remote.files}">
|
||||
<poller fixed-rate="1000">
|
||||
<pseudo-transactional on-success-expression="'foo'"
|
||||
on-success-result-channel="successChannel"
|
||||
on-failure-expression="'bar'"
|
||||
on-failure-result-channel="failureChannel"
|
||||
send-timeout="123" />
|
||||
<transactional synchronization-factory="syncFactory"/>
|
||||
</poller>
|
||||
</sftp:inbound-channel-adapter>
|
||||
|
||||
<transaction-synchronization-factory id="syncFactory">
|
||||
<after-commit expression="'foo'" channel="successChannel"/>
|
||||
<after-rollback expression="'bar'" channel="failureChannel"/>
|
||||
</transaction-synchronization-factory>
|
||||
|
||||
<channel id="successChannel" />
|
||||
|
||||
@@ -114,5 +115,7 @@
|
||||
</sftp:inbound-channel-adapter>
|
||||
|
||||
<bridge input-channel="autoChannel" output-channel="nullChannel" />
|
||||
|
||||
<beans:bean id="transactionManager" class="org.springframework.integration.transaction.PseudoTransactionManager"/>
|
||||
|
||||
</beans:beans>
|
||||
|
||||
@@ -29,11 +29,11 @@ import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.BeanDefinitionStoreException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
|
||||
@@ -83,16 +83,6 @@ public class InboundChannelAdapterParserTests {
|
||||
assertEquals(".", remoteFileSeparator);
|
||||
PollableChannel requestChannel = context.getBean("requestChannel", PollableChannel.class);
|
||||
assertNotNull(requestChannel.receive(2000));
|
||||
assertEquals("foo", TestUtils.getPropertyValue(adapter, "onSuccessExpression", Expression.class).getValue());
|
||||
assertSame(context.getBean("successChannel"), TestUtils.getPropertyValue(
|
||||
TestUtils.getPropertyValue(adapter, "onSuccessMessagingTemplate"), "defaultChannel"));
|
||||
assertEquals(123L, TestUtils.getPropertyValue(
|
||||
TestUtils.getPropertyValue(adapter, "onSuccessMessagingTemplate"), "sendTimeout"));
|
||||
assertEquals("bar", TestUtils.getPropertyValue(adapter, "onFailureExpression", Expression.class).getValue());
|
||||
assertSame(context.getBean("failureChannel"), TestUtils.getPropertyValue(
|
||||
TestUtils.getPropertyValue(adapter, "onFailureMessagingTemplate"), "defaultChannel"));
|
||||
assertEquals(123L, TestUtils.getPropertyValue(
|
||||
TestUtils.getPropertyValue(adapter, "onFailureMessagingTemplate"), "sendTimeout"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user