2

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,

Mahi G
  • 391
  • 1
  • 7
  • 16

1 Answers1

2

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.

MaDa
  • 10,511
  • 9
  • 46
  • 84