From 9e9f0077a6bc1c5bce89caec957b7577d1df0c06 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Thu, 2 May 2019 07:17:11 +0000 Subject: Bugfix, trace context When retrying of file publish, the RequestID in the trace context is incorect. The context must be expicitly updated since retrying is executed in a separate thread. Change-Id: I1c5dc0ba0e53c1219e23f93d8c5b420996a16c93 Issue-ID: DCAEGEN2-1462 Signed-off-by: PatrikBuhr --- .../dcaegen2/collectors/datafile/tasks/DataRouterPublisher.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'datafile-app-server/src/main') diff --git a/datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/tasks/DataRouterPublisher.java b/datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/tasks/DataRouterPublisher.java index 950fbae9..4028ac3f 100644 --- a/datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/tasks/DataRouterPublisher.java +++ b/datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/tasks/DataRouterPublisher.java @@ -83,9 +83,7 @@ public class DataRouterPublisher { public Mono publishFile(FilePublishInformation publishInfo, long numRetries, Duration firstBackoff) { MDC.setContextMap(publishInfo.getContext()); - logger.trace("publishFile called with arg {}", publishInfo); dmaapProducerReactiveHttpClient = resolveClient(); - return Mono.just(publishInfo) // .cache() // .flatMap(this::publishFile) // @@ -93,8 +91,8 @@ public class DataRouterPublisher { .retryBackoff(numRetries, firstBackoff); } - private Mono publishFile(FilePublishInformation publishInfo - ) { + private Mono publishFile(FilePublishInformation publishInfo) { + MDC.setContextMap(publishInfo.getContext()); logger.trace("Entering publishFile with {}", publishInfo); try { HttpPut put = new HttpPut(); -- cgit 1.2.3-korg