Mule Amqp插件和Mel

时间:2013-07-09 08:59:09

标签: rabbitmq mule amqp mule-studio

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

1 个答案:

答案 0 :(得分:0)

这是一个已知问题,目前正在开发中:https://github.com/mulesoft/mule-transport-amqp/issues/24