From 9ad28ffcf2d2e9d441ebeb339c5a6c85ccff6f32 Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan" Date: Fri, 31 May 2019 12:13:12 -0400 Subject: converted lock time from hard coded value 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) --- .../java/org/onap/so/adapters/audit/AuditStackService.java | 10 ++++++---- .../so/adapters/inventory/create/CreateInventoryService.java | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'adapters/mso-openstack-adapters/src/main/java/org/onap') 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 f354e6c532..576acb1fd8 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 @@ -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(); } } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java index 8bd813026f..49a9e7e171 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryService.java @@ -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(); } } -- cgit 1.2.3-korg