From e57ae2b868eb1015a723ff522f787587f99aab74 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Fri, 1 Mar 2019 14:55:31 -0500 Subject: audit poller is polling too fast Fix version incompatibility in external task client Fix the openstack external task to poll slower Change-Id: I376366f4848afd1eb356f43b556b7de20961ba88 Issue-ID: SO-1587 Signed-off-by: Benjamin, Max (mb388a) --- adapters/mso-openstack-adapters/pom.xml | 164 +++++++-------------- .../onap/so/adapters/audit/AuditStackService.java | 6 +- .../so/adapters/audit/AuditStackServiceData.java | 2 +- .../adapters/audit/AuditStackServiceDataTest.java | 2 +- 4 files changed, 62 insertions(+), 112 deletions(-) diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml index f2ee07317c..f2f411d5b6 100644 --- a/adapters/mso-openstack-adapters/pom.xml +++ b/adapters/mso-openstack-adapters/pom.xml @@ -13,8 +13,8 @@ ${project.artifactId}-${project.version} - - + + org.apache.maven.plugins maven-dependency-plugin @@ -36,75 +36,25 @@ - - org.codehaus.mojo - jaxws-maven-plugin - 2.4.1 - - - generate-network-async-stubs - process-classes - - wsimport - - - - -Djavax.xml.accessExternalSchema=all - - src/main/resources/wsdl - - NetworkAdapterNotify.wsdl - - /NetworkAdapterNotify.wsdl - org.onap.so.adapters.network.async.client - false - true - - - - - generate-vnf-async-stubs - process-classes - - wsimport - - - - -Djavax.xml.accessExternalSchema=all - - src/main/resources/wsdl - - VnfAdapterNotify.wsdl - - /VnfAdapterNotify.wsdl - org.onap.so.adapters.vnf.async.client - false - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.0.0 - - - add-source - generate-sources - - add-source - - - - ${project.build.directory}/generated-sources/wsimport/ - - - - - - --> org.jacoco jacoco-maven-plugin @@ -126,12 +76,12 @@ - - - + + + - org.eclipse.m2e @@ -168,10 +118,10 @@ - + - org.springframework.boot - spring-boot-starter-actuator + org.springframework.boot + spring-boot-starter-actuator org.springframework.boot @@ -184,7 +134,7 @@ org.apache.cxf cxf-spring-boot-starter-jaxws - ${cxf.version} + ${cxf.version} org.apache.cxf @@ -192,31 +142,31 @@ ${cxf.version} - org.apache.cxf - cxf-rt-rs-service-description-swagger - ${cxf.version} + org.apache.cxf + cxf-rt-rs-service-description-swagger + ${cxf.version} - org.webjars - swagger-ui - 3.5.0 - + org.webjars + swagger-ui + 3.5.0 + org.springframework.boot spring-boot-starter-test test - janino - janino - 2.5.15 + janino + janino + 2.5.15 - - - - - - + + + + + + org.onap.so.adapters mso-adapter-utils @@ -231,23 +181,23 @@ javax.servlet javax.servlet-api test - + org.mariadb.jdbc mariadb-java-client - + org.onap.so common ${project.version} - ch.vorburger.mariaDB4j - mariaDB4j - 2.2.3 - test - - + ch.vorburger.mariaDB4j + mariaDB4j + 2.2.3 + test + + org.springframework.cloud spring-cloud-contract-wiremock 1.2.4.RELEASE @@ -260,13 +210,13 @@ org.onap.so.libs.openstack-java-sdk - nova-model + nova-model ${openstack.version} - org.camunda.bpm - camunda-external-task-client - 1.2.0-SNAPSHOT - + org.camunda.bpm + camunda-external-task-client + 1.0.0 + diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java index aace75ff99..499c1137c7 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java @@ -59,9 +59,9 @@ public class AuditStackService { ClientRequestInterceptor interceptor = new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth); ExternalTaskClient client = ExternalTaskClient.create() - .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(5).addInterceptor(interceptor) - .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(5000, 2, 30000)).build(); - client.subscribe("InventoryAudit").lockDuration(5000) + .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor) + .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(10000, 2, 120000)).build(); + client.subscribe("InventoryAudit").lockDuration(60000) .handler(auditStack::executeExternalTask).open(); } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java index d1f952c829..773705d566 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java @@ -72,7 +72,7 @@ public class AuditStackServiceData { }else if(externalTask.getRetries() != null && externalTask.getRetries()-1 == 0){ logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId()); - externalTaskService.handleBpmnError(externalTask, "AuditAAIInventoryFailure", "Number of Retries Exceeded auditing inventory"); + externalTaskService.handleBpmnError(externalTask, "AuditAAIInventoryFailure"); }else{ logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ", externalTask.getId(),externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries())); externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries())); diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java index 52b67b8eb9..d7739e56f6 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java @@ -105,7 +105,7 @@ public class AuditStackServiceDataTest extends AuditStackServiceData { doReturn(1).when(mockExternalTask).getRetries(); auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService); Mockito.verify(mockExternalTaskService).handleBpmnError(mockExternalTask, - "AuditAAIInventoryFailure", "Number of Retries Exceeded auditing inventory"); + "AuditAAIInventoryFailure"); } @Test -- cgit 1.2.3-korg