Hi Chamila, Yes, my bad. Tenant listeners in subscribeToTopicsAndRegisterListeners() should be removed.
Great work in finding these flaws. Appreciate if you could send a PR with fixes. Thanks On Mon, Sep 22, 2014 at 1:08 PM, Chamila De Alwis <chami...@wso2.com> wrote: > Hi Akila, > > The listeners in registerTenantEventListeners() are invoking extension > handling through the DefaultExtensionHandler. The tenant event listeners > added in subscribeToTopicsAndRegisterListeners() are not, so they must be > removed, along with the additional methods in ExtensionUtils. > > > Regards, > Chamila de Alwis > Software Engineer | WSO2 | +94772207163 > Blog: code.chamiladealwis.com > > > > On Mon, Sep 22, 2014 at 12:53 PM, Akila Ravihansa Perera > <raviha...@wso2.com> wrote: >> >> Hi Chamila, >> >> Looks like there is a flaw in the logic. The extension should be >> invoked via DefaultExtensionHandler. This could be a merge conflict. >> Also we should refactor cartridge agent to support customizable >> extension handlers. I've created a JIRA to track this task [1]. >> >> Tenant listeners under registerTenantEventListeners() should be removed. >> >> [1] https://issues.apache.org/jira/browse/STRATOS-808 >> >> >> Thanks. >> >> On Mon, Sep 22, 2014 at 12:20 PM, Chamila De Alwis <chami...@wso2.com> >> wrote: >> > Hi guys, >> > >> > Any idea if the two paths are intentional or a flow? >> > >> > >> > Regards, >> > Chamila de Alwis >> > Software Engineer | WSO2 | +94772207163 >> > Blog: code.chamiladealwis.com >> > >> > >> > >> > On Sat, Sep 20, 2014 at 8:40 PM, Chamila De Alwis <chami...@wso2.com> >> > wrote: >> >> >> >> Hi, >> >> >> >> In org.apache.stratos.cartridge.agent.CartridgeAgent "tenant/#" topic >> >> listeners are added twice. SubscriptionDomainAddedEventEventListener >> >> and >> >> SubscriptionDomainRemovedEventListener is first added in >> >> subscribeToTopicsAndRegisterListeners() method at line 254. Then these >> >> two >> >> are added again in registerTenantEventListeners() method at line 438. >> >> >> >> There are two overriding methods for >> >> executeSubscriptionDomainAddedExtension() and >> >> executeSubscriptionDomainRemovedExtension() each accepting a map of >> >> "STRATOS_" prepended environment parameters and the other accepting >> >> individual parameters like tenant Id and domain name. >> >> >> >> Furthermore, in CartridgeAgentConstants there are two entries for each >> >> of >> >> the extension scripts, one hardcoding the script name and the other >> >> taking >> >> the script name from the stratos.sh properties. >> >> >> >> The extension script seems to be using the "STRATOS_" prepended >> >> properties >> >> for its use. Therefore, the path with individual parameters seems to be >> >> a >> >> dead end. >> >> >> >> Furthermore, in the method subscribeToTopicsAndRegisterListeners() >> >> method, >> >> two threads are started with the same "instance/#" topic listener, at >> >> line >> >> 243 and 297. The second one seems to be mistakenly added, may be while >> >> merging conflicts? >> >> >> >> >> >> Regards, >> >> Chamila de Alwis >> >> Software Engineer | WSO2 | +94772207163 >> >> Blog: code.chamiladealwis.com >> >> >> >> >> > >> >> >> >> -- >> Akila Ravihansa Perera >> Software Engineer, WSO2 >> >> Blog: http://ravihansa3000.blogspot.com > > -- Akila Ravihansa Perera Software Engineer, WSO2 Blog: http://ravihansa3000.blogspot.com