Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Camel ValueBuilder case insensitive

Tags:

apache-camel

How can I handle equalsIgnoreCase?

The following can only handle isEqualTo, would it be possible to do this without making anything inside a processor?

@Test
public void testPreicateProperties() throws Exception {
    context.addRoutes(new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:a")
                .setProperty("A", constant("ab"))
                .setProperty("B", constant("aB"))
                .setHeader("A",  constant("ab"))
                .setHeader("B", constant("aB"))
                .choice()
                    .when(PredicateBuilder.and(exchangeProperty("A").isEqualTo(exchangeProperty("B"))))
                        .log("Equal properties")
                    .otherwise()
                        .log("Not Equal properties")
                .endChoice()
                .choice()
                    .when(PredicateBuilder.and(header("A").isEqualTo(header("B"))))
                        .log("Equal headers")
                    .otherwise()
                        .log("Not Equal headers")
                ;
        }
    });

    template.sendBody("direct:a", "body");

    Thread.sleep(1500);

}
like image 405
J2B Avatar asked May 19 '26 14:05

J2B


1 Answers

There is no such support currently. But there is a similar ticket to add that.

  • https://issues.apache.org/jira/browse/CAMEL-8832

That ticket will add equalsIgnoreCase support in the simple language and also for the value builder.

like image 100
Claus Ibsen Avatar answered May 24 '26 00:05

Claus Ibsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!