I'm working on a project using go and rabbitmq. When I publish a large amount of messages, some messages are not published to the queue.
I am using the following code to publish messages in queue
func Publish(queue commonModel.Queue, content []byte) commonModel.Queue {
error := queue.Channel.Publish(
"",
queue.Name,
false, // mandatory
false, // immediate
amqp.Publishing{
DeliveryMode: amqp.Persistent,
ContentType: "application/json",
Body: []byte(content),
})
queue.Error = error
return queue
}
Does anyone have any idea why some messages are not published in the queue?