Is it possible to make JMS selector case insensitive?

931 views Asked by At

I know that the JMS headers properties are case sensitive. But I am working on one requirement where I have to make JMS selctor to not case sensitive. Is it possible to do so? I am using camel and below is the way I am defining my selector in properties file.

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

Camel route :

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


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

         @Override
         public void configure() throws Exception {

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

I tried to use function like UPPER and LOWER but not able to get success. I am defing like below.

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

There are 1 answers

1
Tim Bish On

Have a look at the function calls in selector enhancement that was added to ActiveMQ in this JIRA issue. Using this enhancement you might be able to craft something that fits your needs.

This enhancement allow for some custom function calls to be made with a few built in functions as follows:

    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);