이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 15. Filter Expressions and Message Selectors


The messaging-activemq subsystem in JBoss EAP 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, refer to the JEE 7 Javadoc for javax.jms.Message.

The filter attribute can be found in several places within the configuration.

  • Predefined Queues. When pre-defining a queue, a filter expression can be defined for it. Only messages that match the filter expression will enter the queue. The configuration snippet below shows a queue definition that includes a filter:

      <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
        ...
        <queue
          name="myQueue"
          filter="<FILTER_EXPRESSION>"
          ...
        />
        ...
      </subsystem>

    To create queue with a selector in the management CLI you would use something like following command:

    jms-queue add --queue-address=<QUEUE_ADDRESS> --selector=<FILTER_EXPRESSION>
  • Core bridges can be defined with an optional filter expression, only matching messages will be bridged. Below is a snippet from a sample configuration file where the messaging-activemq subsystem includes a bridge with a filter.

     <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
        ...
        <bridge
          name="myBridge"
          filter="<FILTER_EXPRESSION>"
          ...
        />
        ...
      </subsystem>
  • Diverts can be defined with an optional filter expression, only matching messages will be diverted. See Diverts for more information. The example snippet below shows a Divert using a filter:

      <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
        ...
        <divert
          name="myDivert"
          filter="<FILTER_EXPRESSION>"
          ...
        />
        ...
      </subsystem>

There are some differences between JMS selector expressions and JBoss EAP messaging core filter expressions. Whereas JMS selector expressions operate on a JMS message, JBoss EAP messaging core filter expressions operate on a core message.

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

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

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동