* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.onap.aai.dmaap;
eventName = jo.getString("event-topic");
}
+ MDC.put ("targetEntity", "DMAAP");
+ if (jo.getString("event-topic") != null) {
+ eventName = jo.getString("event-topic");
+ MDC.put ("targetServiceName", eventName);
+ }
+ MDC.put ("serviceName", "AAI");
+ MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.COMPLETE.toString());
+ MDC.put(LoggingField.RESPONSE_CODE.toString(), "0");
LOGGER.info(eventName + "|" + aaiEvent);
+
if ("AAI-EVENT".equals(eventName)) {
this.sentWithHttp(this.httpClient, this.aaiEventUrl, aaiEvent);
} else {
}
} catch (java.net.SocketException e) {
if (!e.getMessage().contains("Connection reset")) {
+ MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.ERROR.toString());
+ MDC.put(LoggingField.RESPONSE_CODE.toString(), "200");
LOGGER.error("AAI_7304 Error reaching DMaaP to send event. " + aaiEvent, e);
}
} catch (IOException e) {
+ MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.ERROR.toString());
+ MDC.put(LoggingField.RESPONSE_CODE.toString(), "200");
LOGGER.error("AAI_7304 Error reaching DMaaP to send event. " + aaiEvent, e);
} catch (JMSException | JSONException e) {
+ MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.ERROR.toString());
+ MDC.put(LoggingField.RESPONSE_CODE.toString(), "200");
LOGGER.error("AAI_7350 Error parsing aaievent jsm message for sending to dmaap. " + jsmMessageTxt, e);
} catch (Exception e) {
+ MDC.put(LoggingField.STATUS_CODE.toString(), StatusCode.ERROR.toString());
+ MDC.put(LoggingField.RESPONSE_CODE.toString(), "200");
LOGGER.error("AAI_7350 Error sending message to dmaap. " + jsmMessageTxt, e);
}
}