我想发布消息与路由密钥交换。我要发送的消息是来自有效负载,但路由密钥我在入站属性中输入消息,然后我设置: routingKey =“#[message.inboundProperties.routingKey]”但它无法正常工作
<flow name="ExportToFk" doc:name="ExportToFk">
<vm:inbound-endpoint exchange-pattern="one-way" path="rabbitSenderVM" doc:name="SendToRabbit"/>
<scripting:component doc:name="Groovy">
<scripting:script engine="Groovy"><![CDATA[import org.mule.api.transport.PropertyScope
def xml = payload.xml
def routingKey = payload.routing
println "XML: $xml"
println "ROUTINGKEY: $routingKey"
message.setProperty('routingKey', routingKey, PropertyScope.INBOUND)
return xml]]></scripting:script>
</scripting:component>
<amqp:outbound-endpoint exchangeName="${amqp.exchange}" routingKey="#[message.inboundProperties.routingKey]" responseTimeout="10000" connector-ref="AMQP_Connector" doc:name="AMQP"/>
</flow>