Java 在活动MQ中显示“挂起消息数”是否存在任何错误?

Java 在活动MQ中显示“挂起消息数”是否存在任何错误?,java,web-services,activemq,mule,esb,Java,Web Services,Activemq,Mule,Esb,我们正在为我们的Web服务使用活动mq和Mule ESB JMS。它工作得很好。但问题是,即使请求从队列转发到我的服务,经过处理并返回响应,但仍在活动MQ web控制台中,显示请求总数的挂起消息数。 Web控制台:: 流程图 Mule中的流量为: <jms:activemq-connector name="Active_MQ" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"

我们正在为我们的Web服务使用活动mq和Mule ESB JMS。它工作得很好。但问题是,即使请求从队列转发到我的服务,经过处理并返回响应,但仍在活动MQ web控制台中,显示请求总数的挂起消息数。 Web控制台::

流程图

Mule中的流量为:

<jms:activemq-connector name="Active_MQ" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"/>
    <flow name="vbrtestmulejmsFlow1" doc:name="vbrtestmulejmsFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8888" doc:name="HTTP" path="AMServices">
         <set-property propertyName="Content-Type" value="text/xml"/>
        </http:inbound-endpoint>
        <object-to-string-transformer doc:name="Object to String" mimeType="text/xml"/>
        <jms:outbound-endpoint queue="servicesQueue" connector-ref="Active_MQ" doc:name="JMS" responseTimeout="1000000" mimeType="text/xml" >
        </jms:outbound-endpoint>

        <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="5050" path="MyServices" method="POST" doc:name="HTTP" contentType="text/xml">
          <set-property propertyName="Content-Type" value="text/xml"/>
        </http:outbound-endpoint>
    </flow>

您的流将入站HTTP端点接收到的消息发送到JMS出站端点和HTTP出站端点

因此,预计servicesQueue将包含6条消息,同时MyServices将被调用6次

您的意图尚不清楚,但如果您想让servicesQueue充当入站和出站HTTP端点之间的中介,那么您需要将流分为两部分:

<flow name="AMServiceToQueue">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost"
          port="8888" path="AMServices">
     <set-property propertyName="Content-Type" value="text/xml"/>
    </http:inbound-endpoint>
    <object-to-string-transformer mimeType="text/xml"/>

    <jms:outbound-endpoint queue="servicesQueue" connector-ref="Active_MQ"
         exchange-pattern="request-response" responseTimeout="1000000" />
</flow>

<flow name="QueueToMyServices">
    <jms:inbound-endpoint queue="servicesQueue" connector-ref="Active_MQ"
         exchange-pattern="request-response" />

    <http:outbound-endpoint exchange-pattern="request-response" host="localhost"
          port="5050" path="MyServices" method="POST" contentType="text/xml">
      <set-property propertyName="Content-Type" value="text/xml"/>
    </http:outbound-endpoint>
</flow>

我不确定我是否理解,您的流只是将消息放入队列中,而您从未将其删除。那么,它们留在队列上不是正确的吗?不,它应该转发到MyServices,它们位于localhost:5050/MyServices。但是现在请求被转发到Myservices,并将响应返回到我的SOAPUI。但它仍然显示在挂起的消息中,这是不可能调试的,因为您没有共享任何关于JMS消费者的信息。如果用Mule JMS入站端点替换JMS消费者,您是否会遇到同样的问题?这是解决我所有问题的唯一解决方案。非常感谢@David Dossot.: