Am 01.06.10 08:37, schrieb Claus Ibsen:
> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <[email protected]> wrote:
>
>> I forgot to mention that I currently use version 2.2.0.
>>
>>
> Can you create a small sample application that demonstrates this? Then
> its much easier to look into it to see what / if we can do in Camel.
>
>> - Ingo
>>
>>
>>
Sure, i created a small example that you can find at
http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
It contains just a small JUnit Test Case (see below). The test runs fine
as long you execute the whole test. As I find out yesterday, quartz
deletes some information within the database on a clean shutdown.
So the next test run will also run fine.
But if you kill the running test - to simulate a server crash - the next
test run will end up with an exception.
So how do I handle such inconsist data on startup of camel?
Regards
Ingo
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
locations = {
"classpath*:context-test.xml"
}
)
public class QuartzClusterTest extends TestCase {
@Autowired
private CamelContext camelContext;
@EndpointInject(uri = "mock:result")
protected MockEndpoint resultEndpoint;
@Test
@DirtiesContext
@Repeat(value=2)
public void testTriggering() throws Exception {
camelContext.addRoutes(new QuartzRouteBuilder());
resultEndpoint.setMinimumExpectedMessageCount(5);
resultEndpoint.setResultWaitTime(5000L);
resultEndpoint.assertIsSatisfied();
}
public static class QuartzRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
}
}
}