Christopher L. Shannon created AMQ-5649:
-------------------------------------------

             Summary: Maximum producers allowed per connection doesn't work for 
anonymous producers
                 Key: AMQ-5649
                 URL: https://issues.apache.org/jira/browse/AMQ-5649
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.11.0, 5.10.1
            Reporter: Christopher L. Shannon
            Priority: Minor


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}}:

{code}
if (destination != null && !AdvisorySupport.isAdvisoryTopic(destination)) {
  ....
}
{code}

This simply should be changed to:

{code}
if (!AdvisorySupport.isAdvisoryTopic(destination)) {
  ....
}
{code}

I'll be submitting a pull request (with unit tests) shortly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to