Hi,

One way I could think of is to configure your broker using an external config file (i.e. activemq.xml) and just change the dataSource of the persistence adapter to postgres. Example:
https://svn.apache.org/repos/asf/incubator/activemq/trunk/assembly/src/release/conf/activemq.xml

Just uncomment the postgres-ds bean and uncomment the reference in the persistence adapter.

And use that config file to configure your embedded broker. i.e.
brokerURL="vm://localhost?brokerConfig=xbean:activemq.xml" <- assuming activemq.xml is in the classpath

or

brokerURL="vm://localhost?brokerConfig=xbean:file:c:/activemq.xml" <- for file path referencing

Hope this helps.

Regards,
Adrian Co

petera wrote:
Hi,

I am using ActiveMQ 4.0.1 running under Tomcat 5.5.17. I would like to
persist the messages to a Postgres database rather than the default
apache-derby database.

What additional config parameters do I need to set in my context.xml file.


TIA Peter


context.xml:

<Context antiJARLocking="true">

    <Resource
        name="jms/ConnectionFactory"
        auth="Container"
        type="org.apache.activemq.ActiveMQConnectionFactory"
        description="JMS Connection Factory"
        factory="org.apache.activemq.jndi.JNDIReferenceFactory"
        brokerURL="vm://localhost"
        brokerName="LocalActiveMQBroker"
        useEmbeddedBroker="false"/>

    <Resource name="jms/MyTopic"
        auth="Container"
        type="org.apache.activemq.command.ActiveMQTopic"
        factory="org.apache.activemq.jndi.JNDIReferenceFactory"
        physicalName="MY.TEST.FOO"/>

    <Resource name="jms/MyQueue"
        auth="Container"
        type="org.apache.activemq.command.ActiveMQQueue"
        factory="org.apache.activemq.jndi.JNDIReferenceFactory"
        physicalName="MY.TEST.BAR"/>

</Context>



Reply via email to