Search in sources :

Example 36 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class ZipkinOneRouteFallbackScribe method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = super.createCamelContext();
    zipkin = new ZipkinTracer();
    // no service so should use fallback naming style
    // we do not want to trace any direct endpoints
    zipkin.addExcludePattern("direct:*");
    zipkin.setIncludeMessageBody(true);
    zipkin.setSpanCollector(new ScribeSpanCollector(ip, 9410));
    // attaching ourself to CamelContext
    zipkin.init(context);
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext) ScribeSpanCollector(com.github.kristofa.brave.scribe.ScribeSpanCollector) ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Example 37 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class ZipkinOneRouteScribe method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = super.createCamelContext();
    zipkin = new ZipkinTracer();
    // we have one route as service
    zipkin.addClientServiceMapping("seda:cat", "cat");
    zipkin.addServerServiceMapping("seda:cat", "cat");
    zipkin.setSpanCollector(new ScribeSpanCollector(ip, 9410));
    // attaching ourself to CamelContext
    zipkin.init(context);
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext) ScribeSpanCollector(com.github.kristofa.brave.scribe.ScribeSpanCollector) ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Example 38 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class ZipkinSimpleRouteScribe method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = super.createCamelContext();
    zipkin = new ZipkinTracer();
    // we have one route as service
    zipkin.addClientServiceMapping("seda:dude", "dude");
    zipkin.addServerServiceMapping("seda:dude", "dude");
    zipkin.setSpanCollector(new ScribeSpanCollector(ip, 9410));
    // attaching ourself to CamelContext
    zipkin.init(context);
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext) ScribeSpanCollector(com.github.kristofa.brave.scribe.ScribeSpanCollector) ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Example 39 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class ZipkinTwoRouteScribe method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = super.createCamelContext();
    zipkin = new ZipkinTracer();
    // we have 2 routes as services
    zipkin.addClientServiceMapping("seda:cat", "cat");
    zipkin.addServerServiceMapping("seda:cat", "cat");
    zipkin.addClientServiceMapping("seda:dog", "dog");
    zipkin.addServerServiceMapping("seda:dog", "dog");
    // capture message body as well
    zipkin.setIncludeMessageBody(true);
    zipkin.setSpanCollector(new ScribeSpanCollector(ip, 9410));
    // attaching ourself to CamelContext
    zipkin.init(context);
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext) ScribeSpanCollector(com.github.kristofa.brave.scribe.ScribeSpanCollector) ZipkinTracer(org.apache.camel.zipkin.ZipkinTracer)

Example 40 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class CamelContextCompleter method complete.

public int complete(Session session, CommandLine commandLine, List<String> candidates) {
    try {
        StringsCompleter delegate = new StringsCompleter();
        List<CamelContext> camelContexts = getLocalCamelContexts();
        for (CamelContext camelContext : camelContexts) {
            delegate.getStrings().add(camelContext.getName());
        }
        return delegate.complete(session, commandLine, candidates);
    } catch (Exception e) {
    // nothing to do, no completion
    }
    return 0;
}
Also used : CamelContext(org.apache.camel.CamelContext) StringsCompleter(org.apache.karaf.shell.support.completers.StringsCompleter)

Aggregations

CamelContext (org.apache.camel.CamelContext)1478 Test (org.junit.Test)691 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)684 RouteBuilder (org.apache.camel.builder.RouteBuilder)448 ProducerTemplate (org.apache.camel.ProducerTemplate)434 ConnectionFactory (javax.jms.ConnectionFactory)220 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)210 Exchange (org.apache.camel.Exchange)109 HashMap (java.util.HashMap)93 Endpoint (org.apache.camel.Endpoint)52 DefaultExchange (org.apache.camel.impl.DefaultExchange)50 IOException (java.io.IOException)46 Map (java.util.Map)45 SimpleRegistry (org.apache.camel.impl.SimpleRegistry)44 CountDownLatch (java.util.concurrent.CountDownLatch)42 SpringCamelContext (org.apache.camel.spring.SpringCamelContext)42 ArrayList (java.util.ArrayList)41 Processor (org.apache.camel.Processor)40 PropertiesComponent (org.apache.camel.component.properties.PropertiesComponent)37 CamelExecutionException (org.apache.camel.CamelExecutionException)33