protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); String url = "vm://test-broker?broker.persistent=false&broker.useJmx=false"; ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url); camelContext.addComponent("activemq", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); return camelContext; }
@Override public void consume(CamelContext context, CloudService service) { context.addComponent(componentName, new KuraCloudComponent(context, service)); } };
void replaceTemplatingComponent(Component comp) { if (context.getComponent("templatingComponent") != null) { context.removeComponent("templatingComponent"); } context.addComponent("templatingComponent", comp); }
private void createCamelContext() throws Exception { CamelContext camelContext = getContext(); JmsConnectionFactory connectionFactory = new JmsConnectionFactory("admin", "admin", "amqps://localhost:5671"); JmsComponent jms = JmsComponent.jmsComponent(connectionFactory); AMQPComponent amqp = new AMQPComponent(connectionFactory); camelContext.addComponent("jms", jms); camelContext.addComponent("amqp", amqp); } }
@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(); }
@Validate void doStart() throws Exception { log.info(">>>>Starting OfficeBaseInstance"); evtList.addEventHandler(menu.onSallyFrameMenuRequest(onShowSallyFrameMenu)); context = new DefaultCamelContext(); context.addComponent("activemq", activeMQ.getDefaultActiveMQConnection()); context.addComponent("alex", alexRoute.getAlexComponent()); context.addComponent("sallyservlet", servlet.getCamelComponent()); context.addRoutes(this); context.start(); }
/** * Get the named EventEngine */ public static synchronized EventEngine getEventEngine(CamelContext context, String type) throws Exception { EventRefComponent eventRefComponent = (EventRefComponent) context.getComponent(NAME); if (eventRefComponent == null) { eventRefComponent = new EventRefComponent(); context.addComponent(NAME, eventRefComponent); } return eventRefComponent.getEventEngine(context, type); }
@Override public ServletController init(CamelContext context, ClassLoader loader) { if (context.hasComponent("sallyservlet") == null) { context.addComponent("sallyservlet", servletComponent); } return new ServletController(context, loader).setDebugTemplating(debugTemplate); }
/** * Get the named EventCacheManager */ public static synchronized EventCacheManager getEventCacheManager(CamelContext context, String type) throws Exception { EventRefComponent eventRefComponent = (EventRefComponent) context.getComponent(NAME); if (eventRefComponent == null) { eventRefComponent = new EventRefComponent(); context.addComponent(NAME, eventRefComponent); } return eventRefComponent.getEventCacheManager(context, type); } }
public HttpProxyServiceImpl(CamelContext camelContext) { this.camelContext = camelContext; // Add servlet to the Camel Context ServletComponent servlet = new ServletComponent(); servlet.setCamelContext(camelContext); servlet.setServletName(SERVLET_NAME); if (camelContext != null) { this.camelContext.addComponent(SERVLET_COMPONENT, servlet); } }
@Override protected CamelContext createCamelContext() throws Exception { CamelContext context = super.createCamelContext(); String propertiesLocation = getPropertiesLocation(); if (propertiesLocation != null) { PropertiesComponent properties = new PropertiesComponent(); properties.setLocation(propertiesLocation); context.addComponent("properties", properties); } return context; }
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(); }
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(); }
protected CamelContext createCamelContext() throws Exception { CamelContext answer = new DefaultCamelContext(); // simulate JMS with the Mock component answer.addComponent("jms", answer.getComponent("mock")); // enable connector for remote management answer.getManagementStrategy().getManagementAgent().setCreateConnector(true); return answer; }
@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(); }
@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(); }
protected CamelContext createCamelContext() throws Exception { CamelContext context = super.createCamelContext(); context.addComponent("some-ws-iti", new SomeItiComponent()); DefaultManagementNamingStrategy naming = (DefaultManagementNamingStrategy) context .getManagementStrategy().getManagementNamingStrategy(); naming.setHostName("localhost"); naming.setDomainName("org.apache.camel"); return context; }
@Override protected CamelContext createCamelContext() throws Exception { CamelContext context = super.createCamelContext(); KieComponent kieComponent = new KieComponent(); kieComponent.getConfiguration() .clearBodyParams() .setBodyParam("case", "findProcesses", "page") .setBodyParam("case", "findProcesses", "pageSize"); context.addComponent("kie", kieComponent); return context; }