[AMQ-9532] Convert DestinationMapNode from recursion to loops.
Because destinations are parsed recursively, it's possible to trigger java.lang.StackOverflowError if a destination has too many nodes.
the PR is converting the recursion to loops.
Ran DestinationMapTest.java to make sure the behavior of the class stays the same. There is no need for additional testing in my opinion, because the behavior is supposed to stay the same as it was before the change.
@Nikita-Shupletsov how many is too-many nodes to trigger a stack overflow? What was the -Xss setting when the SO occurred?
@Nikita-Shupletsov how many is too-many nodes to trigger a stack overflow? What was the -Xss setting when the SO occurred?
with -Xss256k it's around 1300
i've encountered the issue due to this: https://activemq.apache.org/components/classic/documentation/message-redelivery-and-dlq-handling#setting-expiration-on-messages-in-the-dlq there were DLQs for DlQs and so on