CHANGES IN THE NEW RELEASE
CODE CHANGES
{ //log.info("request body: " + copiedRequest.getRequestBodyAsString()); Disabled the request body as the body doesn't have any context to it#}
-{ HttpServletRequest req = (HttpServletRequest) request;
//log.info("Request Method : " + req.getMethod().trim());
if (!req.getMethod().trim().equalsIgnoreCase("GET")) {
/* GET request means no request body, so parsing will fail */
l7message = new ObjectMapper().readValue(copiedRequest.getRequestBody(), Layer7Message.class);
if (l7message != null) {
MDC.put(MDC_MESSAGE_ID_KEY, l7message.getEnvelope().getMqmd().getMessageIdByte());
MDC.put(MDC_CORRELATION_ID_KEY, l7message.getEnvelope().getMqmd().getCorrelationIdByte());
MDC.put(MDC_DATA_KEY, String.format("[msgId:%s, corlId:%s]", l7message.getEnvelope().getMqmd().getMessageIdByte(), l7message.getEnvelope().getMqmd().getCorrelationIdByte()));
}
DESCRIPTION
BCPARIS API was configured with the liveness and readiness probe (GET request with no body to the path /health/actuator) to trigger every 10 seconds interval in OCP. Due to this lot of GET requests with empty body was incoming on the BCPARIS API.
The BCPARIS API logging filter code was trying to PARSE every incoming request to a Layer 7 message type it was causing exception for request with empty body.
Solution is to Modify the logging filter code to not parse the incoming request in case of a GET request.