Hi,

Camel 2.5.0 already support the encrypted password out of box.
Please check out the camel-jasypt[1] component, and you can find more information by go through the unit tests[2] of camel-jasypt.
[1]http://camel.apache.org/jasypt.html
[2]https://svn.apache.org/repos/asf/camel/trunk/components/camel-jasypt/src/test/

On 11/16/10 9:55 AM, yli wrote:

Just some updates:

     I have tried to put the decryption logic in my customized class that
extends Spring's PropertyOverrideConfigurer, but it didn't work.
        Here is the bean definition in the context file.

        <bean class="MyPropertyPlaceholderConfigurer">
         <property name="order" value="0" />
         <property name="locations">
             <list>
                 <value>classpath:myProperty.properties</value>
             </list>
         </property>
     </bean>

      and Java (sudo)code:
      public class MyPropertyOverrideConfigurer extends
PropertyOverrideConfigurer {
      ...
     @Override
     protected void convertProperties(Properties props) {
          for every property in props,
              if property.name="password"{
                 props.remove(property.value)
                 props.setValue(decrypt(property.value))
              }
     }
     ...
  }
      When I was debugging the code, I saw that the "password" property was
decrypted, and stored in the Properties object("props"), however I guess
when I referred to ${properties: password} in<camel:simple>  expression,
Camel still tries to load the password property from myProperty.properties
file and just ignored the value that was already existed in "props" object,
is that what is happening?

      Any thoughts or comments are appreciated.




--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Reply via email to