本文介绍了使用RabbitMQ发送图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用RabbitMQ将图像从客户端传输到服务器.但是,从我所读的内容中,我了解到RabbitMQ只能传输文本流.那么如何传输图像呢?
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?
推荐答案
amqp主体是一个缓冲区,您可以发送所需的内容.
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.
这篇关于使用RabbitMQ发送图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!