Apache Camel: Get properties from within a Processor

Getting properties from within a Processor needs interaction with the exchange object. This can be accomplished by the following code:

public static class MyProccessor implements Processor {

    public void process(Exchange exchange) throws Exception {
        String prop = exchange
                         .getContext()
                              .resolvePropertyPlaceholders("{{my.property}}");
    }
}

Tested on Apache Camel K Runtime 1.16.0, Apache Camel 3.19.0, Minikube v1.29.0 and WSL2 Ubuntu 20.04.4 LTS

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.