jmsejb-jar.xml

Reg ex for activation-config-property-value


Can I give a regex pattern for activation-config-property-value in ejb-jar.xml?

instead of something like this.

<activation-config-property>
<activation-config-property-name>messageSelector</activation-config-property-name>
<activation-config-property-value>header='90S' or header='90MS' or header='92S' or header='97S' or header='89S' or header='96CDS'</activation-config-property-value>
</activation-config-property>

I need something like,

<activation-config-property>
<activation-config-property-name>messageSelector</activation-config-property-name>
<activation-config-property-value>header='%S%'</activation-config-property-value>
</activation-config-property>

Please suggest.

Thanks,


Solution

  • The short answer is: no. Not in JMS message selectors as described by the JMS API

    The closest you can get to a regular expression is the "LIKE" construct, like in SQL:

    header LIKE 9%S // matches 9.*S
    header LIKE 9_S // matches 9.S
    

    It will let you simplify your selector, but it's still far from regex' flexibility.