15.2. JMS 메시지 속성 필터링

JMS 사양에서는 선택기에 사용할 때 String 속성을 숫자 유형으로 변환할 수 없다고 명시되어 있습니다. 예를 들어 메시지에 String 값 21로 설정된 age 속성이 있는 경우 선택기 age > 18이 일치하지 않아야 합니다.For example, if a message has the age property set to the String value 21, the selector age > 18 must not match it. 이 제한 사항은 STOMP 클라이언트가 String 속성을 사용하여 메시지만 보낼 수 있기 때문에 제한됩니다.

문자열을 숫자로 변환하도록 필터 구성

문자열 속성을 숫자 형식으로 변환하려면 접두사 convert_string_expressions:필터 값에 추가합니다.

절차

  • 접두사 convert_string _expressions: 를 원하는 필터에 적용하여BROKER_INSTANCE_DIR/etc/broker.xml 을 편집합니다. 아래 예에서는 age > 18 에서 filter 값을 편집하여 convert_string_expressions:age > 18을 선택합니다.

    <configuration>
      <core>
        ...
        <addresses>
            <address name="myQueue">
               <anycast>
                  <queue name="myQueue">
                    <filter string="convert_string_expressions='age > 18'"/>
                  </queue>
               </anycast>
            </address>
         </addresses>
       </core>
    </configuration>