0
想要基于SpEL正则表达式组合路由到通道(以便来自不同主题/有效负载的多个消息可以路由到同一通道)。 试用上面和其他组合使用不同的路由器类型available.Not工作。使用SpEL和正则表达式的卡夫卡通道路由
<int:recipient-list-router input-channel="receiveMessageChannel">
<int:recipient channel="in_channel" selector-expression="headers['topic'] matches #{systemProperties['env'] + '${in.msge.topic}' + '.*'}"/>
<int:recipient channel="email_channel" selector-expression="headers['topic'] matches #{systemProperties['env'] + '${email.msge.topic}' + '.*'}"/>
</int:recipient-list-router>
得到以下错误:org.springframework.expression.spel.SpelParseException:
致EL1049E:(POS 37):意外数据之后 '': '星号(*)'
标题['topic'] = mesge.getPayload()。setHeaders(“topic”,“testTopic”);
任何人都可以提供一些建议。谢谢。
嗨@Gary 感谢您的答复和解释。它工作正常。 – sam