Hi,

I wrote this route :

@Component
public class MassPaymentInRoute extends SpringRouteBuilder {
    @Value("${user.password}")
    String cryptedPwd;
        
    String decryptedPwd;

    @Override
           public void configure() {


              Cipher cs = new Cipher();
               try {
                        decryptedPwd = cs.decrypt(cryptedPwd);
                        getContext().getProperties().put("*decPwd*", 
decryptedPwd);
                                                
                        // getContext().
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }

            .from("{{source.endpoint.1}}")
etc.....


The value {{source.endpoint.1}} is defined in a properties file :

source.endpoint.1=ftp://${user.name}:${properties:{{decPwd}}@xxxxxx//echange/MassPayment/IN/?noop=false&initialDelay=0&idempotent=true&stepwise=false



but when i run it , i get this message :
"Property with key [decPwd] not found in properties from text"


I also try to use the function decrypt directly in the properties file, like
this :
source.endpoint.1=ftp://${user.name}:#{cipher.decrypt('${user.password}')}@xxxxxx//echange/MassPayment/IN/?noop=false&initialDelay=0&idempotent=true&stepwise=false

cipher is defined in the camel context

but it doesn't work...


What is the best way to get my password decrypted ?

thank's in advance




--
View this message in context: 
http://camel.465427.n5.nabble.com/set-property-before-starting-tp5744088.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to