node-stomp-client
node-stomp-client copied to clipboard
Body is empty when message pushed from log4j appender
The topic message (body) is empty ActiveMQ version - 5.11.0
Am using log4j JMS appender and pushing log messages to a topic. And running stomp client in node js app
When a new log message arrives, the stomp client app responds , but the body is empty
var Stomp = require('stomp-client'); var destination = '/topic/ic'; var client = new Stomp('127.0.0.1', 61613, '', '');
client.connect(function(sessionId) {
client.subscribe(destination, function(body, headers) {
console.log('Mesage');
console.log(body); //This is empty
});
});
It's been a long time with no reply to the previous but I'm getting the same thing in node-red even with a simple insert to a queue, then read the same queue to a debug node. Here is my sample ....
[{"id":"834e4658.8c185","type":"stomp out","z":"f6e20afd.28a988","name":"to Q.NODE.TEST","server":"61b15cf7.d61aa4","topic":"/queue/Q.NODE.TEST","x":370,"y":380,"wires":[]},{"id":"c814c887.2437d8","type":"inject","z":"f6e20afd.28a988","name":"TestMessage","topic":"","payload":"{ "name" : "Node.Test", "some" : "thing" }","payloadType":"json","repeat":"","crontab":"","once":false,"x":130,"y":380,"wires":[["834e4658.8c185","478b51f1.4ae1e8"]]},{"id":"478b51f1.4ae1e8","type":"debug","z":"f6e20afd.28a988","name":"GENERATED","active":true,"console":"false","complete":"true","x":360,"y":440,"wires":[]},{"id":"9c8a77ac.0eb6e8","type":"stomp in","z":"f6e20afd.28a988","name":"from Q.NODE.TEST","server":"61b15cf7.d61aa4","topic":"/queue/Q.NODE.TEST","x":130,"y":500,"wires":[["59bd02e0.996c2c"]]},{"id":"59bd02e0.996c2c","type":"debug","z":"f6e20afd.28a988","name":"READ QUEUE","active":true,"console":"false","complete":"true","x":360,"y":500,"wires":[]},{"id":"61b15cf7.d61aa4","type":"stomp-server","z":"","server":"192.168.0.200","port":"61613","protocolversion":"1.0","vhost":"","reconnectretries":"0","reconnectdelay":"1","name":"Linux-A"}]
P.S. ... all my Node-Red and "nodes" are new as of a few days ago. 01/20/2017
@RayMN happy for a PR if you manage to track down the bug.