我正在尝试从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: Sending message: test ERROR 2014-08-07 18:00:42,888 [[testing].testingFlow1.stage1.02] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: Work Descriptor. Root Exception was: Connection refused: connect. Type: class java.net.ConnectException ERROR 2014-08-07 18:00:42,894 [[testing].testingFlow1.stage1.02] org.mule.exception.DefaultMessagingExceptionStrategy: ******************************************************************************** Message : Failed to invoke send. Message payload is of type: String Code : MULE_ERROR--2 -------------------------------------------------------------------------------- Exception stack is: 1. Connection refused: connect (java.net.ConnectException) java.net.DualStackPlainSocketImpl:-2 (null) 2. java.net.ConnectException: Connection refused: connect (com.sun.jersey.api.client.ClientHandlerException) com.sun.jersey.client.urlconnection.URLConnectionClientHandler:148 (null) 3. Failed to invoke send. Message payload is of type: String (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
答案 0 :(得分:1)
布丁的证明是Mule而不是Studio:如果Mule无法连接,那么Studio很可能也不能,但是没有报告问题。
因此,您需要修复msmq:config
元素,直到它起作用。
乍一看,这serviceAddress="machinename/localhost:9000"
看起来非常可疑。如果与MSMQ并置运行,您应该使用实际的计算机名称和端口或localhost
和端口。
答案 1 :(得分:-1)
<?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队列