diff --git a/components/org.wso2.carbon.identity.account.suspension.notification.task/src/main/java/org/wso2/carbon/identity/account/suspension/notification/task/AccountValidatorThread.java b/components/org.wso2.carbon.identity.account.suspension.notification.task/src/main/java/org/wso2/carbon/identity/account/suspension/notification/task/AccountValidatorThread.java index 58fa62eba..c532d14bf 100644 --- a/components/org.wso2.carbon.identity.account.suspension.notification.task/src/main/java/org/wso2/carbon/identity/account/suspension/notification/task/AccountValidatorThread.java +++ b/components/org.wso2.carbon.identity.account.suspension.notification.task/src/main/java/org/wso2/carbon/identity/account/suspension/notification/task/AccountValidatorThread.java @@ -90,7 +90,7 @@ private void handleTask(String tenantDomain) { } // Run the task only from master node in cluster setup. - if (isClusterModeEnabled() && !isHazelcastMasterNode()) { + if (isSingleNodeTaskExecutionEnabled() && !isHazelcastMasterNode()) { return; } @@ -178,7 +178,7 @@ private void handleTask(String tenantDomain) { * * @return true or false based on the deployment config. */ - private boolean isClusterModeEnabled() { + private boolean isSingleNodeTaskExecutionEnabled() { String clusterModeEnabledValue = IdentityUtil.getProperty(NotificationConstants.EXECUTE_TASK_IN_SINGLE_NODE); return StringUtils.isNotBlank(clusterModeEnabledValue) ? Boolean.parseBoolean(clusterModeEnabledValue) : false; diff --git a/components/org.wso2.carbon.identity.account.suspension.notification.task/src/main/java/org/wso2/carbon/identity/account/suspension/notification/task/internal/NotificationTaskServiceComponent.java b/components/org.wso2.carbon.identity.account.suspension.notification.task/src/main/java/org/wso2/carbon/identity/account/suspension/notification/task/internal/NotificationTaskServiceComponent.java index cb2f91ccd..d2f882d17 100644 --- a/components/org.wso2.carbon.identity.account.suspension.notification.task/src/main/java/org/wso2/carbon/identity/account/suspension/notification/task/internal/NotificationTaskServiceComponent.java +++ b/components/org.wso2.carbon.identity.account.suspension.notification.task/src/main/java/org/wso2/carbon/identity/account/suspension/notification/task/internal/NotificationTaskServiceComponent.java @@ -164,6 +164,7 @@ protected void unsetRealmService(RealmService realmService) { policy = ReferencePolicy.DYNAMIC, unbind = "unsetClusteringAgent") protected void setClusteringAgent(ConfigurationContextService configurationContextService) { + NotificationTaskDataHolder.getInstance().setClusteringAgent( configurationContextService.getServerConfigContext().getAxisConfiguration().getClusteringAgent()); }