0

我知道 JMS 标头属性区分大小写。但我正在研究一项要求,我必须使 JMS 选择器不区分大小写。有可能这样做吗?我正在使用骆驼,下面是我在属性文件中定义我的选择器的方式。

accountQueue = ActiveMQqueueJmsComponent:queue:account?selector=money <> ('Dollar')

骆驼路线:

@Value("${consumer.accountQueue}")
   private String accountQueue;


@Bean
   RouteBuilder accountRouteBuilder() {
      return new RouteBuilder() {

         @Override
         public void configure() throws Exception {

            from(accountQueue).to(OrderService)
            }
            }
        }

我尝试使用 UPPER 和 LOWER 之类的功能,但未能成功。我定义如下。

accountQueue = ActiveMQqueueJmsComponent:queue:account?selector=money <> UPPER('Dollar')  // not working
4

1 回答 1

0

查看在此 JIRA 问题中添加到 ActiveMQ 的选择器增强中的函数调用。使用此增强功能,您可能能够制作出适合您需求的东西。

此增强功能允许使用一些内置函数进行一些自定义函数调用,如下所示:

    Message message = createMessage();
    assertSelector(message, "REGEX('1870414179', SessionserverId)", false);
    message.setLongProperty("SessionserverId", 1870414179);
    assertSelector(message, "REGEX('1870414179', SessionserverId)", true);
    assertSelector(message, "REGEX('[0-9]*', SessionserverId)", true);
    assertSelector(message, "REGEX('^[1-8]*$', SessionserverId)", false);
    assertSelector(message, "REGEX('^[1-8]*$', SessionserverId)", false);

    assertSelector(message, "INLIST(SPLIT('Tom,Dick,George',','), name)", false);
    assertSelector(message, "INLIST(SPLIT('Tom,James,George',','), name)", true);

    assertSelector(message, "INLIST(MAKELIST('Tom','Dick','George'), name)", false);
    assertSelector(message, "INLIST(MAKELIST('Tom','James','George'), name)", true);

    assertSelector(message, "REGEX('connection1111', REPLACE(JMSMessageID,':',''))", true);
于 2017-01-06T22:28:08.893 回答