I want to pass JSON object to the RabbitMQ queue.
In the below code, I am using obj.toJSONString().getBytes()
for converting Json object in to string, Is it possible to pass JSON object in the queue instead passing as string.
We can only send the data as bytes to a rabbitmq queue. So we have to convert the json object into string. In your code snippet, you have done by using the code - obj.toJSONString().getBytes()
. This is the correct approach.