Package org.apache.camel.builder

Examples of org.apache.camel.builder.AdviceWithRouteBuilder


    @Test
    public void testXmlEncryptionDecryption() throws Exception {
        final String cityExistsXPath = "exists(/booksignings/store/address/city)";

        context.getRouteDefinition("encrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("direct:decrypt")
                        .when(xpath(cityExistsXPath))
                            .to("mock:incorrectlyEncrypted");
                }
            });
        context.getRouteDefinition("decrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("mock:out")
                        .when(xpath(cityExistsXPath))
                            .to("mock:correctlyDecrypted");
View Full Code Here


    public void testXmlEncryptionDecryption() throws Exception {
        final Namespaces namespaces = new Namespaces("c", "http://camelcookbook.org/schema/booksignings");
        final String cityExistsXPath = "exists(/c:booksignings/c:store/c:address/c:city)";

        context.getRouteDefinition("encrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("direct:decrypt")
                        .when(namespaces.xpath(cityExistsXPath))
                            .to("mock:incorrectlyEncrypted");
                }
            });
        context.getRouteDefinition("decrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("mock:out")
                        .when(namespaces.xpath(cityExistsXPath))
                            .to("mock:correctlyDecrypted");
View Full Code Here

    public void testXmlEncryptionDecryption() throws Exception {
        final Namespaces namespaces = new Namespaces("c", "http://camelcookbook.org/schema/booksignings");
        final String cityExistsXPath = "exists(/c:booksignings/c:store/c:address/c:city)";

        context.getRouteDefinition("encrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("direct:decrypt")
                        .when(namespaces.xpath(cityExistsXPath))
                            .to("mock:incorrectlyEncrypted");
                }
            });
        context.getRouteDefinition("decrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("mock:out")
                        .when(namespaces.xpath(cityExistsXPath))
                            .to("mock:correctlyDecrypted");
View Full Code Here

    @Test
    public void testXmlEncryptionDecryption() throws Exception {
        final String cityExistsXPath = "exists(/booksignings/store/address/city)";

        context.getRouteDefinition("encrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("direct:decrypt")
                        .when(xpath(cityExistsXPath))
                            .to("mock:incorrectlyEncrypted");
                }
            });
        context.getRouteDefinition("decrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("mock:out")
                        .when(xpath(cityExistsXPath))
                            .to("mock:correctlyDecrypted");
View Full Code Here

    @Test
    public void testXmlEncryptionDecryption() throws Exception {
        final String cityExistsXPath = "exists(/booksignings/store/address/city)";

        context.getRouteDefinition("encrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("direct:decrypt")
                        .when(xpath(cityExistsXPath))
                            .to("mock:incorrectlyEncrypted");
                }
            });
        context.getRouteDefinition("decrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("mock:out")
                        .when(xpath(cityExistsXPath))
                            .to("mock:correctlyDecrypted");
View Full Code Here

    @Test
    public void testXmlEncryptionDecryption() throws Exception {
        final String cityExistsXPath = "exists(/booksignings/store/address/city)";

        context.getRouteDefinition("encrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("direct:decrypt")
                        .when(xpath(cityExistsXPath))
                            .to("mock:incorrectlyEncrypted");
                }
            });
        context.getRouteDefinition("decrypt")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    interceptSendToEndpoint("mock:out")
                        .when(xpath(cityExistsXPath))
                            .to("mock:correctlyDecrypted");
View Full Code Here

    }

    @Test
    public void testSubstitutionOfSlowProcessor() throws Exception {
        context.getRouteDefinition("slowRoute")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    weaveById("reallySlowProcessor").replace()
                        .transform().simple("Fast reply to: ${body}");
                }
View Full Code Here

    private ModelCamelContext context;

    @Test
    public void testOverriddenEndpoints() throws Exception {
        context.getRouteDefinition("modifyPayloadBetweenQueues")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    replaceFromWith("direct:in");

                    interceptSendToEndpoint("activemq:out")
View Full Code Here

    }

    @Test
    public void testOverriddenEndpoints() throws Exception {
        context.getRouteDefinition("modifyPayloadBetweenQueues")
            .adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    replaceFromWith("direct:in");

                    interceptSendToEndpoint("activemq:out")
View Full Code Here

*
*/
public class AdviceWithContextScopedErrorHandlerIssueTest extends ContextTestSupport {

    public void testAdviceWith() throws Exception {
        context.getRouteDefinition("route-a").adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("direct:bar")
                    .skipSendToOriginalEndpoint()
                    .throwException(new IllegalArgumentException("Forced"));
View Full Code Here

TOP

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

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.