@@ -0,0 +1,1888 @@
+package com.redhat.samples.camel;%0A%0Aimport org.apache.camel.LoggingLevel;%0Aimport org.apache.camel.RoutesBuilder;%0Aimport org.apache.camel.builder.RouteBuilder;%0Aimport org.apache.camel.component.mock.MockEndpoint;%0Aimport org.apache.camel.test.junit4.CamelTestSupport;%0Aimport org.junit.Test;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0A%0Apublic class InterceptTest extends CamelTestSupport %7B%0A%0A    @Override%0A    protected RoutesBuilder createRouteBuilder() %7B%0A        return new RouteBuilder() %7B%0A            @Override%0A            public void configure() %7B%0A                onException(Throwable.class)%0A                    .handled(true)%0A                    .maximumRedeliveries(3)%0A                    .log(LoggingLevel.ERROR, %22error = $%7Bexception.message%7D%22);%0A                intercept()%0A                    .log(%22***** Intercept **********%22)%0A                    .log(%22from = $%7Bexchange.fromRouteId%7D%22)%0A                    .process(e -%3E %7B%0A                        interceptCount++;%0A                    %7D);%0A                from(%22direct:in%22)%0A                    .to(%22seda:queue1%22)%0A                    .to(%22seda:queue2%22)%0A                    .to(%22mock:out%22);%0A                from(%22seda:queue1%22)%0A                    .to(%22mock:out%22);%0A                from(%22seda:queue2%22)%0A                    .to(%22seda:queue3%22);%0A                from(%22seda:queue3%22)%0A                    .to(%22mock:out%22);%0A            %7D%0A        %7D;%0A    %7D%0A%0A    @Override%0A    protected boolean useJmx() %7B%0A        return true;%0A    %7D%0A%0A    private int interceptCount = 0;%0A%0A    @Test%0A    public void hello() throws Exception %7B%0A        interceptCount = 0;%0A%0A        MockEndpoint out = getMockEndpoint(%22mock:out%22);%0A        out.expectedMessageCount(3);%0A        out.expectedBodiesReceived(%22Hello!%22, %22Hello!%22, %22Hello!%22);%0A%0A        template.sendBody(%22direct:in%22, %22Hello!%22);%0A        out.assertIsSatisfied();%0A        assertThat(interceptCount, is(6));%0A    %7D%0A%0A%7D%0A

Add intercept sample