stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johannnallathamby <...@git.apache.org>
Subject [GitHub] stratos pull request: Messaging model changes and MQTT integration
Date Fri, 19 Dec 2014 19:10:09 GMT
Github user johannnallathamby commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/50#discussion_r22122521
  
    --- Diff: components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/publisher/TenantEventPublisher.java
---
    @@ -38,78 +38,83 @@
      */
     public class TenantEventPublisher implements TenantMgtListener {
     
    -    private static final Log log = LogFactory.getLog(TenantEventPublisher.class);
    -    private static final int EXEC_ORDER = 1;
    +	private static final Log log = LogFactory.getLog(TenantEventPublisher.class);
    +	private static final int EXEC_ORDER = 1;
     
    +	@Override
    +	public void onTenantCreate(TenantInfoBean tenantInfo) throws StratosException {
    +		try {
    +			if (log.isDebugEnabled()) {
    +				log.debug(String.format("Publishing tenant created event: [tenant-id] %d [tenant-domain]
%s",
    +				                        tenantInfo.getTenantId(), tenantInfo.getTenantDomain()));
    +			}
    +			Tenant tenant = new Tenant(tenantInfo.getTenantId(), tenantInfo.getTenantDomain());
    +			TenantCreatedEvent event = new TenantCreatedEvent(tenant);
    +			String topic = Util.getMessageTopicName(event);
    +			EventPublisher eventPublisher = EventPublisherPool.getPublisher(topic);
    +			eventPublisher.publish(event);
    +		} catch (Exception e) {
    +			log.error("Could not publish tenant created event", e);
    --- End diff --
    
    Can log with more context about 'event' and 'tenant'.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message