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