Mule vm:connector 在具有域项目的 Mule 3.8 运行时中失败

Mule vm:connector failing in Mule 3.8 runtime with domain project

我是 Mule 社区 3.8 版的新手。当我尝试使用 vm:connector 组件构建域项目时,部署失败并出现以下错误。 Looks Mule 社区不支持 vm:connector 组件。有人可以请教一下吗。

代码片段

<?xml version="1.0" encoding="UTF-8"?>
<mule-domain xmlns="http://www.mulesoft.org/schema/mule/domain" xmlns:core="http://www.mulesoft.org/schema/mule/core"
        xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:context="http://www.springframework.org/schema/context" xmlns:spring="http://www.springframework.org/schema/beans"
        xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:https="http://www.mulesoft.org/schema/mule/https"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/domain http://www.mulesoft.org/schema/mule/domain/current/mule-domain.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd">

<vm:connector name="vm-shared" validateConnections="true" doc:name="VM Connector">
            <core:receiver-threading-profile poolExhaustedAction="WAIT" />
            <vm:queue-profile maxOutstandingMessages="50">
                    <core:default-in-memory-queue-store />
            </vm:queue-profile>
</vm:connector>

错误日志

org.mule.module.launcher.DeploymentInitException: SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'vm:connector'. One of '{"http://www.springframework.org/schema/beans":beans, "http://www.springframework.org/schema/beans":bean, "http://www.springframework.org/schema/context":property-placeholder, "http://www.mulesoft.org/schema/mule/core":abstract-shared-connector, "http://www.mulesoft.org/schema/mule/core":abstract-shared-transaction-manager, "http://www.mulesoft.org/schema/mule/core":abstract-shared-extension}' is expected.
    at org.mule.module.launcher.domain.DefaultMuleDomain.init(DefaultMuleDomain.java:192) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.artifact.ArtifactWrapper.execute(ArtifactWrapper.java:63) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:136) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:58) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:309) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedApp(DefaultArchiveDeployer.java:296) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedArtifact(DefaultArchiveDeployer.java:95) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.DomainArchiveDeployer.deployExplodedArtifact(DomainArchiveDeployer.java:60) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.DomainArchiveDeployer.deployExplodedArtifact(DomainArchiveDeployer.java:32) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.DeploymentDirectoryWatcher.deployExplodedDomains(DeploymentDirectoryWatcher.java:472) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:143) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:134) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:172) ~[mule-module-launcher-3.8.3.jar:3.8.3]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_111]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_111]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_111]
    at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52) ~[mule-module-reboot-3.8.3.jar:3.8.3]
    at org.tanukisoftware.wrapper.WrapperManager.run(WrapperManager.java:2788) ~[wrapper-3.2.3.jar:3.2.3]

VM 作为共享资源仅在企业中: https://docs.mulesoft.com/mule-user-guide/v/3.8/shared-resources

只需使用默认连接器即可:

vm:outbound-endpoint exchange-pattern="request-response" path="yourPathName" vm:inbound-endpoint exchange-pattern="request-response" path="yourPathName"

在很多情况下,我更喜欢 JMS 队列而不是 vms。至少可以在域项目中共享 JMS 连接器。