We have added the below aspect, I believe it should not cause not much latency.
@Pointcut("execution(* xx.xx.xx.xx.rest.customfilter.doFilter"
+ "(javax.servlet.ServletRequest,javax.servlet.ServletResponse,javax.servlet.FilterChain)) && args(request,response,filterChain) && if()")
We used "around" the advice. Advice logic as below.
HttpServletRequest req = (HttpServletRequest) request;
if (!req.getRequestURI().startsWith("/admin")) {
String shadowHeader = req.getHeader("XXX");
String rugsUuidHeader = req.getHeader("XXX");
if (logger.isDebugEnabled()) {
logger.debug(shadowHeader + "--" + req.getRequestURI());
}
if (!StringUtil.isEmpty(shadowHeader)) {
xxxStore.getInstance().addContext(new xxxContext(shadowHeader));
xxxLogStore.getInstance().initializeShadowLog(xxxStore.getInstance().getContext().getCorrelationId());
} else if (!StringUtil.isEmpty(rugsUuidHeader)) {
xxxStore.getInstance().addContext(rugsUuidHeader);
}
}
return (jointPoint.proceed());
And another aspect on @Pointcut("execution( * org.springframework.messaging.MessageChannel.send(org.springframework.messaging.Message,long)) . in
This also around advice, inside we are doing if condition and log4j logging.
Could please advise below aspect is causing 30 ms latency, something else we need to tune..?
Regards,
Rajendra Bhat