package com.java110.core.aop;

import com.java110.core.factory.Java110TraceFactory;
import com.java110.core.log.LoggerFactory;
import com.java110.dto.trace.TraceAnnotationsDto;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;

@Aspect
public class Java110FeignClientAop {
    private static Logger logger = LoggerFactory.getLogger(Java110FeignClientAop.class);

    @Around("execution (* feign.Client.*(..)) && !within(is(FinalType))")
    public Object feignClientWasCalled(final ProceedingJoinPoint pjp) throws Throwable {

        Java110TraceFactory.putAnnotations(TraceAnnotationsDto.VALUE_SERVER_SEND);
        Object clientHttpResponse = pjp.proceed();
        Java110TraceFactory.putAnnotations(TraceAnnotationsDto.VALUE_SERVER_RECEIVE);
        return clientHttpResponse;
    }

}

@@ -330,15 +330,75 @@
 er;%0A
-%0A@Aspec
+import org.springframework.stereotype.Component;%0A%0A@Aspect%0A@Componen
 t%0Apu
@@ -686,16 +686,96 @@
 able %7B%0A%0A
+        logger.debug(%22feign %E8%BF%9B%E5%85%A5 Java110FeignClientAop%3E%3E feignClientWasCalled%22);%0A%0A
         

优化 feign 失败