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

Chapter 12. Filter Expressions


HornetQ provides a powerful filter language based on a subset of the SQL 92 expression syntax.
It is the same as the syntax used for JMS selectors, but the predefined identifiers are different.
Filter expressions are used in several places in HornetQ.
  • Predefined Queues. When pre-defining a queue, either in <JBOSS_HOME>/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-configuration.xml or JBOSS_DIST/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-jms.xml a filter expression can be defined for a queue. Only messages that match the filter expression will enter the queue.
  • Core bridges can be defined with an optional filter expression, only matching messages will be bridged (see Chapter 34, Core Bridges).
  • Diverts can be defined with an optional filter expression. Only matching messages will be diverted (see Chapter 33, Diverting and Splitting Message Flows).
  • Filters are also used programmatically when creating consumers, queues and in several places as described in Chapter 28, Management.
There are some differences between JMS selector expressions and HornetQ core filter expressions. Whereas JMS selector expressions operate on a JMS message, HornetQ core filter expressions operate on a core message.
The following identifiers can be used in a core filter expression to refer to attributes of the core message in an expression:
HQPriority
To refer to the priority of a message. Message priorities are integers with valid values from 0 - 9. 0 is the lowest priority and 9 is the highest. For example, HQPriority = 3 and department = 'payroll'. This refers to a message with a priority of three and a department of 'payroll'.
HQExpiration
To refer to the expiration time of a message. The value is a long integer.
HQDurable
To refer to whether a message is durable or not. The value is a string with valid values: DURABLE or NON_DURABLE.
HQTimestamp
The time stamp of when the message was created. The value is a long integer.
HQSize
The size of a message in bytes. The value is an integer.
Any other identifiers used in core filter expressions will be assumed to be properties of the message.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat