简体   繁体   中英

HornetQ persistence on Jboss EAP 6.1

So I am using HonetQ on Jboss but I ran into an issue. Right now, if the jms messages arrive to our queues and suddendly there is a crash or a restart all our messages will be lost. I have read about enabling persitence on the queues but as I saw this parameter defaults to true. I have read several questions from other user like "where you using persistence ?" and "was persistence enabled?". What exactly is this persistence they refer to ? At queue level ? Or is there a higher level like a Hornet/Jboss configuration ?

Hope you can help !

on jboss hornetQ is configured in the messaging domain of jboss configuration (standalone/domain.xml)

 <subsystem xmlns="urn:jboss:domain:messaging:1.1">
        <hornetq-server>
            <persistence-enabled>true</persistence-enabled>
            [...]

you can also set it on the message itself while posting it

messageProducer.send(objectMessage, DeliveryMode.PERSISTENT, priority, timeToLive);

also be sure that the queue is not configured with durable flag to false

<jms-queue name="myQueueName">
     <entry name="queue/myQueueName"/>
     <entry name="java:jboss/exported/jms/queue/myQueueName"/>
</jms-queue>

see What is the meaning of 'durable' attribute for JMS Queue in JBoss 7 with HornetQ?

HornetQ persistance is configured with the persistence-enabled parameter in the the hornetq-configuration.xml . It should default to true, but maybe setting it explicitely will solve your issue.

Read more about it here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM