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

Rob Godfrey commented on QPID-6779:
-----------------------------------

As part of the work on QPID-7514 the responsibility of who closes what is 
required to be consistent - the protocol layers must close the target.  The 
Consumer object is closed by the config thread.  Either object may be the first 
to be deleted, but the protocol should not attempt to close the model layer 
directly.

The interface issue should probably be raised as a separate JIRA

> [Java Broker] Refactor consumer closing functionality to make it consistent 
> between different protocols
> -------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-6779
>                 URL: https://issues.apache.org/jira/browse/QPID-6779
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Broker
>    Affects Versions: qpid-java-6.0
>            Reporter: Alex Rudyy
>             Fix For: qpid-java-6.2
>
>
> At the moment subscription cancellation is implemented differently on 
> supported protocols. For example,
> # AMQP 0-9 closes ConsumerImpl first (and when the last QueueConsumer is 
> closed ConsumerTarget is get closed) 
> # AMQP 0-10 closes ConsumerTarget (ConsumerImpl are listening for 
> ConsumerTarget state change and closed on hearing transition into CLOSED 
> state)
> # AMQP 1-0 closes ConsumerImpl first (and when the last QueueConsumer is 
> closed ConsumerTarget is get closed) 
> IMHO, we need to make subscription cancellation functionality consistent on 
> different protocol and simplify the implementation.
> I suspect that closing of all ConsumerImpl might result in timeouts on 
> subscription cancellation when configuration thread is busy with performing 
> various tasks as ConsumerImpl#close() would block and wait until 
> QueueConsumerImpl are get closed in config thread.
> It looks like ConsumerTarget#close should be invoked on subscription 
> cancellation and as part of ConsumerTarget#close all existing ConsumerImpl 
> should be closed explicitly rather then rely on ConsumerTarget state change 
> listeners. That should make implementation easier to understand and maintain. 
> All QueueConsumerImpl (configured objects) should be closed asynchronously as 
> part ConsumerImpl close.  
> Aside, we might want to rename classes and interfaces for consumers. We have 
> too many confusing names at the moment:
> * org.apache.qpid.server.model.Consumer (interface)
> * org.apache.qpid.server.consumer.ConsumerImpl (interface!!!!)
> * org.apache.qpid.server.virtualhost.AbstractSystemMessageSource.Consumer 
> (class !!!! implementing interface ConsumerImpl )
> * org.apache.qpid.server.queue.QueueConsumerImpl (class !!!!)
> * more...



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to