FGRibreau/node-amqp-tool

Payload data has type "Buffer"after importing/exporting messages

Closed this issue · 6 comments

I have a test container with RabbitMQ on localhost. I've published a couple messages to queue "new-queue" and have exported them:

$ cat dump.json 
[{"data":{"type":"Buffer","data":[84,104,105,115,32,105,115,32,109,121,32,70,105,114,115,116,32,109,101,115,115,97,103,101,32,105,110,32,113,117,101,117,101,32,39,110,101,119,45,113,117,101,117,101,39]}},{"Header One":"Val One"},{"headers":{"Header One":"Val One"},"deliveryMode":1,"queue":"new-queue","deliveryTag":{"type":"Buffer","data":[0,0,0,0,0,0,0,1]},"redelivered":false,"exchange":"","routingKey":"new-queue","consumerTag":"node-amqp-12119-0.06312984878420203"}]
[{"data":{"type":"Buffer","data":[84,104,105,115,32,105,115,32,109,121,32,83,101,99,111,110,100,32,109,101,115,115,97,103,101,32,105,110,32,113,117,101,117,101,32,39,110,101,119,45,113,117,101,117,101,39]}},{"Header Two":"Val TWO"},{"headers":{"Header Two":"Val TWO"},"deliveryMode":1,"queue":"new-queue","deliveryTag":{"type":"Buffer","data":[0,0,0,0,0,0,0,2]},"redelivered":false,"exchange":"","routingKey":"new-queue","consumerTag":"node-amqp-12119-0.06312984878420203"}]

Next i've imported them to the recreated RabbitMQ container to the same vhost and queue:

$ amqp-tool --host localhost --port 5672 -u user -p pass  -q new-queue --vhost new-vhost --import dump.json

"Get messages" from queue gives me this:
screenshot from 2018-03-30 11-46-27

Is there a way to get readable Payload in UTF8?

Hum this is weird, are you sure you had the correct (application/json) header in the queued dumped messages?

It's my bad, but there is no difference even if i set up this header:
screenshot from 2018-04-02 09-46-21
Result is the same:
screenshot from 2018-04-02 09-54-51

By convention content_type should be in properties, not header, then publish, then export the queue content

I've already tried. Publish:
screenshot from 2018-04-02 17-36-02
then this queue was exported with amqp-tool. Next .json file was imported. Result is almost the same after the import:
screenshot from 2018-04-02 17-37-17

Dumped file content:

$ cat dump.json 
[null,{},{"parseError":{},"rawData":"This is the message","contentType":"application/json","headers":{},"deliveryMode":1,"queue":"new-queue","deliveryTag":{"type":"Buffer","data":[0,0,0,0,0,0,0,1]},"redelivered":false,"exchange":"","routingKey":"new-queue","consumerTag":"node-amqp-3000-0.9659180289087159"}]

It's my fault. Sorry for that. This issue might be closed now