【问题标题】:Mule MSMQ flow gives connection refused error in Mule StudioMule MSMQ 流程在 Mule Studio 中出现连接被拒绝错误
【发布时间】:2014-09-30 17:28:31
【问题描述】:

我正在尝试运行来自 Mule 博客的 MSMQ 示例示例。 当我将 MSMQ 设置为全局组件“测试连接”说成功时,这意味着 MSMQ 已设置。好,好到现在。。 现在使用以下流程测试将消息发送到队列:

<msmq:config name="MSMQ" serviceAddress="machinename/localhost:9000" accessToken="XZodtPym+v6NeZs+Sr4+GK9EGdA=" rootQueueName=".\private$\msmq-demo" doc:name="MSMQ"   >
    <msmq:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
</msmq:config>
<flow name="testingFlow1" doc:name="testingFlow1">
    <http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8091" doc:name="HTTP"/>
    <set-payload value="#[header:INBOUND:http.relative.path]" doc:name="Set Payload"/>
    <logger message=" Sending message: #[payload]" level="INFO" doc:name="Logger"/>
    <msmq:send config-ref="MSMQ" doc:name="MSMQ"/>
</flow>

当流在控制台中到达 MSMQ 时,我看到此错误:

INFO 2014-08-07 18:00:41,299 [[testing].testingFlow1.stage1.02] org.mule.api.processor.LoggerMessageProcessor:发送消息:测试 错误 2014-08-07 18:00:42,888 [[testing].testingFlow1.stage1.02] org.mule.retry.notifiers.ConnectNotifier:无法连接/重新连接:工作描述符。根异常是:连接被拒绝:连接。类型:类 java.net.ConnectException 错误 2014-08-07 18:00:42,894 [[testing].testingFlow1.stage1.02] org.mule.exception.DefaultMessagingExceptionStrategy: ****************************************************** ****************************** 消息:调用发送失败。消息有效负载的类型:字符串 代码:MULE_ERROR--2 -------------------------------------------------- ------------------------------ 异常堆栈是: 1.连接被拒绝:connect (java.net.ConnectException) java.net.DualStackPlainSocketImpl:-2 (null) 2. java.net.ConnectException: Connection denied: connect (com.sun.jersey.api.client.ClientHandlerException) com.sun.jersey.client.urlconnection.URLConnectionClientHandler:148(空) 3. 调用发送失败。消息负载的类型:字符串 (org.mule.api.MessagingException) org.mule.modules.msmq.processors.SendMessageProcessor:198 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)

欢迎任何帮助或指导! 为了清楚起见,msmq-config 图片: Test connection succeeds

【问题讨论】:

    标签: java mule mule-studio msmqintegrationbinding mule-component


    【解决方案1】:

    布丁的证据是 Mule 而不是 Studio:如果 Mule 无法连接,那么 Studio 很可能也无法连接,但未能报告问题。

    所以你需要修复 msmq:config 元素直到它工作。

    乍一看,这个serviceAddress="machinename/localhost:9000" 看起来非常可疑。如果与 MSMQ 并置运行,您应该使用实际的机器名称和端口或 localhost 和端口。

    【讨论】:

    • 机器名称我故意更改它以保护隐私。在 msmq 全局元素向导中。按下测试连接后它成功但是当我在流中运行它时它失败了。
    • 嗨大卫,当我将入站 http-component 更改为 request-reply 时,我收到一条消息:“无法调用发送。消息有效负载的类型:字符串”.. 这里有线索??我必须使用 POST 而不是 GET 请求吗?
    • 这只是连接失败的另一个副作用。正如我所说,Studio 说它有效并不一定意味着它有效。如果骡子说不是,骡子是对的。你能成功telnet到你在msmq:config中配置的主机和端口吗?
    • 嗨大卫,为什么 中主机地址的值有一个“+”号..我必须用“localhost”替换它吗? ...
    • 将其替换为 MSMQ 代理在端口 9000 上侦听的相关主机名。如果是 localhost,则使用 localhost。如果是远程主机,请使用主机名。
    【解决方案2】:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:msmq="http://www.mulesoft.org/schema/mule/msmq" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
        xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.2"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
    http://www.mulesoft.org/schema/mule/msmq http://www.mulesoft.org/schema/mule/msmq/current/mule-msmq.xsd
    http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
        <msmq:config name="MSMQ" serviceAddress="x.x.x.:9333" accessToken="wRuoma0PhX4ZHA1vQosdefff="  rootQueueName=".\private$\msmqdemo" ignoreSSLWarnings="true" doc:name="MSMQ"/>
        <flow name="msmqreceiveFlow">
           <set-payload value="Hello" doc:name="Set Payload"/>
        <msmq:send config-ref="MSMQ__MSMQ_Connection" queueName="msmqdemo" doc:name="MSMQ"/>
        <logger message="#[payload]" level="INFO" doc:name="Logger"/>
        </flow>
    </mule>
    

    试试这个例子,我认为服务地址错误。这个例子发送消息到 MSMQ 队列

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-31
      • 1970-01-01
      • 1970-01-01
      • 2018-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多