使用HornetQ在JBoss 7中使用JMS队列的'持久'属性是什么意思? [英] What is the meaning of 'durable' attribute for JMS Queue in JBoss 7 with HornetQ?

查看:136
本文介绍了使用HornetQ在JBoss 7中使用JMS队列的'持久'属性是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用HornetQ在JBoss 7上配置JMS队列期间(基于standalone-full.xml配置)我发现了一个属性'持久'。

During configuration of JMS queues on JBoss 7 with HornetQ (based on standalone-full.xml configuration) I noticed an attribute 'durable'.

我浏览了几个来源,其中许多人表示队列总是持久,这意味着即使潜在的接收者在发送时处于非活动状态,也会始终传递消息。

I browsed several sources and many of them stated queues are always 'durable', meaning the message will be always delivered, even in case of potential receivers being inactive at the time of send.

JBoss 7 HornetQ中的这个属性是指临时队列吗?或者这个属性是指某种非临时的非持久性队列?

Does this attribute in JBoss 7 HornetQ refer to temporary queues? Or does this attribute refer to some kind of non-temporary non-durable queues?

推荐答案

经过简短的调查,我想出了一个几个结论。所有观察都基于JBoss 7.1.1.Final与HornetQ Server 2.2.13.Final。

After brief investigation I came up with a few conclusions. All observations are based on JBoss 7.1.1.Final with HornetQ Server 2.2.13.Final.


  • 非持久队列不是临时队列。它一直存在,直到它被手动删除。

  • The non-durable queue is not a temporary queue. It exists until it's manually deleted.

提交到非持久队列的所有消息在JMS提供程序重启/失败时消失(传递模式,即PERSISTENT / NON_PERSISTENT of提交的消息将被忽略。)

All the messages submitted to non-durable queue vanish upon JMS provider restart/failure (delivery modes, i.e. PERSISTENT / NON_PERSISTENT of the submitted messages are ignored).

不修改消息的JMSDeliveryMode头元素的值。特别是,如果使用PERSISTENT传递模式将消息提交到非持久队列,则该标志将设置为PERSISTENT,即使非持久队列不会保留消息(如果JMS提供程序重新启动/失败,它将丢失) )。

The value of JMSDeliveryMode header element of the messages is not modified. In particular, if the message was submitted with PERSISTENT delivery mode to a non-durable queue, the flag is set to PERSISTENT, even though the non-durable queue does not persist the message (it is lost in case of JMS provider restart/failure).

从客户端来看,这似乎是一个令人不安的前景,因为发件人可能没有由于非持久队列的问题意义,知道是否不会遵守所声明的消息传递模式的方式。

From the client side it seems to be a bit of a disturbing prospect, since the sender has potentially no way of knowing whether the declared delivery mode of the message will not be respected, due to the problematic meaning of 'non-durable' queue.

此外,在此上下文中的术语持久队列似乎与持久订阅脱节,因为它似乎不会影响向任何非活动消费者传递消息方式。

Furthermore, the term 'durable queue' in this context seems disjointed from the 'durable subscription', as it does not appear to affect delivery of messages to inactive consumers in any way.

这篇关于使用HornetQ在JBoss 7中使用JMS队列的'持久'属性是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