currentContext.setUserRealm(registry.getUserRealm());
currentContext.setUsername(registry.getUserName());
return eventingService.subscribe(subscription);
} catch (InvalidMessageException e) {
throw new DeploymentSynchronizerException("Error while subscribing for registry " +
"events on collection: " + absolutePath, e);
} finally {
SuperTenantCarbonContext.endTenantFlow();
}
}