Skip to content
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

Routing key length is not validated #54

Open
Pasick opened this issue Jan 13, 2025 · 0 comments
Open

Routing key length is not validated #54

Pasick opened this issue Jan 13, 2025 · 0 comments

Comments

@Pasick
Copy link

Pasick commented Jan 13, 2025

The topic exchange routing key has a limitation of 255 bytes (see https://www.rabbitmq.com/tutorials/tutorial-five-go#:~:text=There%20can%20be%20as%20many,be%20in%20the%20same%20form.). However, this limitation is not applied when binding queue to an exchange or sending the message:

To Reproduce

  1. Specify a long routing key (>255 characters) when binging a queue to an exchange:
    topology.bind(exchange, queue, longRoutingKey);
    No errors will be reported but the process will hang forever.
  2. Specify a long routing key (>255 characters) when sending the message:
    producer->send(message, longRoutingKey, ...);
    The following error will be reported:
    13JAN2025_08:46:10.559653 350290 140737331340864 WARN /home/pasick/github/pasick-clean/rmqcpp/src/rmq/rmqio/rmqio_asioconnection.cpp 410 UNINITIALIZED_LOGGER_MANAGER Socket closed: Connection reset by peer. Current state: 1
    and the connection will be closed.

Please refer to the attached sample which demonstrates the issue:
longRoutingKeyIssue.txt

Expected behavior
I believe that the size of the routing key should be validated and do not accept values larger that 255 bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant