Reputation: 1
I'm working on a project where I need to send large messages through RabbitMQ. However, I'm encountering the following error:
I am using NestJs microservices
"err": { "code": 406, "classId": 60, "methodId": 40 }
Context:
RabbitMQ Version: [Specify your RabbitMQ version]
Client Library: [Specify the client library and version you're using]
Message Size: Approximately [specify size, e.g., 20 MB]
What I've Tried:
Adjusting Queue Arguments:
Set the x-max-length-bytes
argument to 20971520
(20 MB) during queue declaration.
Verified that the queue is declared with the correct arguments.
Increasing frame_max
:
frame_max
to a higher value in the RabbitMQ configuration to accommodate larger frames.Client Configuration:
socketOptions
in Node.js) are configured to handle larger message sizes.Observations:
Sending smaller messages works without any issues.
The error occurs consistently with larger messages.
Questions:
Is there a maximum message size limit in RabbitMQ that I'm exceeding?
Are there additional configurations or best practices for handling large messages in RabbitMQ?
Could the PRECONDITION_FAILED
error be related to other settings or misconfigurations?
Any insights or suggestions would be greatly appreciated. Thank you in advance!
Upvotes: 0
Views: 45
Reputation: 1
I added rabbitmq.conf file with these configs:
max_message_size = 536870912
frame_max = 536870912
and it can now accept larger messages.
Upvotes: 0
Reputation: 1
Increase the frame_max setting to 20 MB (both client and server). Verify no resource limits (e.g., memory or disk quotas) are causing the issue. Consider splitting or compressing the payload if size continues to be an issue. Check RabbitMQ logs for errors beyond the 406 PRECONDITION_FAILED.
Upvotes: 0