title: Mule MSMQ flow gives connection refused error in Mule Studio
body: <p>I'm trying to run the sample example from Mule blog for <a href="http://www.mulesoft.org/documentation/display/current/MSMQ+Connector" rel="nofollow">MSMQ</a>. 
  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:</p>
  
  <pre><code>&lt;msmq:config name="MSMQ" serviceAddress="machinename/localhost:9000" accessToken="XZodtPym+v6NeZs+Sr4+GK9EGdA=" rootQueueName=".\private$\msmq-demo" doc:name="MSMQ"   &gt;
      &lt;msmq:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/&gt;
  &lt;/msmq:config&gt;
  &lt;flow name="testingFlow1" doc:name="testingFlow1"&gt;
      &lt;http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8091" doc:name="HTTP"/&gt;
      &lt;set-payload value="#[header:INBOUND:http.relative.path]" doc:name="Set Payload"/&gt;
      &lt;logger message=" Sending message: #[payload]" level="INFO" doc:name="Logger"/&gt;
      &lt;msmq:send config-ref="MSMQ" doc:name="MSMQ"/&gt;
  &lt;/flow&gt;
  </code></pre>
  
  <p>When the flow hits MSMQ in console I see this error:</p>
  
  <pre>
      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) 
  </pre>
  
  <p>Any help or directions is welcome!
  msmq-config picture for clarity:
  <a href="http://i.stack.imgur.com/AT1E6.png" rel="nofollow">Test connection succeeds</a></p>