You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My code is dropping a message on an ActiveMQ queue. Node JS using stomp-client is listening on the queue. But a strange thing is happening, client.subscribe surely getting rid of the message from the queue but some how the callback isnt getting executed.
Please help.
`var http = require('http');
var fs = require('fs');
var Stomp = require('stomp-client');
//JADUQ_DEV
//jms/queue/JaduQ
var destination = 'NODEQ_DEV';
var client = new Stomp('127.0.0.1', 61613);
// Loading socket.io
var io = require('socket.io').listen(server);
client.connect(function(sessionId) {
console.log('CONNECT: '+sessionId);
client.subscribe(destination, function(body, headers) {
console.log('DHILLON');
//console.log('This is the body of a message on the subscribed queue:'+body);
});
console.log('END');
// client.publish(destination, 'Oh herrow');
});
// Loading the index file . html displayed to the client
var server = http.createServer(function(req, res) {
fs.readFile('./index.html', 'utf-8', function(error, content) {
res.writeHead(200, {"Content-Type": "text/html"});
res.end(content);
});
});
io.sockets.on('connection', function (socket) {
socket.emit('message', 'You are connected!');
// When the server receives a 'message' type signal from the client
socket.on('message', function (message) {
console.log('A client is speaking to me! TheyӲe saying: ' + message);
});
var interval = setInterval(function() {
socket.emit('eventDapinder','This is a message from the server! ' + new Date().getTime());
},5000);
});
server.listen(8090);`
The text was updated successfully, but these errors were encountered:
My code is dropping a message on an ActiveMQ queue. Node JS using stomp-client is listening on the queue. But a strange thing is happening, client.subscribe surely getting rid of the message from the queue but some how the callback isnt getting executed.
Please help.
`var http = require('http');
var fs = require('fs');
var Stomp = require('stomp-client');
//JADUQ_DEV
//jms/queue/JaduQ
var destination = 'NODEQ_DEV';
var client = new Stomp('127.0.0.1', 61613);
// Loading socket.io
var io = require('socket.io').listen(server);
client.connect(function(sessionId) {
console.log('CONNECT: '+sessionId);
client.subscribe(destination, function(body, headers) {
console.log('DHILLON');
//console.log('This is the body of a message on the subscribed queue:'+body);
});
console.log('END');
// client.publish(destination, 'Oh herrow');
});
// Loading the index file . html displayed to the client
var server = http.createServer(function(req, res) {
fs.readFile('./index.html', 'utf-8', function(error, content) {
res.writeHead(200, {"Content-Type": "text/html"});
res.end(content);
});
});
io.sockets.on('connection', function (socket) {
socket.emit('message', 'You are connected!');
});
server.listen(8090);`
The text was updated successfully, but these errors were encountered: