Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7DA77200CC5 for ; Tue, 11 Jul 2017 23:50:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7BEE1167514; Tue, 11 Jul 2017 21:50:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C99BF16750D for ; Tue, 11 Jul 2017 23:50:29 +0200 (CEST) Received: (qmail 76252 invoked by uid 500); 11 Jul 2017 21:50:29 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 76243 invoked by uid 99); 11 Jul 2017 21:50:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2017 21:50:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D88F0E9471; Tue, 11 Jul 2017 21:50:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: machristie@apache.org To: commits@airavata.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: airavata git commit: Start DB Event Manager before other servers Date: Tue, 11 Jul 2017 21:50:28 +0000 (UTC) archived-at: Tue, 11 Jul 2017 21:50:30 -0000 Repository: airavata Updated Branches: refs/heads/develop e72ddf0b3 -> 33a601fe8 Start DB Event Manager before other servers Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/33a601fe Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/33a601fe Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/33a601fe Branch: refs/heads/develop Commit: 33a601fe84d297b11171a1157a2561a451ad9d84 Parents: e72ddf0 Author: Marcus Christie Authored: Tue Jul 11 16:46:32 2017 -0500 Committer: Marcus Christie Committed: Tue Jul 11 16:46:32 2017 -0500 ---------------------------------------------------------------------- .../api/service/messaging/RegistryServiceDBEventHandler.java | 7 ++++++- .../src/main/java/org/apache/airavata/server/ServerMain.java | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/33a601fe/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java index 0fb387a..5652722 100644 --- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java +++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java @@ -91,7 +91,12 @@ public class RegistryServiceDBEventHandler implements MessageHandler { } case UPDATE: { logger.info("Replicating updateGateway in Registry."); - registryClient.updateGateway(gateway.getGatewayId(), gateway); + if (!registryClient.isGatewayExist(gateway.getGatewayId())) { + logger.info("Gateway doesn't exist so adding instead of updating."); + registryClient.addGateway(gateway); + } else { + registryClient.updateGateway(gateway.getGatewayId(), gateway); + } logger.info("updateGateway Replication Success!"); break; } http://git-wip-us.apache.org/repos/asf/airavata/blob/33a601fe/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java ---------------------------------------------------------------------- diff --git a/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java b/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java index 36d317b..a391291 100644 --- a/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java +++ b/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java @@ -113,23 +113,23 @@ public class ServerMain { List serverList = new ArrayList<>(Arrays.asList(serverNames.split(","))); if (serverList.indexOf(ALL_IN_ONE) > -1) { serverList.clear(); - serverList.add(REGISTRY_SERVER); // registry server should start before everything + serverList.add(DB_EVENT_MANAGER); // DB Event Manager should start before everything + serverList.add(REGISTRY_SERVER); // registry server should start before everything else serverList.add(CREDENTIAL_STORE); // credential store should start before api server serverList.add(SHARING_SERVER); serverList.add(API_SERVER); serverList.add(ORCHESTRATOR); serverList.add(GFAC_SERVER); serverList.add(PROFILE_SERVICE); - serverList.add(DB_EVENT_MANAGER); } else if (serverList.indexOf(API_ORCH) > -1) { serverList.clear(); - serverList.add(REGISTRY_SERVER); // registry server should start before everything + serverList.add(DB_EVENT_MANAGER); // DB Event Manager should start before everything + serverList.add(REGISTRY_SERVER); // registry server should start before everything else serverList.add(CREDENTIAL_STORE); // credential store should start before api server serverList.add(SHARING_SERVER); serverList.add(API_SERVER); serverList.add(ORCHESTRATOR); serverList.add(PROFILE_SERVICE); - serverList.add(DB_EVENT_MANAGER); } else if (serverList.indexOf(EXECUTION) > -1) { serverList.clear(); serverList.add(GFAC_SERVER);