/** * Program entry point */ public static void main(String[] args) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("stream:in").to("direct:greetings"); from("direct:greetings").to("stream:out"); } }); context.start(); context.getRoutes().forEach(r -> LOGGER.info(r.toString())); context.stop(); } }
@Override public void start() throws Exception { vertx.eventBus().consumer("announce", message -> { System.out.println("ANNOUNCE >> " + message.body()); }); vertx.eventBus().consumer("errors", message -> { System.out.println("ERROR >> " + message.body()); }); SimpleRegistry registry = new SimpleRegistry(); registry.put("filterService", new ReleasePostFilter()); CamelContext camelContext = new DefaultCamelContext(registry); camelContext.addRoutes(createMyRoutes()); camelContext.start(); CamelBridge.create(vertx, new CamelBridgeOptions(camelContext) .addInboundMapping(fromCamel("seda:announce").toVertx("announce")) .addInboundMapping(fromCamel("seda:errors").toVertx("errors"))) .start(); }
/** * A helper method to create a list of Route objects for a given route builder */ public static List<Route> getRouteList(RouteBuilder builder) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(builder); context.start(); List<Route> answer = context.getRoutes(); context.stop(); return answer; }
/** * A helper method to create a list of Route objects for a given route builder */ public static List<Route> getRouteList(RouteBuilder builder) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(builder); context.start(); List<Route> answer = context.getRoutes(); context.stop(); return answer; }
@Override public void run() throws Exception { camelctx.start(); } }, bootstrap.getClassLoader());
@Override public void start() throws Exception { super.start(); // no need to check for current context state - start() method will perform that check camelContext.start(); }
public static void main(String[] args) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new HelloRoute()); context.start(); // keep the JVM running (a bit of a hack) Thread.sleep(Integer.MAX_VALUE); }
private void start() throws Exception { CamelContext camel = new DefaultCamelContext(); camel.addRoutes(new UseCaseRoute()); camel.start(); } }
public static void main(String[] args) throws Exception { CamelContext context = new DefaultCamelContext(); Main main = new Main(); context.addRoutes(main); context.start(); //for (int i=0; i<cases; ++i) { // context.createProducerTemplate().sendBody("direct:b", "b"+i); //} } }
public static void main(String[] args) throws Exception { CamelContext context = new DefaultCamelContext(); Main main = new Main(); context.addRoutes(main); context.start(); //for (int i=0; i<cases; ++i) { // context.createProducerTemplate().sendBody("direct:b", "b"+i); //} } }
@Validate void start() throws Exception { lmhParentInstance = new LMHImpl(lmhRoot); multiStore = new LMHMultiUserStore(lmhParentInstance); CamelContext context = new DefaultCamelContext(); producer = context.createProducerTemplate(); context.addRoutes(this); context.start(); if (lmhRoot == null || !Files.isDirectory(Paths.get(lmhRoot))) { return; } }
@Override @PostConstruct public void init() throws Exception { // Make sure the camel context get started // See https://issues.apache.org/jira/browse/JAMES-1069 if (getCamelContext().getStatus().isStopped()) { getCamelContext().start(); } super.init(); }
@Validate void start() throws Exception { CamelContext context = new DefaultCamelContext(); context.addComponent("sallyservlet", servlet.getCamelComponent()); context.addComponent("freemarker", new TemplatingComponent("templates/", getClass().getClassLoader())); // context.addComponent("freemarker", new FreemarkerComponent()); context.addRoutes(this); context.start(); }
public void run() throws Exception { CamelContext context = new DefaultCamelContext(); context.addComponent("properties", new PropertiesComponent("sampleconfig.properties")); context.addRoutes(new OrderRouteBuilder()); context.start(); System.in.read(); context.stop(); }
private void start() throws Exception { CamelContext camel = new DefaultCamelContext(); // add our custom component camel.addComponent("erp", new ERPComponent()); // add the route camel.addRoutes(new ERPRoute()); // and start Camel camel.start(); }
/** camel context startup and template creation */ private void initializeTemplate(KieSession session) throws Exception { CamelContext context = configure(session); this.template = context.createProducerTemplate(); context.start(); }
@Validate void doStart() throws Exception { environmentid = theoClient.getEnvironmentID(); context = new DefaultCamelContext(); context.addComponent("sallyservlet", sallyServlet.getCamelComponent()); context.addRoutes(this); context.start(); }
public void run() throws Exception { CamelContext context = new DefaultCamelContext(); JmsConfiguration jmsConfig = new JmsConfiguration(new ActiveMQConnectionFactory("tcp://localhost:61616")); context.addComponent("jms", new JmsComponent(jmsConfig )); context.setTracing(true); context.addRoutes(new Jms2RestRoute()); context.start(); System.in.read(); context.stop(); }
private void validatePojoOption(CamelContext context) throws Exception { context.start(); Collection<String> names = context.getComponentNames(); assertThat(names).contains("my-sql-proxy"); assertThat(names).contains("sql-my-sql-proxy"); SqlComponent sqlComponent = context.getComponent("sql-my-sql-proxy", SqlComponent.class); DataSource sqlDatasource = sqlComponent.getDataSource(); assertThat(sqlDatasource).isEqualTo(this.ds); Map<String, Endpoint> endpoints = context.getEndpointMap(); assertThat(endpoints).containsKey("sql-my-sql-proxy://select%20from%20dual"); context.stop(); }
@Validate public void start() throws Exception { camelContext = new DefaultCamelContext(); camelContext.addComponent("activemq", activeMQ.getDefaultActiveMQConnection()); camelContext.addRoutes(this); camelContext.getShutdownStrategy().setTimeout(10); camelContext.getShutdownStrategy().setSuppressLoggingOnTimeout(true); camelContext.start(); camelContext.createProducerTemplate().asyncSendBody("direct:startTimer", ""); init(); }