hapi-rabbit icon indicating copy to clipboard operation
hapi-rabbit copied to clipboard

Should not JSON.parse(message) actually be JSON.stringify(message)?

Open zymplsi opened this issue 10 years ago • 0 comments

Nice work! But ran into an error when subscribed data is received from RabbitMQ. I got if fixed by changing JSON.parse(message) to JSON.parse(message)

hapi-rabbit/lib/index.js

                    sub.on('data', function (message) {

                        // callback(null, JSON.parse(message)); -> throw an error
                        callback(null, JSON.stringify(message));

                    });

zymplsi avatar Apr 21 '15 08:04 zymplsi