Description
There is a configuration option on TransportConnector to set the maximum number of producers allowed per connection. This is validated in TransportConnection in the processAddProducer method.
The issue is that the code to enforce the check first tests if the destination is null and will not enforce the check if the destination is null. This means that when a client creates an anonymous producer on a session this setting will be ignored which is not the correct behavior. Even if the producers are anonymous this option should still limit to the total number of producers on the connection. The problem is here on line 605 of TransportConnection.java:
if (destination != null && !AdvisorySupport.isAdvisoryTopic(destination)) { .... }
This simply should be changed to:
if (!AdvisorySupport.isAdvisoryTopic(destination)) {
....
}
I'll be submitting a pull request (with unit tests) shortly.