Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Mule FunctionalTestCase中指定特定的VM连接器_Mule - Fatal编程技术网

如何在Mule FunctionalTestCase中指定特定的VM连接器

如何在Mule FunctionalTestCase中指定特定的VM连接器,mule,Mule,我正在尝试使用下面的FunctionalTestCase向VM端点发送消息: @Test public void CreateAddToCalendarOptionsApiTest() throws Exception{ MuleClient client = new MuleClient(muleContext); String payload = "foo"; Map<String, Object> properties = null; Mule

我正在尝试使用下面的FunctionalTestCase向VM端点发送消息:

@Test
public void CreateAddToCalendarOptionsApiTest() throws Exception{

    MuleClient client = new MuleClient(muleContext);
    String payload = "foo";
    Map<String, Object> properties = null;
    MuleMessage result = client.send("vm://processActivity",  payload, properties);
    assertEquals("foo Received", result.getPayloadAsString());

}
如何指定我的client.send(“vm://processActivity”、负载、属性)使用特定的VMConnector?

使用查询参数:

client.send("vm://processActivity?connector=inMemoryVMQueue",  payload, properties);
。。。用您想要使用的任何连接器替换inMemoryVMQueue

它在功能上等同于端点属性。

“vm://test?connector=vm”在查询路径中的定义如下所示

public void test()抛出多个异常{
MuleMessage message=新的默认MuleMessage(“ts”,muleContext);
MuleMessage reply=muleContext.getClient().send(“vm://test?connector=vm”,message);

}

这是一个了不起的信息宝库。谢谢你,大卫!你知道关于构建Mule URL的一般文档吗?我在这里找到了一个关于Mule URI的好页面:Mulesoft将此类信息隐藏在文档中,这真是令人失望。我也希望能在Mule书籍中找到类似的提示,但事实似乎并非如此:/@GuidoN请看第二版《Mule in Action》第12.2.1节。@David Dossot。是的,正如已经强调的那样,这里提到了连接器参数是必要的。此外,这并不直观,因为连接器可以很容易地从端点配置中检索。羞耻:/
client.send("vm://processActivity?connector=inMemoryVMQueue",  payload, properties);