3233343536373839404142
public void start() throws Exception { applicationContext.start(); } public void stop() throws Exception { applicationContext.stop(); } }); return SpringCamelContext.springCamelContext(applicationContext);
3435363738394041424344
public void start() throws Exception { applicationContext.start(); } public void stop() throws Exception { applicationContext.stop(); } }); return SpringCamelContext.springCamelContext(applicationContext); }
3334353637383940414243
applicationContext.start(); } public void stop() throws Exception { applicationContext.stop(); } }); return SpringCamelContext.springCamelContext(applicationContext); }
3637383940414243444546
3738394041424344454647
126127128129130131132133134135136
4041424344454647484950
4142434445464748495051
MockEndpoint mock = camel.getEndpoint("mock:result", MockEndpoint.class); mock.expectedMinimumMessageCount(2); mock.assertIsSatisfied(); app.stop(); log.info("Restarting ..."); log.info("Restarting ..."); log.info("Restarting ...");
6768697071727374757677
MockEndpoint mock2 = camel2.getEndpoint("mock:result", MockEndpoint.class); mock2.expectedMinimumMessageCount(2); mock2.assertIsSatisfied(); app2.stop(); // we're done so let's properly close the application contexts app.close(); app2.close(); }
5657585960616263
camel2.createProducerTemplate().sendBody("direct:start", "Bye World"); mock1.assertIsSatisfied(); mock2.assertIsSatisfied(); ac.stop(); } }