0

I'm trying to run the sample example from Mule blog for MSMQ. When I setup MSMQ as global component "Test connection" says Successful, that means MSMQ is setup. Well and good till now.. Now using the following flow to test sending a message into queue:

<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>

When the flow hits MSMQ in console I see this error:

    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) 

Any help or directions is welcome! msmq-config picture for clarity: Test connection succeeds

shrinathM
  • 362
  • 3
  • 22

2 Answers2

1

The proof of the pudding is Mule not Studio: if Mule can't connect then Studio most probably can't either, but fails to report the issue.

So you need to fix the msmq:config element until it works.

At first glance, this serviceAddress="machinename/localhost:9000" looks highly suspicious. You should either use the actual machine name and port or localhost and port if running collocated with MSMQ.

David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • Machine name I purposefully changed it for privacy.In msmq global element wizard.after pressing Test connection it succeeds but when I run it in flow it fails. – shrinathM Aug 08 '14 at 06:44
  • Hi David, when I changed the inbound http-component to request-reply I got a message saying:"Failed to invoke send. Message payload is of type: String".. Is there a clue here?? Must I use POST instead of GET request? – shrinathM Aug 08 '14 at 07:05
  • It's just another side effect of the connection failing. And as I said, the fact Studio says it's working doesn't necessarily mean it is. If Mule says it's not, Mule is right. Can you successfully telnet to the host and port you've configured in `msmq:config`? – David Dossot Aug 08 '14 at 15:43
  • Hi David, Why the value of Host address in has a '+' sign..Do I have to replace it with 'localhost'? ... – shrinathM Aug 11 '14 at 14:10
  • 1
    Replace it with the relevant host name where the MSMQ broker is listening on port 9000. If it's localhost, then use localhost. If it's a remote host use the host name. – David Dossot Aug 11 '14 at 14:22
  • Thanks David, I wanted to confirm it, after all the attempts I am getting connection refused. Am I only one in the world trying to test run the Mule MSMQ connector? – shrinathM Aug 11 '14 at 14:50
  • This interrop with Microsoft technologies is still quite new so maybe there are not many people using it yet? Maybe the best is to contact MuleSoft directly, – David Dossot Aug 11 '14 at 15:55
-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>

Try this example I think service address is wrong.This example for sending message to MSMQ queue