amqp
amqp copied to clipboard
Parameters exceeding maximum length are silently truncated
The library silently truncates parameters exceeding maximum length set by the protocol (see writeShortstr
and writeLongstr
).
That results in many unexpected behaviors such as:
- Unexpected exchanges, queues, rounting keys, etc being used
- Dropping message deliveries without acks or nacks when consumer tag exceeds maximum length (see #306)
I want to provide a pull request for this, so I wonder what would be the best way to fix this. I see two approaches that can possibly be combined:
- Fail
writeShortstr
andwriteLongstr
calls upon truncation - Validate all properties supplied by users in all relevant function calls (e.g. in
Channel.Consume
)
Both approaches break compatibility with older versions. Please, let me know what you think.
Please submit a PR.
I personally would say we should add validation to individual methods (such as Channel#Consume
).
Failing serialization is likely going to return messages that are not as useful as we can make them if we have the complex function invocation context (no pun intended).