I want save not consumed messages after amq or machine restart. Is this doc actual for ActiveMQ 5.12.1 Release? I try use example from docs and get error:

ERROR | Failed to load: class path resource [activemq.xml], reason: Line 86 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 86; columnNumber: 90; cvc-complex-type.2.4.a: Invalid content was found starting with element 'kahaPersistenceAdapter'. One of '{"http://activemq.apache.org/schema/core":jdbcPersistenceAdapter, "http://activemq.apache.org/schema/core":journalPersistenceAdapter, "http://activemq.apache.org/schema/core":kahaDB, "http://activemq.apache.org/schema/core":levelDB, "http://activemq.apache.org/schema/core":mKahaDB, "http://activemq.apache.org/schema/core":memoryPersistenceAdapter, "http://activemq.apache.org/schema/core":replicatedLevelDB, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected.

This error occurs with almost default config: https://yadi.sk/d/e8tWyIzyk9piV

Well, i replace kahaPersistenceAdapter to kahaDB and restart. And get error:

Attribute 'maxDataFileLength' is not allowed to appear in element 'kahaDB'.

I replace this attribute and ActiveMQ started. I send message to queue, restard amq and my not consumed message gone. What i do wrong?


Well, you just must send special header with message.

$amq_headers['persistent'] = "true";

And your message persisted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.