diff options
-rw-r--r-- | holmes-actions/pom.xml | 2 | ||||
-rw-r--r-- | holmes-actions/src/main/java/org/onap/holmes/common/utils/MsbRegister.java | 38 | ||||
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | version.properties | 4 |
4 files changed, 25 insertions, 21 deletions
diff --git a/holmes-actions/pom.xml b/holmes-actions/pom.xml index b44e021..1000189 100644 --- a/holmes-actions/pom.xml +++ b/holmes-actions/pom.xml @@ -12,7 +12,7 @@ <parent>
<groupId>org.onap.holmes.common</groupId>
<artifactId>holmes-common-parent</artifactId>
- <version>1.3.9-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<name>holmes-common-service</name>
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/utils/MsbRegister.java b/holmes-actions/src/main/java/org/onap/holmes/common/utils/MsbRegister.java index 79ccbdc..3b72aaf 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/utils/MsbRegister.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/utils/MsbRegister.java @@ -53,23 +53,27 @@ public class MsbRegister { int retry = 0; int interval = 5; while (null == microServiceFullInfo && retry < 20) { - log.info("Holmes Service Registration. Retry: " + retry++); - - microServiceFullInfo = client - .header("Accept", MediaType.APPLICATION_JSON) - .queryParam("createOrUpdate", true) - .post(String.format("%s://%s:%s/api/microservices/v1/services", - isHttpsEnabled ? PROTOCOL_HTTPS : PROTOCOL_HTTP, msbAddrInfo[0], msbAddrInfo[1]), - Entity.entity(msinfo, MediaType.APPLICATION_JSON), - MicroServiceFullInfo.class); - - if (null == microServiceFullInfo) { - log.warn(String.format("Failed to register the service to MSB. Sleep %ds and try again.", interval)); - threadSleep(TimeUnit.SECONDS.toSeconds(interval)); - interval += 5; - } else { - log.info("Registration succeeded!"); - break; + try { + log.info("Holmes Service Registration. Retry: " + retry++); + + microServiceFullInfo = client + .header("Accept", MediaType.APPLICATION_JSON) + .queryParam("createOrUpdate", true) + .post(String.format("%s://%s:%s/api/microservices/v1/services", + isHttpsEnabled ? PROTOCOL_HTTPS : PROTOCOL_HTTP, msbAddrInfo[0], msbAddrInfo[1]), + Entity.entity(msinfo, MediaType.APPLICATION_JSON), + MicroServiceFullInfo.class); + + if (null == microServiceFullInfo) { + log.warn(String.format("Failed to register the service to MSB. Sleep %ds and try again.", interval)); + threadSleep(TimeUnit.SECONDS.toSeconds(interval)); + interval += 5; + } else { + log.info("Registration succeeded!"); + break; + } + } catch (Exception e) { + log.warn("Unexpected exception: " + e.getMessage(), e); } } @@ -20,7 +20,7 @@ <artifactId>holmes-common-parent</artifactId>
<packaging>pom</packaging>
- <version>1.3.9-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
<name>holmes-common</name>
<modules>
<module>holmes-actions</module>
diff --git a/version.properties b/version.properties index 7538792..611dff3 100644 --- a/version.properties +++ b/version.properties @@ -3,8 +3,8 @@ # because they are used in Jenkins, whose plug-in doesn't support
major=1
-minor=3
-patch=9
+minor=4
+patch=0
base_version=${major}.${minor}.${patch}
|