qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fraser Adams <fraser.ad...@blueyonder.co.uk>
Subject Re: Java Broker plugin change - was Re: QPID C++ broker monitoring and management
Date Fri, 07 Mar 2014 15:07:35 GMT
Why have you removed getConsumers() from org.apache.qpid.server.model.Queue?

I was using that!

                     for (Consumer subscription : queue.getConsumers())
                     {
                         childAdded(queue, subscription);
                     }


So in order to be able to navigate between a Connection and a Queue you 
wind up with Connection, Session, Subscription (AKA Consumer) and Queue. 
I maintained the references between Session and Queue via Consumer e.g. 
in childAdded() in QmfManagementAgent I do:


         else if (child instanceof Consumer) // AKA Subscription
         {
             // Subscriptions are a little more complex because in QMF 
Subscriptions contain sessionRef and queueRef
             // properties whereas with the Java Broker model Consumer 
is a child of Queue and Session. To cope with
             // this we first try to create or retrieve the QMF 
Subscription Object then add either the Queue or
             // Session reference depending on whether Queue or Session 
was the parent of this addChild() call.
             if (!_objects.containsKey(child))
             {
                 data = new 
org.apache.qpid.server.qmf2.agentdata.Subscription((Consumer)child);
                 _objects.put(child, data);
            }

             org.apache.qpid.server.qmf2.agentdata.Subscription 
subscription =
(org.apache.qpid.server.qmf2.agentdata.Subscription)_objects.get(child);

             QmfAgentData ref = _objects.get(object);
             if (ref != null)
             {
                 if (object instanceof Queue)
                 {
                     subscription.setQueueRef(ref.getObjectId(), 
(Queue)object);
                     // Raise a Subscribe Event - N.B. Need to do it 
*after* we've set the queueRef.
_agent.raiseEvent(subscription.createSubscribeEvent());
                 }
                 else if (object instanceof Session)
                 {
                     subscription.setSessionRef(ref.getObjectId());
                 }
             }
         }


getConsumers() still seems to be present in AMQQueue.java and in 
AbstractQueue.java so I hope that it was just "over zealous" tidying of 
the org.apache.qpid.server.model.Queue interface - I'd quite like to 
have it back please.

Frase






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message