Package org.apache.camel.builder

Examples of org.apache.camel.builder.ThreadPoolBuilder


    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                // create shared pool and enlist in registry
                pool = new ThreadPoolBuilder(context).poolSize(1).buildScheduled(this, "MySharedPool");
                registry.put("myPool", pool);

                from("file:target/a?scheduledExecutorService=#myPool").routeId("a")
                    .to("direct:shared");
View Full Code Here


*/
public class CustomThreadPoolInlineRouteBuilder extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        CamelContext context = getContext();
        ExecutorService executorService = new ThreadPoolBuilder(context).poolSize(5).maxQueueSize(100).build("CustomThreadPool");

        from("direct:in")
            .log("Received ${body}:${threadName}")
            .threads().executorService(executorService)
            .log("Processing ${body}:${threadName}")
View Full Code Here

public class WireTapCustomThreadPoolRouteBuilder extends RouteBuilder {

    @Override
    public void configure() throws Exception {

        ThreadPoolBuilder builder = new ThreadPoolBuilder(getContext());
        ExecutorService oneThreadOnly = builder.poolSize(1).maxPoolSize(1)
            .maxQueueSize(100).build("JustMeDoingTheTapping");

        from("direct:start")
            .wireTap("direct:tapped").executorService(oneThreadOnly)
            .to("mock:out");
View Full Code Here

TOP

Related Classes of org.apache.camel.builder.ThreadPoolBuilder

Copyright © 2018 www.massapicom. 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.