此内容没有您所选择的语言版本。

Chapter 23. Queue Attributes


Queue attributes can be set in one of two ways; by configuring them using the configuration file or by using the core API. This chapter will explain how to configure each attribute and what effect the attribute has.

23.1. Predefined Queues

Queues can be predefined through configuration at a core level or at a JMS level. First look at a JMS level.
JMS Level

The following shows a queue predefined in the JBOSS_DIST/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-jms.xml configuration file.

<queue name="selectorQueue">
   <entry name="/queue/selectorQueue"/>
   <selector string="color='red'"/>
   <durable>true</durable>
</queue>
Copy to Clipboard Toggle word wrap
This name attribute of <queue> defines the name of the queue. When doing this at a JMS level a naming convention is followed so the actual name of the core queue will be jms.queue.selectorQueue.
The mandatory <entry> element configures the name used to bind the queue to JNDI. <queue> can contain multiple <entry> elements to bind the same queue to different names.
The optional <selector> element defines what JMS message selector the predefined queue will have. Only messages that match the selector will be added to the queue. When omitted from the <queue> the default value is null.
The optional <durable> element specifies whether the queue is persisted. When omitted from the <queue> the default value is true.
Core Level

A queue can be predefined at a core level in the <JBOSS_HOME>/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-configuration.xml file.

<queues>     
   <queue name="jms.queue.selectorQueue">
      <address>jms.queue.selectorQueue</address>
      <filter string="color='red'"/>
      <durable>true</durable>
</queues>
Copy to Clipboard Toggle word wrap
This is very similar to the JMS configuration, with the following exceptions:
  1. The name attribute of queue is the actual name used for the queue with no naming convention as in JMS.
  2. The address element defines what address is used for routing messages.
  3. There is no entry element.
  4. The filter uses the Core filter syntax (described in Chapter 12, Filter Expressions), not the JMS selector syntax.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat