Dear Community,

Do I miss something or is it not implemented?
I am working with Jasypt Config Encryption. (org.apache.camel.springboot:
camel-jasypt-starter)

Everything works fine if a access the property via:
     @Value("${com.spar-ics.eai.routes.hello.hiddenPassword}")
    private String encryptedPassword;

But via @ConfigurationProperties the value is not encrypted.

I would appreciate any help

Best
 Michael


/**
 * Configuration class for Route dataformat-free
 */
@NoArgsConstructor
@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix ="com.eai.routes.hello")
public class HelloConfig extends RouteConfig {
    private String hiddenPassword;
}


@Component
public class HelloSecureRoute extends RouteBuilder {

    // this works fine
    @Value("${com.spar-ics.eai.routes.hello.hiddenPassword}")
    private String encryptedPassword;

    @Autowired
    HelloConfig routeConfig;

    @Override
    public void configure() throws Exception {

        from("file://data?noop=true")
                .process(exchange -> {
                    LOG.info("Password encrypted:{}", encryptedPassword)
                    LOG.info("Password not encrypted HelloConfig:{}",
routeConfig.getHiddenPassword());
                }
                .log("${body}");
    }

Reply via email to