diff options
Diffstat (limited to 'aai-service/provider')
-rw-r--r-- | aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java | 11 | ||||
-rw-r--r-- | aai-service/provider/src/test/resources/aaiclient.properties | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java index 46e03df3..3090e498 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java @@ -109,6 +109,7 @@ import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent; import org.onap.ccsdk.sli.adaptors.aai.data.v1507.VServer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.slf4j.MDC; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.AnnotationIntrospector; @@ -673,9 +674,13 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe // protected static AtomicLong tracker = new AtomicLong(); public static String getNextTransactionId() { -// long id = tracker.getAndIncrement(); -// String transactionId = String.format("N%016X", id); - String transactionId = UUID.randomUUID().toString(); + // Check if RequestId exists as MDC. If not, create new. + String transactionId = MDC.get("RequestId"); + if ("".equals(transactionId) || transactionId == null) { + transactionId = UUID.randomUUID().toString(); + LOG.info("Missing requestID. Assigned " + transactionId); + MDC.put("RequestId", transactionId); + } return transactionId; } diff --git a/aai-service/provider/src/test/resources/aaiclient.properties b/aai-service/provider/src/test/resources/aaiclient.properties index 732a96d0..bf0ab4e1 100644 --- a/aai-service/provider/src/test/resources/aaiclient.properties +++ b/aai-service/provider/src/test/resources/aaiclient.properties @@ -35,7 +35,7 @@ org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore=true org.onap.ccsdk.sli.adaptors.aai.client.name=SDNC org.onap.ccsdk.sli.adaptors.aai.client.psswd=SDNC -org.onap.ccsdk.sli.adaptors.aai.application=openECOMP +org.onap.ccsdk.sli.adaptors.aai.application=CCSDK # # Configuration file for A&AI Client |