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
