Inlined:
On 23 Apr 2008, at 10:37, Ivan Jovanovic wrote:
Hi guys
I managed to make my ActiveMQ broker persistent - however I'm not
quite sure
if it's running the way it should. Every time i start up the broker,
it
writes the following to the log:
INFO KahaStore - Kaha Store using data directory
/usr/local/activemq/activemq-data/kr-store/state
INFO AMQPersistenceAdapter - Active data files: []
WARN AMQPersistenceAdapter - The ReferenceStore is not
valid -
recovering ...
INFO KahaStore - Kaha Store successfully
deleted data
directory /usr/local/activemq/activemq-data/kr-store/data
INFO AMQPersistenceAdapter - Journal Recovery Started from:
DataManager:(data-)
INFO KahaStore - Kaha Store using data directory
/usr/local/activemq/activemq-data/kr-store/data
INFO AMQPersistenceAdapter - Recovered 310047 operations
from redo
log in 212.301 seconds.
INFO AMQPersistenceAdapter - Finished recovering the
ReferenceStore
Obviously, recovering from the journal (= redo log, correct?) is
quite slow.
Shouldn't ActiveMQ recover from the Kaha Reference Store instead?
Unfortunately, I'm getting a "The ReferenceStore is not valid" all
the time.
The actual messages are stored in the redo log - the message
references only are held in Kaha
Here's my config:
<broker xmlns="http://activemq.org/config/1.0" brokerName="localhost"
persistent="true" useShutdownHook="false"
dataDirectory="${activemq.base}/data">
<!-- The transport connectors ActiveMQ will listen to -->
<transportConnectors>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors>
<!-- Use the following if you wish to configure the journal with
JDBC
-->
<persistenceAdapter>
<amqPersistenceAdapter directory="${activemq.base}/activemq-data"
maxFileLength="32mb"/>
</persistenceAdapter>
</broker>
Unless you shutdown the broker cleanly - (shutdownHook helps!) - the
reference store assumes that the it could be in an invalid state and
regenerates itself from the redo logs.
Aside from that, I have some other questions:
1. Persistent messages that are recovered on startup don't appear in
the
admin console. However, I'm able to subscribe and receive them, which
confuses the console even more and makes it show a negative number in
"Number Of Pending Messages". Is this normal or is it related to the
fact,
that my messages are not properly persisting?
Interesting - will look into that. The messages are really persisted
btw.
2. ActiveMQ chokes (it sometimes takes seconds until the messages
start
arriving), when trying to receive recovered messages after startup
(at least
for > 100k messages). I guess, that's normal, since it's a lot of
messages... is that correct?
Yes
3. What's the useShutdownHook="false" for, which I see in all
ActiveMQ conf
examples?
The shutdownHook can take a while to run sometimes - which can in turn
hang the JVM as the JVM tries to shutdown - so enable it with care
Thanks in advance! & Cheers!
Ivan
--
View this message in context:
http://www.nabble.com/Slow-recovering-of-persistent-messages-tp16833568s2354p16833568.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
Hope that helps a little
cheers,
Rob
http://open.iona.com/ -Enterprise Open Integration
http://rajdavies.blogspot.com/