-
Describe the bugRabbitMQ 3.13.x does not include the Reproduction stepsNot an expert in AMQP tooling but this is the simplest way I could think of to reproduce the discrepancy:
Expected behaviorWhen consuming a message from a queue the Additional contextWe ran into this issue because the type definitions for the typescript AMQP client we are using ( |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
I'm not entirely sure why you expect the headers to be present for messages that have no headers. This does not make much sense in general. The fact that 3.12 worked that way does not mean much, there were many revisited decisions from the original years of RabbitMQ starting with at least 3.9.0. The TypeScript library you are referring to can be updated to make the field an #5077 uses a more efficient format internally, by design. Similarly, the HTTP API in 3.13 intentionally dropped some other rarely used fields in much more commonly used than this. This resulted in a 25% traffic decrease and lower CPU burn, because serializing a document with some 70 fields is not cheap, and if you can remove, say, 10 of them, that helps. |
Beta Was this translation helpful? Give feedback.
-
For example, no client library that the RabbitMQ core team maintainers has made this decision to assume that headers are always present. You can claim that that's because we still support older versions of Java and .NET, or some clients are for dynamically typed languages. Well, there is an excellent Rust client that assumes that the headers map is optional. The TypeScript client in question can decide to inject an empty map into deserialzied Why should RabbitMQ waste CPU cycles and bandwidth to do something that does not make much sense semantically, is not mentioned at all in the AMQP 0-9-1 spec, and is not needed or expected by many other client libraries? Wouldn't it make more sense for the TypeScript client to insert an empty headers map, or switch to |
Beta Was this translation helpful? Give feedback.
-
Finally, none of the clients Team RabbitMQ maintainers needed any tweaking for #5077. The same client works just fine against a 3.7 node from years ago as it does against a 3.13.0 node. This sounds like a client-specific behavior to me, and a very easy to address one. It's not like we have introduced a fundamentally new way of serializing deliveries, and forcing it down on every client maintainer. They have decided to assume that headers are always present, history has proven them wrong. So what, it's a trivial change anyway, to the public API or to their implementation. |
Beta Was this translation helpful? Give feedback.
On some level I kind of suspected the answer would be that this is not a bug and that the client lib needs to be updated so thank you for laying things out clearly so I can open a PR for
@types/amqplib
with justification!