尝试在 AnyPoint Studio (JMS/ActiveMQ) 中创建简单的 Mule "Listener-to-Queue" 配置... - 为什么会出现超时错误?

Trying to create simple Mule "Listener-to-Queue" configuration in AnyPoint Studio (JMS/ActiveMQ)... -Why the timeout error?

--注意:Mule 和 AnyPoint Studio newby...:-)

尝试在 "devQueue1" 上创建一个简单的侦听器,在收到消息后写入 "devQueue2"。

配置是否存在根本性错误? --似乎 "devQueue2" 是 而不是 被写入... - 或者,"devQueue2" 无法到达(?)。

想知道 Windows 10 环境中是否有任何东西可以阻止访问(???)。令人困惑和沮丧 - 因为简单的 scenario/configuration 看起来 直截了当。

任何help/hints/direction赞赏!!

谢谢! 标准差

每次我在 ActiveMQ 队列上提交字符串消息时都会出现以下错误:"devQueue1"...

ERROR 2019-09-10 12:28:23,469 [[MuleRuntime].cpuLight.13: [muleamq05].muleamq05Flow.CPU_LITE @72b26d13] [event: ] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler: 
********************************************************************************
Message               : Failed to retrieve a Message. Operation timed out after 10000 milliseconds.
Error type            : JMS:TIMEOUT
Element               : muleamq05Flow/processors/0 @ muleamq05:muleamq05.xml:25 (Consume)
Element XML           : <jms:consume doc:name="Consume" doc:id="840110c3-031e-4c06-8d42-d7f08700c0ca" config-ref="JMS_Config" destination="devQueue2" ackMode="IMMEDIATE" contentType="application/json" encoding="UTF-8">
<jms:consumer-type>
<jms:queue-consumer></jms:queue-consumer>
</jms:consumer-type>
</jms:consume>

  (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

WARN  2019-09-10 12:28:23,473 [ActiveMQ Session Task-2] [event: ] org.mule.jms.commons.internal.source.push.JmsMessageListener: An error occurred processing the message, returning it to the queue
org.mule.runtime.api.exception.MuleRuntimeException: org.mule.jms.commons.api.exception.JmsTimeoutException: Failed to retrieve a Message. Operation timed out after 10000 milliseconds
Caused by: org.mule.jms.commons.api.exception.JmsTimeoutException: Failed to retrieve a Message. Operation timed out after 10000 milliseconds
Caused by: org.mule.runtime.api.exception.MuleRuntimeException: Failed to retrieve a Message. Operation timed out after 10000 milliseconds

消息流

configuration.xml(简单的监听器和队列配置)

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd">
    <jms:config name="JMS_Config" doc:name="JMS Config" doc:id="a0ce686e-e63a-4983-b369-31210ef5704b" >
        <jms:active-mq-connection username="admin" password="admin" clientId="client001">
            <jms:factory-configuration brokerUrl="tcp://localhost:61616"/>
        </jms:active-mq-connection>
    </jms:config>
    <flow name="muleamq05Flow" doc:id="d662e3af-7f70-468e-88ac-6a92803cb2ca" initialState="started" maxConcurrency="1">
        <jms:listener doc:name="Listener" doc:id="4968c8e3-0559-4290-bee1-46a89d513288" config-ref="JMS_Config" destination="devQueue1" ackMode="DUPS_OK" inboundContentType="application/json" inboundEncoding="UTF-8">
            <jms:consumer-type >
                <jms:queue-consumer />
            </jms:consumer-type>
            <jms:response persistentDelivery="true">
                <jms:body ><![CDATA[#[%dw 2.0
output application/json
---
payload.AAAAA]]]></jms:body>
                <jms:reply-to destination="devQueue2" />
            </jms:response>
        </jms:listener>
        <jms:consume doc:name="Consume" doc:id="840110c3-031e-4c06-8d42-d7f08700c0ca" config-ref="JMS_Config" destination="devQueue2" ackMode="IMMEDIATE">
            <jms:consumer-type >
                <jms:queue-consumer />
            </jms:consumer-type>
        </jms:consume>
    </flow>
</mule>

问题:为什么侦听器不将收到的消息转发到 "devQueue2"

pom.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycompany</groupId>
    <artifactId>muleamq05</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>mule-application</packaging>

    <name>muleamq05</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <app.runtime>4.2.1</app.runtime>
        <mule.maven.plugin.version>3.2.7</mule.maven.plugin.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-maven-plugin</artifactId>
                <version>${mule.maven.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                <sharedLibraries>
                        <sharedLibrary>
                            <groupId>org.apache.activemq</groupId>
                            <artifactId>activemq-client</artifactId>
                        </sharedLibrary>
                    </sharedLibraries>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-http-connector</artifactId>
            <version>1.5.6</version>
            <classifier>mule-plugin</classifier>
        </dependency>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-sockets-connector</artifactId>
            <version>1.1.5</version>
            <classifier>mule-plugin</classifier>
        </dependency>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-jms-connector</artifactId>
            <version>1.6.2</version>
            <classifier>mule-plugin</classifier>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-client</artifactId>
            <version>5.15.4</version>
        </dependency>
    </dependencies>

    <repositories>
          <repository>
            <id>anypoint-exchange</id>
            <name>Anypoint Exchange</name>
            <url>https://maven.anypoint.mulesoft.com/api/v1/maven</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>https://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-releases</id>
            <name>mulesoft release repository</name>
            <layout>default</layout>
            <url>https://repository.mulesoft.org/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

环境

版本:7.3.5 内部版本号:201909031749

Mule 运行时版本:4.2.1

Mule插件版本:3.2.7

ActiveMQ版本:5.15.9

Jdk版本:1.8

您收到 JMS:TIMEOUT 错误,因为 <jms:consume> 操作读取队列 devQueue2 在执行时未在操作指定的超时时间内找到任何要读取的消息时间。基本上队列是空的,没有什么可读的。

这与设计时可能出现的数据感知问题无关。

对于作为新手在 Mule(和 Anypoint Studio)中遇到的任何绊脚石 - 就像我自己(他不好意思地说) - 简单的解决方案是用 "publish" 类型替换 "consume" 类型的队列小部件队列小部件...

...这是更新的 Mule 配置 xml,

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
    xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
    <jms:config name="JMS_Config" doc:name="JMS Config"
        doc:id="860c7313-b56b-4594-a49f-e58fef7c6bbd">
        <jms:active-mq-connection username="admin"
            password="admin">
            <jms:caching-strategy>
                <jms:default-caching />
            </jms:caching-strategy>
            <jms:factory-configuration brokerUrl="tcp://localhost:61616" />
        </jms:active-mq-connection>
        <jms:consumer-config>
            <jms:consumer-type>
                <jms:queue-consumer />
            </jms:consumer-type>
        </jms:consumer-config>
    </jms:config>
    <flow name="muleamq04Flow" doc:id="e22c256f-b0f8-405b-8abe-2b7f16be3257">
        <jms:listener doc:name="Listener" destination="devQueue1"
            doc:id="860c7313-b56b-4594-a49f-e58fef7c6bbd" config-ref="JMS_Config"
            ackMode="DUPS_OK">
            <jms:response sendCorrelationId="NEVER" sendContentType="false"
                sendEncoding="false" />
        </jms:listener>
        <jms:publish doc:name="Publish" doc:id="60fa045c-d734-482c-bb9c-9f0491b710e8" config-ref="JMS_Config" destination="devQueue2"/>
    </flow>
</mule>