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:
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?
By convention content_type should be in properties, not header, then publish, then export the queue content
I've already tried. Publish:
then this queue was exported with amqp-tool. Next .json file was imported. Result is almost the same after the import:
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