queue 的过滤器在 ActiveMQ Artemis 中应该采用什么格式?

What format should a queue's filter have in ActiveMQ Artemis?

我需要有关 ActiveMQ Artemis 过滤器的信息。我查看了官方文档,但找不到足够的解释。 我可能遗漏了一些要评论的内容。

如果有任何示例或资源,我将不胜感激。

关于“格式”(即语法)the filter documentation 声明:

Apache ActiveMQ Artemis 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. For documentation on JMS selector syntax please the JMS javadoc for javax.jms.Message.

具体来说,请参阅 aforementioned JavaDoc 中的整个 Message Selectors 部分以获取选择器语法的完整说明。

有一些特殊的消息属性可以在过滤器中与任何实际消息一起使用 属性。正如文档所述:

The following identifiers can be used in a core filter expressions to refer to attributes of the core message in an expression:

  • AMQPriority. 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. E.g. AMQPriority = 3 AND animal = 'aardvark'

  • AMQExpiration. To refer to the expiration time of a message. The value is a long integer.

  • AMQDurable. To refer to whether a message is durable or not. The value is a string with valid values: DURABLE or NON_DURABLE.

  • AMQTimestamp. The timestamp of when the message was created. The value is a long integer.

  • AMQSize. 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.