Package org.apache.camel

Examples of org.apache.camel.CamelContext.stop()


            // END SNIPPET: e4
            // Now everything is set up - let's start the context

            client.invoke();
            Thread.sleep(1000);
            context.stop();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            server.stop();
            broker.stop();
View Full Code Here


        }
        // END SNIPPET: sending

        // Start the loan broker
        Thread.sleep(1000 * 5);
        context.stop();

    }

    /**
     * Lets configure the Camel routing rules using Java code to pull the response message
View Full Code Here

        // Start the loan broker
        context.start();
        System.out.println("Server is ready");

        Thread.sleep(5 * 60 * 1000);
        context.stop();
        Thread.sleep(1000);
        broker.stop();

    }
    // END SNIPPET: starting
View Full Code Here

        context.addRoutes(new LoanBroker());
        context.start();

        // Start the loan broker
        Thread.sleep(5 * 60 * 1000);
        context.stop();
        Thread.sleep(1000);
        bankServer.stop();
        creditAgencyServer.stop();
    }
    //END SNIPPET: server
View Full Code Here

            // END SNIPPET: e4
            // Now everything is set up - lets start the context
            
            client.invock();
            Thread.sleep(1000);
            context.stop();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            server.stop();
            broker.stop();
View Full Code Here

        camel.start();

        String reply = camel.createProducerTemplate().requestBody("direct:start", "Camel", String.class);
        assertEquals("Hello Camel", reply);

        camel.stop();
    }

    private class MyOtherDummyBean {

        public String hello(String s) {
View Full Code Here

        ISay proxy = ProxyHelper.createProxy(endpoint, ISay.class);
        String rc = proxy.say();
        assertEquals("Good Bye!", rc);
        // END SNIPPET: invoke

        camelContext.stop();
    }
}
View Full Code Here

       
        Thread.sleep(4000);
        assertTrue(context.getRouteStatus("testRoute") == ServiceStatus.Started);
        context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");

        context.stop();
        mock.assertIsSatisfied();
    }

   
    public void stopTest() throws Exception {
View Full Code Here

        try {
            context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");
        } catch (CamelExecutionException e) {
            consumerStopped = true;
        }   
        context.stop();
        assertTrue(consumerStopped);
    }
   
   
    public void suspendTest() throws Exception {
View Full Code Here

            context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");
        } catch (CamelExecutionException e) {
            consumerSuspended = true;
        }       
       
        context.stop();
        assertTrue(consumerSuspended);
    }
   
    public void resumeTest() throws Exception {
        CamelContext context = startRouteWithPolicy("resumePolicy");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.