0

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
Kenster
  • 23,465
  • 21
  • 80
  • 106
bvyas
  • 384
  • 3
  • 10
  • [Article](http://stackoverflow.com/questions/31969274/apache-mq-jms-message-selector) might help you to resolve your query. – Avadhut Jan 06 '17 at 20:32

1 Answers1

0

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);
Tim Bish
  • 17,475
  • 4
  • 32
  • 42
  • Thanks @Tim Bish for reply. however I used below syntax but no luck so far. ActiveMQqueueJmsComponent:queue:account?selector=money <> '"REGEX(^[\p{DOLLAR}\p{dollar} ._-]*$)"'. I think the link you post which is to make customize/apply function on selector while publishing. But I am looking for regex while subscription scenario. Below is the way I am subscribing from queue(also shown in question). – bvyas Jan 11 '17 at 20:37