[英]HornetQ persistence on Jboss EAP 6.1
So I am using HonetQ on Jboss but I ran into an issue. 所以我在Jboss上使用HonetQ,但是遇到了一个问题。 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. 现在,如果jms消息到达我们的队列,并且突然崩溃或重新启动,我们所有的消息都将丢失。 I have read about enabling persitence on the queues but as I saw this parameter defaults to true. 我已经阅读了有关在队列上启用持久性的信息,但是正如我所看到的,此参数默认为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 ? 还是有像Hornet / Jboss这样的更高级别的配置?
Hope you can help ! 希望你能帮忙!
on jboss hornetQ is configured in the messaging domain of jboss configuration (standalone/domain.xml) 在jboss上hornetQ在jboss配置的消息传递域中配置(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 还请确保未将队列的durable
标志配置为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的JBoss 7中的JMS Queue的'durable'属性是什么意思?
HornetQ persistance is configured with the persistence-enabled
parameter in the the hornetq-configuration.xml
. HornetQ持久persistence-enabled
在hornetq-configuration.xml
persistence-enabled
参数进行hornetq-configuration.xml
。 It should default to true, but maybe setting it explicitely will solve your issue. 它应该默认为true,但是也许明确设置它可以解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.