-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ulong header values #1299
Add support for ulong header values #1299
Conversation
@thepunkoff Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@thepunkoff Thank you for signing the Contributor License Agreement! |
The CI build failed, but I can't see the reasons why. It just says "loading" forever. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Build failure:
/tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Unit/TestFieldTableFormatting.cs(80,33): error CS1003: Syntax error, ',' expected [/tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Unit/Unit.csproj]
/tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Unit/TestFieldTableFormattingGeneric.cs(82,33): error CS1003: Syntax error, ',' expected [/tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Unit/Unit.csproj]
Benchmarks -> /tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Benchmarks/bin/Debug/net472/Benchmarks.exe
/tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Unit/TestFieldTableFormatting.cs(80,33): error CS1003: Syntax error, ',' expected [/tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Unit/Unit.csproj]
/tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Unit/TestFieldTableFormattingGeneric.cs(82,33): error CS1003: Syntax error, ',' expected [/tmp/build/b95f7b06/rabbitmq_dotnet_client/projects/Unit/Unit.csproj]
Build FAILED.
I would fix this for you but I'm caught up in customer support!
@lukebakken Thanks for helping! I fixed the build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actions failed on formatting. Apart from that, this looks good to me. Thank you for your contribution!
There's now a flaky test failure, that prevents this from being merged, but I'm not sure how to rerun the check. |
There is one test that fails only on Windows, and the client seemingly goes into a (reconnection) loop that never succeeds:
Anyhow, it does not seem to be related to this PR in any way. The same test passes on Linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should at least be compatible with Pika:
https://github.com/pika/pika/blob/main/pika/data.py#L256-L259
PS @thepunkoff thanks for your contribution. If you wouldn't mind making sure this change uses the same single-character as Pika, that would be great.
@lukebakken Ok! I can see that pika uses |
@lukebakken @thepunkoff I don't mind using the same value as Pika but keep this protocol errata in mind. I'd say we should use what the Java client uses and not Pika (in case there is a difference). |
@michaelklishin Oh I see now... my bad! So my PR would remove disambiguity between 0-9-1 and RabbitMQ considering longs and ulongs. However, the Java client currently doesn't support ulongs either. Should I update it as well? |
121b851
to
9d2a5e0
Compare
Oops, sorry for messing up commits 😅 |
@thepunkoff we would appreciate support for the same type in the Java client, of course. To me it appears that Pika uses So both this client and the Java one should the same value, what the RabbitMQ server uses. |
Just to clarify. Does the RabbitMQ server use header values as opposed to just passing them along to the consumer to be interpreted by the application? If the server expects values in an exact format, then is it even ok to change anything on the client libraries' side? Should the server be patched to support this, too? How would the server react to such rearrangements in clients? Considering the errata document. It is stated that there are incompatibilities between amqp 0-9-1 and rmq, I can see those. So does this mean that amqp 0-9-1 clients are not compatible with rmq, and rmq clients are not compatible with 0-9-1-compliant servers? How should I interpret this document? As a todo list or as a rule to follow? Not quite sure yet. Would be glad if y'all clarified it to me :) |
Here's where the Java client translates the codes to values: |
@lukebakken Here's a quote from the errata doc:
This actually says the type characters are used. If they're not, and the information is obsolete, then great. Do you think the field type specifiers in this client should fully conform to the 0-9-1 spec (p. 31-32)? I could make sure they do in this PR, and then update the Java client accordingly. But this should be subsequently done in all the known client libraries. Also, if an updated client uses new type specifiers, the non-updated clients will be mislead, as e.g. long values in the headers from the updated client would start to use 'L' instead of 'l'. |
I agree, we should adapt the clients to use what RabbitMQ server uses. At the end of the day, these clients are rabbitmq clients, not pure AMQP 0.9.1 clients. The Go client seems to follow the same criteria as Java and Pika: |
We definitely won't update all clients to use the ambiguous values from the original spec (that were never clarified). |
Here's where I was confusing message headers with the actual framing of messages 🤕 |
So rabbitmq/rabbitmq-server#1093 (comment) from 2017 suggests we have decided to not support unsigned longs but to support signed longs as effectively all programming languages have a way of representing them on 64-bit machines. Sounds like we cannot support this type without breaking changes somewhere, and they won't make any sense to Python, JS, PHP, Elixir, Ruby users. Should we give up on the idea and document the decision in the issue? |
Sounds good to me. I think we should just not have support for unsigned 64-bit integers. The alternative would be to accept |
Sounds ok to me, too. Just a shame that uints, ushorts and sbytes are already supported, and this all can't be pretty :) Also, as I can see, at least two clients for languages, that don't have unsigned types (and signed bytes), already will raise an error if they see unsupported values while decoding. Notice the absence of cases for ('u', 'i' ,'b'): So the dotnet client can already crash some other clients with these types. |
Related to rabbitmq/rabbitmq-dotnet-client#1299 We have agreed to not support ulong values, and document this as a limitation instead. Signed-off-by: Aitor Perez Cedres <acedres@vmware.com>
Related to rabbitmq/rabbitmq-dotnet-client#1299 We have agreed to not support ulong values, and document this as a limitation instead. Signed-off-by: Aitor Perez Cedres <acedres@vmware.com>
Proposed Changes
I added support for having ulongs as header table values for convenience, since uints and ushorts support has already been added.
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments