You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Fraser Adams <fr...@blueyonder.co.uk> on 2013/04/20 20:59:55 UTC

Review Request: QPID-4760: Associate Java Broker QueueAdapter and SessionAdapter via ConsumerAdapter

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10686/
-----------------------------------------------------------

Review request for qpid, Gordon Sim, Robbie Gemmell, and Rob Godfrey.


Description
-------

In the management model it should be possible to navigate from a Connection through its associated Sessions to Queues via Subscriptions/Consumers.

Basically Subscription is an association class linking Session and Queue.

In the Java Broker Management Model there was code missing that should allow the SessionAdapter to getSubscriptions().

This patch provides code to do the necessary object registrations to allow the Subscriptions in SessionAdapter to be correctly maintained thus allowing navigation from Connection to Queue and vice versa.


Diffs
-----

  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java 1469902 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java 1469902 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java 1469902 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java 1469902 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java 1469902 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/tools/src/java/src/qpid-broker-plugins-management-qmf2/java/org/apache/qpid/server/qmf2/QmfManagementAgent.java 1469902 

Diff: https://reviews.apache.org/r/10686/diff/


Testing
-------

I've tested in the QmfManagementPlugin. Plugin loaded and the QMF Gui was able to navigate starting from a Connection through Subscribed Sessions to Queue. Also Started with Queue and navigated through Subscriptions to show Session info and navigate to Connection.


Thanks,

Fraser Adams


Re: Review Request: QPID-4760: Associate Java Broker QueueAdapter and SessionAdapter via ConsumerAdapter

Posted by Fraser Adams <fr...@blueyonder.co.uk>.
Robbie/All
I've attached an update of this work incorporating Robbie's suggestions 
for improving the getSessionAdapter() helper method.

Does that cover what you were thinking?

Frase


On 23/04/13 21:13, Robbie Gemmell wrote:
> On 23 April 2013 18:59, Fraser Adams <fr...@blueyonder.co.uk> wrote:
>
>> On 22/04/13 22:26, Robbie Gemmell wrote:
>>
>>> Looking this over it seems like it would work, but I can't say I am a big
>>> fan of inspecting potentially every connection during every consumer
>>> creation and removal.
>>>
>> Yeah I have to agree with you there, I wasn't wildly keen on it myself but
>> I couldn't see an obvious alternative when I was trying this stuff out.
>> Some of the associations get a bit convoluted don't they :-) Character
>> building I think it's called.
>>
>>
>>     An alternative might be: the SessionModel interface has a method to get
>>> the associated ConnectionModel, with which you could directly query for the
>>> associated Connection[Adapter] from the Virtualhost since it already
>>> maintains that mapping.
>>>
>> So I guess that you mean org.apache.qpid.server.**protocol.AMQSessionModel?
>> So I've got a reference to that passed into
>> the getSessionAdapter(**AMQSessionModel session) helper method. The
>> AMQSessionModel interface method you are alluding to is
>>
>>      public AMQConnectionModel getConnectionModel();
>>
>> Is that correct?
>>
>>
> Yep, those are the bits I meant.
>
>
>> Looking at VirtualHostAdapter.java there doesn't currently seem to be an
>> accessor to lookup ConnectionAdapter by AMQConnectionModel so I'd have to
>> add that, true? Clearly trivial given that the Map and registration stuff
>> already exist.
>>
>> But it definitely seems better to do that than iterate through Connections
>> especially for non-trivial numbers of connections.
>>
>>
> Yes, its not ideal adding the method, but I think its better than the
> alternative. We can try to do something nicer later when we will be looking
> to tidy that stuff up anyway.
>
>
>> I probably won't have time to revise this until Friday due to work and
>> family commitments, so if you can bear with me 'til then and I'll post a
>> revised patch using this approach.
>>
>> Thanks for the feedback.
>>
> No problem, thanks for the patch :)
>
>
>> Frase
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.**org<de...@qpid.apache.org>
>> For additional commands, e-mail: dev-help@qpid.apache.org
>>
>>


Re: Review Request: QPID-4760: Associate Java Broker QueueAdapter and SessionAdapter via ConsumerAdapter

Posted by Robbie Gemmell <ro...@gmail.com>.
On 23 April 2013 18:59, Fraser Adams <fr...@blueyonder.co.uk> wrote:

> On 22/04/13 22:26, Robbie Gemmell wrote:
>
>>
>> Looking this over it seems like it would work, but I can't say I am a big
>> fan of inspecting potentially every connection during every consumer
>> creation and removal.
>>
> Yeah I have to agree with you there, I wasn't wildly keen on it myself but
> I couldn't see an obvious alternative when I was trying this stuff out.
> Some of the associations get a bit convoluted don't they :-) Character
> building I think it's called.
>
>
>    An alternative might be: the SessionModel interface has a method to get
>> the associated ConnectionModel, with which you could directly query for the
>> associated Connection[Adapter] from the Virtualhost since it already
>> maintains that mapping.
>>
> So I guess that you mean org.apache.qpid.server.**protocol.AMQSessionModel?
> So I've got a reference to that passed into
> the getSessionAdapter(**AMQSessionModel session) helper method. The
> AMQSessionModel interface method you are alluding to is
>
>     public AMQConnectionModel getConnectionModel();
>
> Is that correct?
>
>
Yep, those are the bits I meant.


