qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Godfrey <rob.j.godf...@gmail.com>
Subject Re: Java Broker plugin change - was Re: QPID C++ broker monitoring and management
Date Fri, 07 Mar 2014 15:18:01 GMT
I'll set myself up a clean environment on a VM to see if I can get the
getConsumers() restored...  it may have been one of the things that the 1.6
compiler was getting upset about, despite working fine under 1.7...

-- Rob


On 7 March 2014 16:13, Rob Godfrey <rob.j.godfrey@gmail.com> wrote:

>
>
>
> On 7 March 2014 16:07, Fraser Adams <fraser.adams@blueyonder.co.uk> wrote:
>
>> 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:
>>
>>
> You can do
>
> for(Consumer subscription : queue.getChildren(Consumer.class))
>
> I would think...
>
> Not sure why it got removed - probably just as it wasn't being
> referenced... although it might have been some sort of clash between the
> AMQQueue and Queue versions of getConsumers() causing issues when they
> merged their functions
>
> -- Rob
>
>>
>>         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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message