converted lock time from hard coded value 62/89062/1
authorKalkere Ramesh, Sharan <sharan.kalkere.ramesh@att.com>
Fri, 31 May 2019 16:13:12 +0000 (12:13 -0400)
committerBenjamin, Max (mb388a) <mb388a@us.att.com>
Fri, 31 May 2019 16:13:24 +0000 (12:13 -0400)
update lock time property to have a default of 60000
converted lock time from hard coded to property driven

Change-Id: I4a42b85c4241c8865f8dc133be96d7bc92b8574d
Issue-ID: SO-1962
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java
adapters/mso-openstack-adapters/src/main/resources/application-local.yaml
adapters/mso-openstack-adapters/src/test/resources/application-test.yaml

index f354e6c..576acb1 100644 (file)
@@ -53,8 +53,9 @@ public class AuditStackService {
     public void auditAddAAIInventory() throws Exception {
         for (int i = 0; i < getMaxClients(); i++) {
             ExternalTaskClient client = createExternalTaskClient();
-            client.subscribe("InventoryAddAudit").lockDuration(60000).handler(auditCreateStack::executeExternalTask)
-                    .open();
+            client.subscribe("InventoryAddAudit")
+                    .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000")))
+                    .handler(auditCreateStack::executeExternalTask).open();
         }
     }
 
@@ -62,8 +63,9 @@ public class AuditStackService {
     public void auditDeleteAAIInventory() throws Exception {
         for (int i = 0; i < getMaxClients(); i++) {
             ExternalTaskClient client = createExternalTaskClient();
-            client.subscribe("InventoryDeleteAudit").lockDuration(60000).handler(auditDeleteStack::executeExternalTask)
-                    .open();
+            client.subscribe("InventoryDeleteAudit")
+                    .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000")))
+                    .handler(auditDeleteStack::executeExternalTask).open();
         }
     }
 
index 8bd8130..49a9e7e 100644 (file)
@@ -59,7 +59,9 @@ public class CreateInventoryService {
         ExternalTaskClient client = ExternalTaskClient.create()
                 .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor)
                 .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0)).build();
-        client.subscribe("InventoryCreate").lockDuration(60000).handler(createInventory::executeExternalTask).open();
+        client.subscribe("InventoryCreate")
+                .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000")))
+                .handler(createInventory::executeExternalTask).open();
     }
 
 }
index 2ec5be7..66d63d4 100644 (file)
@@ -51,6 +51,8 @@ tomcat:
 mso:
   msoKey: 07a7159d3bf51a0e53be7a8f89699be7
   auth: 6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436
+  audit:
+    lock-time: 240000
   logPath: logs
   msb-ip: localhost
   msb-port: ${wiremock.server.port}
index ce576f0..7cc7697 100644 (file)
@@ -63,6 +63,8 @@ ssl-enable: false
 tomcat:
   max-threads: 50
 mso:
+  audit:
+    lock-time: 240000
   logPath: logs
   msb-ip: localhost
   msb-port: ${wiremock.server.port}