是否可以使JMS选择器不区分大小写?

时间:2017-01-06 15:23:59

标签: spring apache-camel activemq camel-sql

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

accountQueue = ActiveMQqueueJmsComponent:queue:account?selector = money<> ('元&#39)

骆驼路线:

@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

1 个答案:

答案 0 :(得分:0)

查看this JIRA issue中添加到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);