> Looking at VirtualHostAdapter.java there doesn't currently seem to be an
> accessor to lookup ConnectionAdapter by AMQConnectionModel so I'd have to
> add that, true? Clearly trivial given that the Map and registration stuff
> already exist.
>
> But it definitely seems better to do that than iterate through Connections
> especially for non-trivial numbers of connections.
>
>
Yes, its not ideal adding the method, but I think its better than the
alternative. We can try to do something nicer later when we will be looking
to tidy that stuff up anyway.


>
> I probably won't have time to revise this until Friday due to work and
> family commitments, so if you can bear with me 'til then and I'll post a
> revised patch using this approach.
>
> Thanks for the feedback.
>

No problem, thanks for the patch :)


>
> Frase
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.**org<de...@qpid.apache.org>
> For additional commands, e-mail: dev-help@qpid.apache.org
>
>

Re: Review Request: QPID-4760: Associate Java Broker QueueAdapter and SessionAdapter via ConsumerAdapter

Posted by Fraser Adams <fr...@blueyonder.co.uk>.
On 22/04/13 22:26, Robbie Gemmell wrote:
>
> Looking this over it seems like it would work, but I can't say I am a big fan of inspecting potentially every connection during every consumer creation and removal.
Yeah I have to agree with you there, I wasn't wildly keen on it myself 
but I couldn't see an obvious alternative when I was trying this stuff 
out. Some of the associations get a bit convoluted don't they :-) 
Character building I think it's called.

>   An alternative might be: the SessionModel interface has a method to get the associated ConnectionModel, with which you could directly query for the associated Connection[Adapter] from the Virtualhost since it already maintains that mapping.
So I guess that you mean 
org.apache.qpid.server.protocol.AMQSessionModel? So I've got a reference 
to that passed into
the getSessionAdapter(AMQSessionModel session) helper method. The 
AMQSessionModel interface method you are alluding to is

     public AMQConnectionModel getConnectionModel();

Is that correct?

Looking at VirtualHostAdapter.java there doesn't currently seem to be an 
accessor to lookup ConnectionAdapter by AMQConnectionModel so I'd have 
to add that, true? Clearly trivial given that the Map and registration 
stuff already exist.

But it definitely seems better to do that than iterate through 
Connections especially for non-trivial numbers of connections.


I probably won't have time to revise this until Friday due to work and 
family commitments, so if you can bear with me 'til then and I'll post a 
revised patch using this approach.

Thanks for the feedback.

Frase



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


Re: Review Request: QPID-4760: Associate Java Broker QueueAdapter and SessionAdapter via ConsumerAdapter

Posted by Robbie Gemmell <ro...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10686/#review19545
-----------------------------------------------------------


Sorry for the delayed response, you picked possibly the second time this year both Rob and I were otherwise occupied over the weekend and beyond :)

Looking this over it seems like it would work, but I can't say I am a big fan of inspecting potentially every connection during every consumer creation and removal. An alternative might be: the SessionModel interface has a method to get the associated ConnectionModel, with which you could directly query for the associated Connection[Adapter] from the Virtualhost since it already maintains that mapping.


http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
<https://reviews.apache.org/r/10686/#comment40348>

    Marking for reference



http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java
<https://reviews.apache.org/r/10686/#comment40349>

    Marking for reference


- Robbie Gemmell


On April 20, 2013, 6:59 p.m., Fraser Adams wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/10686/
> -----------------------------------------------------------
> 
> (Updated April 20, 2013, 6:59 p.m.)
> 
> 
> Review request for qpid, Gordon Sim, Robbie Gemmell, and Rob Godfrey.
> 
> 
> Description
> -------
> 
> In the management model it should be possible to navigate from a Connection through its associated Sessions to Queues via Subscriptions/Consumers.
> 
> Basically Subscription is an association class linking Session and Queue.
> 
> In the Java Broker Management Model there was code missing that should allow the SessionAdapter to getSubscriptions().
> 
> This patch provides code to do the necessary object registrations to allow the Subscriptions in SessionAdapter to be correctly maintained thus allowing navigation from Connection to Queue and vice versa.
> 
> 
> Diffs
> -----
> 
>   http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConnectionAdapter.java 1469902 
>   http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/ConsumerAdapter.java 1469902 
>   http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/QueueAdapter.java 1469902 
>   http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/SessionAdapter.java 1469902 
>   http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java 1469902 
>   http://svn.apache.org/repos/asf/qpid/trunk/qpid/tools/src/java/src/qpid-broker-plugins-management-qmf2/java/org/apache/qpid/server/qmf2/QmfManagementAgent.java 1469902 
> 
> Diff: https://reviews.apache.org/r/10686/diff/
> 
> 
> Testing
> -------
> 
> I've tested in the QmfManagementPlugin. Plugin loaded and the QMF Gui was able to navigate starting from a Connection through Subscribed Sessions to Queue. Also Started with Queue and navigated through Subscriptions to show Session info and navigate to Connection.
> 
> 
> Thanks,
> 
> Fraser Adams
> 
>