Home » Java » Spring Boot properties usage in Apache Camel route

Spring Boot properties usage in Apache Camel route

Posted by: admin December 28, 2021 Leave a comment


Is this possible to use Spring Boot properties in Apache Camel route? @Value is working fine but is this possible to directly place in place holders of expressions.

Update: I know PropertiesComponent but which will be one more configuration apart from Applicaiton.yml that I don’t like to have.


  user:     ftpuser1
  password: ftpuser1password  
  path:     /tmp/inputfile/test1

Spring Boot Apache Camel Route:

    private String sftpUser;

    private String sftpHost;

    private String sftpPassword;

    private String sftpInPath;

//this is working

// is this possible something like this?

You can use property placeholders (http://camel.apache.org/properties.html) in Camel like this:



Instead of injecting all you properties to separate fields you can inject your full link like that:

private String fullLink;

Then, you can use it in from method.


Haven’t tried it locally but you could try to use this, by adding this properties component into the camel context( maybe u need to override the camel context configuration). Then you could use {{file.uri}} inside the from parts.

PropertiesComponent pc = new PropertiesComponent();
context.addComponent("properties", pc);