Routing key length is not validated
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp, rabbitmq
- Domain
- backend, distributed-systems
Research direction
Start with the topology.bind(exchange, queue, longRoutingKey) and producer->send(message, longRoutingKey, ...) entry points, then reproduce the attached sample with a routing key over 255 bytes. Trace where each operation handles the key and verify that oversized values are rejected without hanging or closing the connection.
Written by the indexing model from the issue text.
Description
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
- 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. - 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.
- Dominant language
- C++
- Stars
- 106
- Forks
- 32
- Avg merge
- 9h 6m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bloomberg/rmqcpp
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
New version release Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
conan support Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in bloomberg/rmqcpp
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100