Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

set property before starting

$
0
0
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詸궉ꥃ穖=0觗ꚦ譞=true닗꧂⬞=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詸궉ꥃ穖=0觗ꚦ譞=true닗꧂⬞=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

Viewing all articles
Browse latest Browse all 5648

Trending Articles