You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Arthur Naseef (JIRA)" <ji...@apache.org> on 2014/06/07 22:32:02 UTC

[jira] [Commented] (AMQ-4906) advisory producerCount = 0 is not received on temporary queue

    [ https://issues.apache.org/jira/browse/AMQ-4906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14020957#comment-14020957 ] 

Arthur Naseef commented on AMQ-4906:
------------------------------------

Git commit: https://git-wip-us.apache.org/repos/asf?p=activemq.git;a=commit;h=11781d3cf2a351ea5f3ef80f29f351ac42d3538e


> advisory producerCount = 0 is not received on temporary queue
> -------------------------------------------------------------
>
>                 Key: AMQ-4906
>                 URL: https://issues.apache.org/jira/browse/AMQ-4906
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.7.0
>            Reporter: Christian Mamen
>            Assignee: Rob Davies
>             Fix For: 5.10.0
>
>
> i notice i never receive producer advisory messages (ActiveMQ.Advisory.Producer.Queue .[...]) with producerCount=0 when the client message producers on temporary queue are closed. i do receive producerCount > 0. 
> However, the consumerCount (from ActiveMQ.Advisory.Consumer.Queue.[...]) appears to work as expected.
> From looking into org.apache.activemq.advisory.AdvisoryBroker.java
> {code}
> @Override
>     public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception {
>         super.removeProducer(context, info);
>         // Don't advise advisory topics.
>         ActiveMQDestination dest = info.getDestination();
>         if (info.getDestination() != null && !AdvisorySupport.isAdvisoryTopic(dest)) {
>             ActiveMQTopic topic = AdvisorySupport.getProducerAdvisoryTopic(dest);
>             producers.remove(info.getProducerId());
>             if (!dest.isTemporary() || destinations.contains(dest)) { // PLEASE NOTE: <== could this actually be destinations.containsKey(dest)
>                 fireProducerAdvisory(context, dest,topic, info.createRemoveCommand());
>             }
>         }
>     }
> {code}
> as reference, the "working" removeConsumer method:
> {code}
> @Override
>     public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
>         super.removeConsumer(context, info);
>         // Don't advise advisory topics.
>         ActiveMQDestination dest = info.getDestination();
>         if (!AdvisorySupport.isAdvisoryTopic(dest)) {
>             ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(dest);
>             consumers.remove(info);
>             if (!dest.isTemporary() || destinations.containsKey(dest)) {
>                 fireConsumerAdvisory(context,dest, topic, info.createRemoveCommand());
>             }
>         }
>     }
> {code}
> Please note the destinations.containsKey(dest) vs destinations.contains(dest) (for concurrentHashMaps this is identical to containsValue()). I'm assuming the logic is to make sure the producer destination do exist in both cases
> I tested this with 5.7.0. the code is similar in 5.9.0



--
This message was sent by Atlassian JIRA
(v6.2#6252)