我想发布消息以与路由密钥交换。我要发送的消息来自有效负载,但是我在入站属性的消息中设置了路由密钥,然后我设置了: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>