I am making stompit connection to my ActiveMQ Artemis broker and I see no error when calling connect. After some time (in few mins) I see Connection timeout error.
Also, I am not seeing the queue being created (only address) getting created and the message is not seen at the Artemis console.
ActiveMQ Artemis console:
Code:
const stompConnectOptions= {
'host': 'localhost',
'port': 61613,
'connectHeaders': {
'host': '/', 'login': 'admin', 'passcode': 'xxxx', 'heart-beat': '1000,1000'
}
};
const stompit=require ('stompit') const subscribeHeaders= {
'destination': 'emailEvent', 'ack': 'client-individual'
};
const sendHeaders= {
'destination': '/queue/TestEvent', 'content-type': 'text/plain'
};
stompit.connect(stompConnectOptions, (err, client)=> {
if (err) {
console.log("error with stomp connection.");
return;
}
console.log("stomp connected") stompClient=client;
const frame=client.send(sendHeaders);
frame.write('hello');
frame.end();
console.log('hello message sent')
});
ActiveMQ server logs:
2020-01-29 23:33:46,333 WARN [org.apache.activemq.artemis.core.protocol.stomp] AMQ332069: Sent ERROR frame to STOMP client /127.0.0.1:52170: null
2020-01-29 23:33:46,334 WARN [org.apache.activemq.artemis.core.server] AMQ222067: Connection failure has been detected: null [code=REMOTE_DISCONNECT]
2020-01-29 23:33:46,335 WARN [org.apache.activemq.artemis.core.server] AMQ222061: Client connection failed, clearing up resources for session 21617631-4319-11ea-a1bd-24a2e1f3b27a
2020-01-29 23:33:46,337 WARN [org.apache.activemq.artemis.core.server] AMQ222107: Cleared up resources for session 21617631-4319-11ea-a1bd-24a2e1f3b27a
I am new to stompit.