Send Images using RabbitMQ

人走茶凉 提交于 2020-01-03 02:54:09

问题


I want to transfer an image from a client to the server using RabbitMQ. However, from whatever I read, I understood that RabbitMQ can only transfer a stream of text. So how to transfer an image?


回答1:


The amqp body is a buffer, you can send what you want.

In general, if you want to send a file, you have to read it and send the buffers.

You should send the file using more publish and not just one, then recreate the file on the consumer side.

You should avoid sending big buffer.



来源:https://stackoverflow.com/questions/46072174/send-images-using-rabbitmq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!