-
Notifications
You must be signed in to change notification settings - Fork 32
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
x-consistent-hash implementation has divide by zero error when no routing key is specified #127
Comments
Had to mock up a test case to prove this, ConsistentHashExchange.routingKeyToWeight should throw an IllegalArgumentException rather than trying to return the Hashcode of a non numeric routing key which is not possible on RabbitMQ. When no routing key is specified the weight is returned as 0 which later fails with a divide by zero in selectReceiver. |
…ge with a non integer binding key
Hi @RedMu, thanks for spotting this. I agree that no However I wonder what is the behavior of RabbitMq in this situation ? I will make the test whenever I can find the time to do it. |
Hi Ledoyen, I made a quick test, when you try to bind without a binding key you get an IOException with the following: 2020-07-03 19:17:18,815 ERROR org.springframework.amqp.rabbit.connection.CachingConnectionFactory [AMQP Connection 127.0.0.1:5672] : Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - The binding key must be an integer: <<>>, class-id=50, method-id=20) It is not possible to create a binding through the management console without a binding key. It's actually an IOException that is thrown by the rabbitmq java client code - but it seemed more logical to have an IllegalArgumentException for the mock library. |
…ge with a non integer binding key
…ge with a non integer binding key
…ge with a non integer binding key
No description provided.
The text was updated successfully, but these errors were encountered: