You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rajith Attapattu (Commented) (JIRA)" <ji...@apache.org> on 2011/10/12 16:15:11 UTC

[jira] [Commented] (QPID-3401) Refactor address resolution code

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

Rajith Attapattu commented on QPID-3401:
----------------------------------------

The following set of patches aims to refactor the addressing code to achieve the following goals.

1. Provide a proper abstraction of Queue and Topic concepts

2. Provide an address format based implementation of Queue and Topic

3. Hide the implementatio of the life cycle of a destination (create, delete, createSubscription, deleteSubscription)

4. Create a top level AddressBasedDestination class (extending from AMQDestination),
   4.1 To separate the address based details from AMQQueue, AMQTopic ..etc
   4.2 To bridge btw the new code and the AMQDestination interface

4. Improve the code that retrievs data from an address (a.k.a AddressHelper)

5. Provide a fix for QPID-3265, QPID-3317, QPID-3271

6. Implement the above with minimum disruption to regular client code.

All though the patch looks substantial, most of the size comes from
(1) Addition of new classes (and most of the code was existing code moved into more structured classes).
(2) Deletion fo unwanted code/classes.

The new code hooks into the client code at the following locations.
{code}
BasicMessageConsumer_0_10.java -> constructor() - to create & azzert
                               -> cleanupQueue() - to delete

* // ideally we should be invoking addrDest.createSubscription() in the constructor;
* // ideally we should be invoking addrDest.deleteSubscription() in the close();

BasicMessageProducer_0_10.java -> declareDestination() - to create & azzert
                               -> close() - to delete
                               -> send() - used the AddressBasedDestination to retrieve some address specific info.

* // We could use a send() method on a destination to abstract the protocol specific and destination syntax specific details.
  // I didn't go that far during the refactoring.

AMQSession_0_10.java -> sendConsume() - to createSubscription
{code}

The following diagram describes the new class structure. https://issues.apache.org/jira/secure/attachment/12498753/class_diagram.png
I have produced separate patches for each module to keep it simple.
                
> Refactor address resolution code
> --------------------------------
>
>                 Key: QPID-3401
>                 URL: https://issues.apache.org/jira/browse/QPID-3401
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Client
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>             Fix For: 0.14
>
>         Attachments: class_diagram.png
>
>
> After some thought it seems that the following JIRA's would benefit from some reworking of the address resolution code as the original design had a few flaws based on incorrect understanding of the address syntax.
> QPID-3265 	
> QPID-3317
> QPID-3271
> The redesign would be minimal and not very disruptive. The goal is to fix certain design flaws in the current code, rather than a complete redesign. I am planning to reuse as much code as possible to ensure we don't throw away tested code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org