1

For now, I can send a picture through rabbitmq, but don't know how to do it with some additional data, for example, a number.

My guess is that, convert the picture into a base64 string and append it with the number (separated by a unique symbol) then send it to rabbitmq. But is it possible?

Anh Cao
  • 482
  • 7
  • 13

2 Answers2

2

While you can do that, I'm not sure it is the best use of RabbitMQ. The short answer to your question, though, is yes. You can base64 encode the image or convert it to a bytestring. I would recommend using JSON as the message type and then just putting the encoded image in a field on the JSON object to make it easy to work with.

jaredkwright
  • 1,390
  • 2
  • 11
  • 27
0

Besides other mentioned solutions you can store your files at the disk and send only the ID of the file through the RabbitMQ. In such way, your RabbitMQ stays lightweight.

osynavets
  • 1,199
  • 1
  • 12
  • 22