import com.att.eelf.configuration.EELFManager;\r
\r
import java.util.Date;\r
+import java.util.concurrent.ThreadLocalRandom;\r
\r
import org.onap.clamp.clds.config.ClampProperties;\r
import org.onap.clamp.clds.config.sdc.SdcSingleControllerConfiguration;\r
public void treatNotification(INotificationData iNotif) {\r
CsarHandler csar = null;\r
try {\r
+ // wait for a random time, so that 2 running Clamp will not treat the same Notification at the same time \r
+ int i = ThreadLocalRandom.current().nextInt(1, 5);\r
+ Thread.sleep(i * 1000);\r
+\r
logger.info("Notification received for service UUID:" + iNotif.getServiceUUID());\r
this.changeControllerStatus(SdcSingleControllerStatus.BUSY);\r
csar = new CsarHandler(iNotif, this.sdcConfig.getSdcControllerName(),\r
this.sendSdcNotification(NotificationType.DEPLOY, csar.getArtifactElement().getArtifactURL(),\r
sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.DEPLOY_ERROR,\r
e.getMessage(), System.currentTimeMillis());\r
+ } catch (InterruptedException e) {\r
+ logger.error("Interrupt exception caught during the notification processing", e);\r
} catch (RuntimeException e) {\r
logger.error("Unexpected exception caught during the notification processing", e);\r
} finally {\r