From: Gurjeet Bedi Date: Fri, 22 Dec 2017 15:44:29 +0000 (-0500) Subject: Better handling for exception logs X-Git-Tag: 2.0.0-ONAP~45 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fgizmo.git;a=commitdiff_plain;h=cb54da50943ca8f2b339444bb0ce73c0d777d257 Better handling for exception logs Handling for dmaap not supporting offsets Issue-ID: AAI-552 Change-Id: I0af737d92861b7c6c22421a106d32c9b2c4fca7b Signed-off-by: Gurjeet Bedi --- diff --git a/src/main/java/org/onap/crud/service/CrudAsyncGraphDataService.java b/src/main/java/org/onap/crud/service/CrudAsyncGraphDataService.java index 16f054e..360a7dc 100644 --- a/src/main/java/org/onap/crud/service/CrudAsyncGraphDataService.java +++ b/src/main/java/org/onap/crud/service/CrudAsyncGraphDataService.java @@ -161,6 +161,8 @@ public class CrudAsyncGraphDataService extends AbstractGraphDataService { } catch (Exception e) { throw new CrudException("Error publishing request " + event.getTransactionId() + " Cause: " + e.getMessage(), Status.INTERNAL_SERVER_ERROR); } + + logger.debug(CrudServiceMsgs.ASYNC_DATA_SERVICE_INFO, "Event Sent ="+event.toJson()); logger.info(CrudServiceMsgs.ASYNC_DATA_SERVICE_INFO, "Event submitted of type: " + event.getObjectType() + " with key: " + event.getObjectKey() diff --git a/src/main/java/org/onap/crud/service/CrudAsyncResponseConsumer.java b/src/main/java/org/onap/crud/service/CrudAsyncResponseConsumer.java index da7e6e5..905fe15 100644 --- a/src/main/java/org/onap/crud/service/CrudAsyncResponseConsumer.java +++ b/src/main/java/org/onap/crud/service/CrudAsyncResponseConsumer.java @@ -25,6 +25,8 @@ package org.onap.crud.service; import java.util.TimerTask; +import javax.naming.OperationNotSupportedException; + import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.crud.event.GraphEvent; @@ -107,7 +109,12 @@ public class CrudAsyncResponseConsumer extends TimerTask { try { asyncResponseConsumer.commitOffsets(); - } catch (Exception e) { + } + catch(OperationNotSupportedException e) { + //Dmaap doesnt support commit with offset + logger.debug(CrudServiceMsgs.ASYNC_RESPONSE_CONSUMER_ERROR, e.getMessage()); + } + catch (Exception e) { logger.error(CrudServiceMsgs.ASYNC_RESPONSE_CONSUMER_ERROR, e.getMessage()); }