开发者

Reg ex for activation-config-property-value

开发者 https://www.devze.com 2023-04-12 08:03 出处:网络
Can I give a regex pattern for activation-config-property-value in ejb-jar.xml? instead of something like this.

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

instead of something like this.

<activati开发者_如何学运维on-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,


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号