---
schema_version: "1"
id: 464b488c3f276f4ac0ec2ad2ac2b0aed353602a4c553eb55983fa96a33e73375
title: VM Connector の動的ルーティングの例
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/vm-connector/latest/vm-dynamic-routing.md
canonical_url: https://docs.mulesoft.com/jp/vm-connector/latest/vm-dynamic-routing
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 70c5d9664a85dd3327d87876fe101113fb4803728e4f2d2f1fd304e6598e8279
description: MuleSoft Documentation Site
release: "2.0"
latest: true
---
# VM Connector の動的ルーティングの例

式を使用して、特定の条件に応じて異なるキューにメッセージを送信する汎用フローを作成できます。たとえば、​`queueName`​ 属性でも式を使用して、​[パブリッシュおよびリスンの例](https://docs.mulesoft.com/jp/vm-connector/latest/vm-publish-listen)​をより興味深いものにすることができます。

たとえば、HTTP Connector を使用して取得する JSON オブジェクトに、書き込む必要があるキューの名前に直接マップする宛先オブジェクトが含まれている場合、次のようにできます。

```xml
<flow name="publish">
    <http:listener path="/json-here" allowedMethods="POST" config-ref="httpListener" />
    <vm:publish queueName="#[payload.destination]">
        <vm:content>#[payload.body]</vm:content>
    </vm:publish>
    <logger/>
</flow>
```