I'm trying to establish a communication between RabbitMQ and Javascript, to retrieve the log information that is sent to a RabbitMQ topic, but to no avail. In the console the following information is displayed:
Opening Web Socket...
WebSocket connection to 'ws://10.224.200.196:61613/' failed: WebSocket opening handshake timed out
Whoops! Lost connection to ws://10.224.200.196:61613/
This is my code for connecting to Javascript:
var test = {
client: null,
onConnect: function () {
client.subscribe("add-on", this.onMessage, {ack: 'client'});
console.log('connected');
},
onMessage: function (message) {
console.log(message);
message.ack();
},
onError: function () {
console.log('error');
},
connect: function () {
this.client = Stomp.client('ws://10.224.200.196:61613/', 'v11.stomp');
this.client.connect('test', 'test', this.onConnect, this.onError, '/');
}
};
test.connect();
The user is created in RabbitMQ as "monitoring"
Thestomppluginhasbeenenabled
I'vealreadycreatedthetopicthroughRabbitMQ
IgetthesemessagesintheRabbitMQlog.
=INFOREPORT====4-Oct-2017::08:05:07===acceptingSTOMPconnection<0.672.0>(10.224.200.188:56652->10.224.200.196:61613)=INFOREPORT====4-Oct-2017::08:09:07===closingSTOMPconnection<0.672.0>(10.224.200.188:56652->10.224.200.196:61613)
HowdoIconnectandreceivemessages?
Ihavealreadyusedseveraltutorials,thelastonesbeing:
link