INT-737 DelayHandler now delegates to a configurable MessageStore for storing any Messages awaiting a delayed release.

This commit is contained in:
Mark Fisher
2010-05-08 17:13:54 +00:00
parent 8a7a8887de
commit e83771e5ed
5 changed files with 66 additions and 7 deletions

View File

@@ -31,6 +31,14 @@
default-delay="0"
scheduler="testScheduler"/>
<delayer id="delayerWithCustomMessageStore"
input-channel="input"
output-channel="output"
default-delay="0"
message-store="testMessageStore"/>
<task:scheduler id="testScheduler" pool-size="7"/>
<beans:bean id="testMessageStore" class="org.springframework.integration.store.SimpleMessageStore"/>
</beans:beans>

View File

@@ -61,7 +61,6 @@ public class DelayerParserTests {
accessor.getPropertyValue("taskScheduler")).getPropertyValue("waitForTasksToCompleteOnShutdown"));
}
@Test
public void customScheduler() {
Object endpoint = context.getBean("delayerWithCustomScheduler");
@@ -76,4 +75,15 @@ public class DelayerParserTests {
assertEquals(context.getBean("testScheduler"), accessor.getPropertyValue("taskScheduler"));
}
@Test
public void customMessageStore() {
Object endpoint = context.getBean("delayerWithCustomMessageStore");
assertEquals(EventDrivenConsumer.class, endpoint.getClass());
Object handler = TestUtils.getPropertyValue(endpoint, "handler");
assertEquals(DelayHandler.class, handler.getClass());
DelayHandler delayHandler = (DelayHandler) handler;
DirectFieldAccessor accessor = new DirectFieldAccessor(delayHandler);
assertEquals(context.getBean("testMessageStore"), accessor.getPropertyValue("messageStore"));
}
}