activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Merzliakov <>
Subject Re: encrypt database password in broker-config.xml
Date Thu, 22 Oct 2009 01:33:18 GMT

I created a custom encryptor class allowing encrypted passwords to be stored
in (but this could be adapted to any Spring
configuration file. The encryptor decrypts passwords on app context
initialization and stores plaintext versions in memory.

My activemq.xml (5.2) looks like this

    <!-- This bean loads the passwords defined here into Spring's
        Passwords are stored in memory in plain text -->
    <bean id="encryptor" class="nsw.osr.esb.crypto.Encryptor">
        <property name="location" 
value="${activemq.base}/conf/" />

    <!-- Allows us to use system properties as variables in this
configuration file -->
        <property name="properties" ref="encryptor"/>

The encrypted property names have a '?' char in front to distinguish
encrypted from unencrypted properties:

# Password for certificate store
# some other password e.g. not a production environment that can be

These can then be referenced in any activemq config file as

I have attached my encryptor class 

The way to generate the encrypted passwords is to use a command line utility
I wrote (using standard J2SE algorithms) and then paste ciphertext into your
config file.

These are attached as well 

Mail me if this is unclear.

Serge wrote:
> Hi,
> I want to store encrypted database password in broker-config.xml file? Is
> there a way that activemq correctly decrypts while connecting to database.
> Thanks, 
> PG

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message