Fix auth failure to dmaap after upgrade 19/124919/4
authorMichaelMorris <michael.morris@est.tech>
Wed, 13 Oct 2021 20:09:19 +0000 (21:09 +0100)
committerMichael Morris <michael.morris@est.tech>
Thu, 14 Oct 2021 12:44:53 +0000 (12:44 +0000)
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Issue-ID: SDC-3756
Change-Id: I58e6f99156e1e64443cd79c2e08f73987329b88d

catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineInitTask.java

index 6207cd2..d61e150 100644 (file)
@@ -197,6 +197,14 @@ public class DistributionEngineInitTask implements Runnable {
         CambriaErrorResponse registerStatus = cambriaHandler
             .registerToTopic(environmentEntry.getDmaapUebAddress(), environmentEntry.getUebApikey(), environmentEntry.getUebSecretKey(),
                 environmentEntry.getUebApikey(), subscriberType, topicName);
+
+        if (CambriaOperationStatus.AUTHENTICATION_ERROR.equals(registerStatus.getOperationStatus())
+                || CambriaOperationStatus.CONNNECTION_ERROR.equals(registerStatus.getOperationStatus())){
+            registerStatus = cambriaHandler
+                    .registerToTopic(environmentEntry.getDmaapUebAddress(), deConfiguration.getUebPublicKey(), deConfiguration.getUebSecretKey(),
+                            environmentEntry.getUebApikey(), subscriberType, topicName);
+        }
+
         String role = CONSUMER;
         if (subscriberType == SubscriberTypeEnum.PRODUCER) {
             role = PRODUCER;