M Sach
M Sach

Reputation: 34424

Get the Error: connect ECONNREFUSED while making active MQ Connection?

Activemq.xml has Following configuration using discover Agent

  <transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default?group=TestPartition"/>

I am using stomp module of node.js. Now i need to make the connection to my active mq broker. Not getting how to make the connection using configured discover agent and get the below error

 error: Error: connect ECONNREFUSED
    at errnoException (net.js:769:11)
    at Object.afterConnect [as oncomplete] (net.js:760:19)error name: Error

events.js:71
    throw arguments[1]; // Unhandled 'error' event
               ^
Error: connect ECONNREFUSED
    at errnoException (net.js:769:11)
    at Object.afterConnect [as oncomplete] (net.js:760:19)

Earlier i was using below configuarion(no group was mentioned) and was able to make the connection successfully

 <transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>

Code i was using to make the connection

    var stomp = require("stomp");
    var  stompClient = new stomp.Stomp("localhost", 8161);
    var destHeaders = {
        destination: '/topic/testTopic',
        ack: 'acknowledgeResp'

    };
    client.connect();
    client.on('connected', function() {
        client.subscribe(destHeaders);
       });

Upvotes: 0

Views: 1434

Answers (1)

Tim Bish
Tim Bish

Reputation: 18356

You are attempting to connect a STOMP client to an Openwire transport connector which of course won't work as they are two different protocols. You need to configure a STOMP transport connector for your STOMP clients to connect to.

 <transportConnector name="stomp" uri="stomp://localhost:61613"/>

Upvotes: 1

Related Questions