activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <>
Subject Re: Are JMS Messages stored persistent out of the box?
Date Mon, 22 Jun 2009 12:59:14 GMT
On Mon, Jun 22, 2009 at 6:33 AM, pstein<> wrote:
> bsnyder wrote:
>>> Is this JMS message now out-of-the-box (=by default) kept persistent
>>> (e.g.
>>> in a textfile) until it is fetched from a JMS consumer?
>> Yes, the message is persisted. ActiveMQ 5.x uses the AMQ Message Store
>> as the default persistence store:
> So ok, where is this AMQ Message Store (based on files) physically ?

Yes, it's a file-based persistent store.

> Is it in the whole "data" sub-directory of ActiveMQ or is it in a
> subdirectory (journal, kr-store, localhost)
> of "data" sub-directory?

To my knowledge (and it's been a while since I went through the the
AMQ message store) it makes use of everything in the data directory.

> Are the files of the AMQ Message Store human readable?

No, it uses a random access file for reading and writing the files.

> Can I backup e.g. these files to a safe place then do some app JMS
> operations and later copy the original files back to reset ActiveMQ Message
> Store to the initial state?

There's not much point in backing them up if they're constantly
changing, i.e., messages flowing in/out of the broker constantly.

> In the link you gave me there is a config file "amqPersistenceAdapter"
> mentioned.
> Where is this file? I found no "amqPersistenceAdapter.xml" file in ActiveMQ
> installation directory tree.

There is no such XML file. The amqPersistenceAdapter is how the
AMQPersistenceAdapterFactory class is referenced in the XSD that
governs the ActiveMQ XML configuration file. The XML fragment on that
page is an example of how to configure it in the ActiveMQ XML
configuration file. See the default configuration that comes with
ActiveMQ in the conf/ directory in the file named activemq.xml.

> bsnyder wrote:
>>> How/Where can I define a database (e.g. MySQL) as persistence container?
>> ActiveMQ can be configured to use straight JDBC or journaled JDBC
>> depending on the performance you need:
> Hmm is there a sample on how to configure it for
> - MySQL
> - Oracle?

Yes, in the conf/activemq.xml file there are examples for MySQL and
PostgreSQL. They use a standard Spring beans configuration syntax.

> Which tables/users do I have to create in MySQL/Oracle in advance?

You don't have to create any tables manually. ActiveMQ will create
them automatically.

> How do I tell activemq  to use file based storage (for queues with name
> pattern for*) and database based
> storeage for queues with name pattern bar* ?

Currently you can't mix and match persistence. You must use one type
of persistence for all destinations in ActiveMQ.

perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

ActiveMQ in Action:

View raw message