Link to home
Start Free TrialLog in
Avatar of Aneesh Babu
Aneesh Babu

asked on

ActiveMQ store path

I am using a java web application on Tomcat 9.0 server with ActiveMQ 5. Below is the broker config at context.xml, it works.

<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="true"/>

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

It always creates the persistence store directory activemq-data inside tomcat bin folder, adding what parameter I can redirect the store content to my own directory which is outside of tomcat folder. Please help.
Avatar of girionis
girionis
Flag of Greece image

Add this to the startup arguments:

-Dactivemq.store.dir=<path to your folder>

Open in new window

Avatar of Aneesh Babu
Aneesh Babu

ASKER

Thanks for your response, I have tried it having like below setting in setenv.bat, but no luck. It still creates in bin folder.

set JAVA_OPTS="... -Dactivemq.store.dir=C:\Temp"
Do you change it in the right place? Look at Tomcat's log, at the startup options, and verify it's there.
Yes, i could see it in the startup log, it has been taken as a command line argument.
Guys, any resolution for me? Thanks ...
Can you try this?

-Dorg.apache.activemq.default.directory.prefix

Open in new window

I used it this way in setenv.bat, but no luck.
set JAVA_OPTS="... -Dorg.apache.activemq.default.directory.prefix=C:\Temp"
Well, these are the official switches, if they do not work I am not sure what else to try.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.