-
Notifications
You must be signed in to change notification settings - Fork 591
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
Byte conversion support #579
Byte conversion support #579
Conversation
case 'A': | ||
value = ReadArray(reader); | ||
break; | ||
case 'B': |
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.
Reading
WriteOctet(writer, (byte)'A'); | ||
WriteArray(writer, val); | ||
break; | ||
case byte val: |
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.
Writing
break; | ||
default: | ||
throw new WireFormattingException( | ||
$"Value of type '{value.GetType().Name}' cannot appear as table value", |
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.
Some exception details
Thank you for your ongoing pull requests! It's not clear what's in scope for this PR. Adding some tests would help. Please make sure you have read the AMQP 0-9-1 Errata document. |
Yes, i got 'B' for byte from this document |
Thank you. I will cherry-pick to |
Byte conversion support (cherry picked from commit c343098)
Proposed Changes
I tried to add byte conversion support for arguments. but this not a final version. Solutions are:
Motivation:
RabbitMQ has
x-max-priority
for queues,x-priority
for consumers and priority inIBasicProperties
for producers, but for them is ok. Commonly i used them to balance messages.Priorities is in 1...255 range and perfectly suites to byte, but when i tried wrap arguments with byte extensions i got a
WireFormattingException
(Value cannot appear as table value
) and nothing more. Boxing int for priority works fine.Usage: https://gist.github.com/sergeyshaykhullin/bca8964c0ebbd5a8737a559bcb0287e3
If English isn't your first language, don't worry about it and try to
communicate the problem you are trying to solve to the best of your abilities.
As long as we can understand the intent, it's all good.
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments
There are possible breaking changes, f.e. new version writes 'B', but old version doesnt know about it and throws
SyntaxError
Docs https://www.rabbitmq.com/priority.html has
For 'x-max-priority' -
This argument should be a positive integer between 1 and 255
For
x-priority
-The message priority field is defined as an unsigned byte, so in practice priorities should be between 0 and 255.
IBasicProperties has
byte
prioritySo maybe it can help someone in future