Hi Isuru, I verified the fix for the jira [1]. https://issues.apache.org/jira/browse/STRATOS-805 and it works, the event gets delivered.
However I do face another issue, see exception below, I opened a JIRA for it: https://issues.apache.org/jira/browse/STRATOS-806 Thanks Martin TID: [0] [STRATOS] [2014-09-18 18:50:53,313] DEBUG {org.apache.stratos.manager.manager.CartridgeSubscriptionManager} - createCompositeAppSubscription for appId: test_app3 and tenantId: -1234 {org.apache.stratos.manager.manager.CartridgeSubscriptionManager} TID: [0] [STRATOS] [2014-09-18 18:50:53,320] ERROR {org.apache.stratos.messaging.message.receiver.topology.TopologyEventMessageDelegator} - Failed to retrieve topology event message {org.apache.stratos.messaging.message.receiver.topology.TopologyEventMessageDelegator} java.lang.NullPointerException: Tenant domain has not been set in CarbonContext at org.wso2.carbon.caching.impl.CacheManagerFactoryImpl.getCacheManager(CacheManagerFactoryImpl.java:79) at org.wso2.carbon.registry.core.utils.RegistryUtils.getCacheManager(RegistryUtils.java:288) at org.wso2.carbon.registry.core.utils.RegistryUtils.getResourceCache(RegistryUtils.java:271) at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.getCache(CacheBackedRegistry.java:62) at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.resourceExists(CacheBackedRegistry.java:246) at org.wso2.carbon.registry.core.session.UserRegistry.resourceExists(UserRegistry.java:629) at org.apache.stratos.manager.registry.RegistryManager.initRegistry(RegistryManager.java:83) at org.apache.stratos.manager.registry.RegistryManager.retrieve(RegistryManager.java:185) at org.apache.stratos.manager.persistence.RegistryBasedPersistenceManager.getSubscription(RegistryBasedPersistenceManager.java:438) at org.apache.stratos.manager.persistence.RegistryBasedPersistenceManager.getCompositeAppSubscription(RegistryBasedPersistenceManager.java:429) at org.apache.stratos.manager.retriever.DataInsertionAndRetrievalManager.getCompositeAppSubscription(DataInsertionAndRetrievalManager.java:405) at org.apache.stratos.manager.manager.CartridgeSubscriptionManager.createCompositeAppSubscription(CartridgeSubscriptionManager.java:102) at org.apache.stratos.manager.topology.receiver.StratosManagerTopologyEventReceiver$9.onEvent(StratosManagerTopologyEventReceiver.java:303) at org.apache.stratos.messaging.listener.EventListener.update(EventListener.java:42) at java.util.Observable.notifyObservers(Observable.java:159) at org.apache.stratos.messaging.event.EventObservable.notifyEventListeners(EventObservable.java:51) at org.apache.stratos.messaging.message.processor.topology.ApplicationCreatedMessageProcessor.process(ApplicationCreatedMessageProcessor.java:77) at org.apache.stratos.messaging.message.processor.topology.GroupActivatedProcessor.process(GroupActivatedProcessor.java:37) at org.apache.stratos.messaging.message.processor.topology.MemberTerminatedMessageProcessor.process(MemberTerminatedMessageProcessor.java:133) at org.apache.stratos.messaging.message.processor.topology.MemberSuspendedMessageProcessor.process(MemberSuspendedMessageProcessor.java:143) at org.apache.stratos.messaging.message.processor.topology.MemberMaintenanceModeProcessor.process(MemberMaintenanceModeProcessor.java:142) at org.apache.stratos.messaging.message.processor.topology.MemberReadyToShutdownMessageProcessor.process(MemberReadyToShutdownMessageProcessor.java:141) at org.apache.stratos.messaging.message.processor.topology.MemberActivatedMessageProcessor.process(MemberActivatedMessageProcessor.java:158) at org.apache.stratos.messaging.message.processor.topology.MemberStartedMessageProcessor.process(MemberStartedMessageProcessor.java:144) at org.apache.stratos.messaging.message.processor.topology.InstanceSpawnedMessageProcessor.process(InstanceSpawnedMessageProcessor.java:135) at org.apache.stratos.messaging.message.processor.topology.ClusterRemovedMessageProcessor.process(ClusterRemovedMessageProcessor.java:108) at org.apache.stratos.messaging.message.processor.topology.ClusterMaintenanceModeMessageProcessor.process(ClusterMaintenanceModeMessageProcessor.java:109) at org.apache.stratos.messaging.message.processor.topology.ClusterActivatedProcessor.process(ClusterActivatedProcessor.java:37) at org.apache.stratos.messaging.message.processor.topology.ClusterCreatedMessageProcessor.process(ClusterCreatedMessageProcessor.java:117) at org.apache.stratos.messaging.message.processor.topology.ServiceRemovedMessageProcessor.process(ServiceRemovedMessageProcessor.java:87) at org.apache.stratos.messaging.message.processor.topology.ServiceCreatedMessageProcessor.process(ServiceCreatedMessageProcessor.java:87) at org.apache.stratos.messaging.message.processor.topology.CompleteTopologyMessageProcessor.process(CompleteTopologyMessageProcessor.java:151) at org.apache.stratos.messaging.message.processor.MessageProcessorChain.process(MessageProcessorChain.java:60) at org.apache.stratos.messaging.message.receiver.topology.TopologyEventMessageDelegator.run(TopologyEventMessageDelegator.java:77) at java.lang.Thread.run(Thread.java:745) From: Isuru Haththotuwa [mailto:[email protected]] Sent: Thursday, September 18, 2014 5:51 AM To: Lakmal Warusawithana Cc: Martin Eppel (meppel); Udara Liyanage; Reka Thirunavukkarasu; Ryan Du Plessis (rdupless) Subject: Re: Updated Task List Hi Martin, This issue is now resolved. Thank you very much for testing and reporting it. Would you be able to re-test the scenario? Pleas note that I added a simple application removal endpoint as well, /application/definition/{applicationId} using the operation DELETE, for the ease of testing. We would need to build a hierarchical data model using which we can display applications which belongs to each tenant, from the information received from the Application Created event (aliases, hostnames, cluster ids). IMHO, its better if we can re-name to CompositeAppSubcription to ApplicationSubscription or something similar since a single subscription can also be wrapped using an Application Definition. WDYT? On Thu, Sep 18, 2014 at 11:03 AM, Isuru Haththotuwa <[email protected]<mailto:[email protected]>> wrote: Hi Martin, I'm looking in to this issue, created a JIRA ticket [1] to track this. Shall we have any issue discussions in dev list? [1]. https://issues.apache.org/jira/browse/STRATOS-805 On Thu, Sep 18, 2014 at 9:06 AM, Lakmal Warusawithana <[email protected]<mailto:[email protected]>> wrote: Hi Folks, We need to take these discussion (technical) to stratos dev. Also need to create appropriate JIRA's at stratos as well. On Thu, Sep 18, 2014 at 7:38 AM, Martin Eppel (meppel) <[email protected]<mailto:[email protected]>> wrote: Hi Isuru, Rekha I had another question, I added the ApplicationCreatedEventListener to the StratosManagerTopologyEventReceiver but I don’t see the event being handled when a new Application is created (I see the log statement for publishing of the ApplicationCreatedEvent in Cloudcontroller, see log snipplet below). Any idea what I am missing ? Thanks Martin TID: [0] [STRATOS] [2014-09-17 22:07:03,200] DEBUG {org.apache.stratos.cloud.controller.topology.TopologyManager} - Topology updated: {"serviceMap":{"c1":{"serviceName":"c1","serviceType":"SingleTenant","clusterIdClusterMap":{"c1alias32.c1.domain":{"serviceName":"c1","clusterId":"c1alias32.c1.domain","autoscalePolicyName":"autoscalingPolicy1","deploymentPolicyName":"deploymentPolicy1","hostNames":["c1alias32.qmog.cisco.com<http://c1alias32.qmog.cisco.com>"],"isLbCluster":false,"memberMap":{},"status":"Created"},"c1alias12.c1.domain":{"serviceName":"c1","clusterId":"c1alias12.c1.domain","autoscalePolicyName":"autoscalingPolicy1","deploymentPolicyName":"deploymentPolicy1","hostNames":["c1alias12.qmog.cisco.com<http://c1alias12.qmog.cisco.com>"],"isLbCluster":false,"memberMap":{},"status":"Created"},"c1alias22.c1.domain":{"serviceName":"c1","clusterId":"c1alias22.c1.domain","autoscalePolicyName":"autoscalingPolicy1","deploymentPolicyName":"deploymentPolicy1","hostNames":["c1alias22.qmog.cisco.com<http://c1alias22.qmog.cisco.com>"],"isLbCluster":false,"memberMap":{},"status":"Created"}},"portMap":{"8280":{"protocol":"http","value":22,"proxy":8280}},"properties":{"payload_parameter.ENABLE_DATA_PUBLISHER":"false","payload_parameter.MONITORING_SERVER_PORT":"0","payload_parameter.MONITORING_SERVER_SECURE_PORT":"0","payload_parameter.MONITORING_SERVER_ADMIN_USERNAME":"xxxx","payload_parameter.TRUSTSTORE_PASSWORD":"wso2carbon","payload_parameter.CERT_TRUSTSTORE":"/opt/apache-stratos-cartridge-agent/security/client-truststore.jks","payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD":"xxxx","payload_parameter.MONITORING_SERVER_IP":"octl.qmog.cisco.com<http://octl.qmog.cisco.com>","payload_parameter.MB_IP":"octl.qmog.cisco.com<http://octl.qmog.cisco.com>","payload_parameter.SIMPLE_PROPERTY":"value","payload_parameter.CEP_IP":"octl.qmog.cisco.com<http://octl.qmog.cisco.com>","payload_parameter.MB_PORT":"61616","payload_parameter.CEP_PORT":"7611"}}},"compositeApplicationMap":{},"configCompositeApplicationMap":{},"applicationMap":{},"initialized":false} {org.apache.stratos.cloud.controller.topology.TopologyManager} TID: [0] [STRATOS] [2014-09-17 22:07:03,200] INFO {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher} - Publishing Application created event: org.apache.stratos.messaging.domain.topology.Application@3d491fde<mailto:org.apache.stratos.messaging.domain.topology.Application@3d491fde> {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher} TID: [0] [STRATOS] [2014-09-17 22:07:03,205] DEBUG {org.apache.stratos.cloud.controller.topology.TopologyManager} - Write lock released {org.apache.stratos.cloud.controller.topology.TopologyManager} TID: [0] [STRATOS] [2014-09-17 22:08:01,002] DEBUG {org.apache.stratos.manager.publisher.TenantSynzhronizerTask} - Publishing complete tenant event {org.apache.stratos.manager.publisher.TenantSynzhronizerTask} TID: [0] [STRATOS] [2014-09-17 22:08:01,011] DEBUG {org.apache.stratos.cloud.controller.topology.TopologySynchronizerTask} - Executing topology synchronization task {org.apache.stratos.cloud.controller.topology.TopologySynchronizerTask} TID: [0] [STRATOS] [2014-09-17 22:08:01,013] DEBUG {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher} - Publishing complete topology event {org.apache.stratos.cloud.controller.topology.TopologyEventPublisher} TID: [0] [STRATOS] [2014-09-17 22:08:01,013] DEBUG {org.apache.stratos.manager.publisher.TenantSynzhronizerTask} - Tenant found: [tenant-id] 1 [tenant-domain] cloud1.qmog.cisco.com<http://cloud1.qmog.cisco.com> {org.apache.stratos.manager.publisher.TenantSynzhronizerTask} TID: [0] [STRATOS] [2014-09-17 22:09:01,002] DEBUG {org.apache.stratos.manager.publisher.TenantSynzhronizerTask} - Publishing complete tenant event {org.apache.stratos.manager.publisher.TenantSynzhronizerTask} … delegator handling the message… TID: [0] [STRATOS] [2014-09-17 23:39:06,202] DEBUG {org.apache.stratos.messaging.message.receiver.topology.TopologyEventMessageDelegator} - Delegating topology event message: org.apache.stratos.messaging.event.topology.ApplicationCreatedEvent {org.apache.stratos.messaging.message.receiver.topology.TopologyEventMessageDelegator}TID: [0] [STRATOS] [2014-09-17 23:39:06,202] DEBUG {org.apache.stratos.messaging.message.receiver.topology.TopologyManager} - Write lock released {org.apache.stratos.messaging.message.receiver.topology.TopologyManager} From: Martin Eppel (meppel) Sent: Wednesday, September 17, 2014 11:18 AM To: 'Isuru Haththotuwa' Cc: Lakmal Warusawithana; Udara Liyanage; Reka Thirunavukkarasu; Ryan Du Plessis (rdupless) Subject: RE: Updated Task List Quick question. As I have to persist the application subscription when the event is received (StratosManagerTopologyEventReceiver), it seems I have to handle some exceptions in the event receiver– so far I haven’t seen any topology event receivers which handle exceptions, should the exception be handled and simple logged or should it be re-thrown ? Any examples how we typically do that in stratos ? Also, I am thinking of reusing some of the code which is already written to persist ApplicationSubscriptions in the CartridgeSubscriptionsManager, which I believe was written still with the old flow model in mind ? Thanks Martin From: Isuru Haththotuwa [mailto:[email protected]] Sent: Wednesday, September 17, 2014 11:07 AM To: Martin Eppel (meppel) Cc: Lakmal Warusawithana; Udara Liyanage; Reka Thirunavukkarasu; Ryan Du Plessis (rdupless) Subject: Re: Updated Task List On Wed, Sep 17, 2014 at 8:55 PM, Martin Eppel (meppel) <[email protected]<mailto:[email protected]>> wrote: Hi Isuru, I think I am done with “persistence of service groups”, checked in the remainder yesterday evening. If you see something missing let me know, I’ll start working on the task, I think I get the idea what needs to be done, if I have more questions I’ll send you email Thanks Martin. Basically, what you need to do is: 1. Listen to the Application Created event in the SM side 2. Use the information in the event to keep track of tenant -> application id. When an Application is being deployed, we can also use this information to check if there is already an application with the same id, before sending it to CC side for parsing. Thanks Martin From: Isuru Haththotuwa [mailto:[email protected]<mailto:[email protected]>] Sent: Wednesday, September 17, 2014 5:23 AM To: Martin Eppel (meppel) Cc: Lakmal Warusawithana; Udara Liyanage; Reka Thirunavukkarasu Subject: Updated Task List Hi Martin, Please find the updated Task list for Grouping support. Note that there are another two items for M1 now, related to meta data service. Myself and udara are working on those. If you are done with deploying and persisting Group Definitions, would you be able to work on [1] ?. What we need to have is a way of telling which tenant has deployed which application, in SM. For that, we need to build a Composite App Subscription and persist at SM, listening to Application Created Event. A simple mapping from a tenant to application id would do for now. Lets improve it as we go along. Let us know if you have any doubts. [1]. Create and Persist Composite Application Subscriptions in SM from the Topology after the ApplicationCreatedEvent -- Thanks and Regards, Isuru H. +94 716 358 048<tel:%2B94%20716%20358%20048> -- Thanks and Regards, Isuru H. +94 716 358 048<tel:%2B94%20716%20358%20048> -- Lakmal Warusawithana Vice President, Apache Stratos Director - Cloud Architecture; WSO2 Inc. Mobile : +94714289692<tel:%2B94714289692> Blog : http://lakmalsview.blogspot.com/ -- Thanks and Regards, Isuru H. +94 716 358 048<tel:%2B94%20716%20358%20048> -- Thanks and Regards, Isuru H. +94 716 358 048
