108 changed files with 698 additions and 119 deletions
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class EpmetAdminOpenFeignClientFallbackFactory implements FallbackFactory<EpmetAdminOpenFeignClient> { |
||||
|
|
||||
|
private EpmetAdminOpenFeignClientFallback fallback = new EpmetAdminOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public EpmetAdminOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -1,45 +1,45 @@ |
|||||
/** |
///**
|
||||
* Copyright (c) 2018 人人开源 All rights reserved. |
// * Copyright (c) 2018 人人开源 All rights reserved.
|
||||
* <p> |
// * <p>
|
||||
* https://www.renren.io
|
// * https://www.renren.io
|
||||
* <p> |
// * <p>
|
||||
* 版权所有,侵权必究! |
// * 版权所有,侵权必究!
|
||||
*/ |
// */
|
||||
|
//
|
||||
package com.epmet.commons.tools.aspect; |
//package com.epmet.commons.tools.aspect;
|
||||
|
//
|
||||
import com.epmet.commons.tools.constant.ThreadLocalConstant; |
//import com.epmet.commons.tools.constant.ThreadLocalConstant;
|
||||
import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; |
//import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO;
|
||||
import com.epmet.commons.tools.exception.ExceptionUtils; |
//import com.epmet.commons.tools.exception.ExceptionUtils;
|
||||
import org.aspectj.lang.JoinPoint; |
//import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.Aspect; |
//import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before; |
//import org.aspectj.lang.annotation.Before;
|
||||
import org.slf4j.Logger; |
//import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory; |
//import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.annotation.Order; |
//import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component; |
//import org.springframework.stereotype.Component;
|
||||
|
//
|
||||
/** |
///**
|
||||
* 每次请求,清理ThreadLocal线程中的变量 |
// * 每次请求,清理ThreadLocal线程中的变量(已废弃,改用GlobalFilter)
|
||||
* @Author wxz |
// * @Author wxz
|
||||
* @Description |
// * @Description
|
||||
* @Date 2020/4/23 16:16 |
// * @Date 2020/4/23 16:16
|
||||
**/ |
// **/
|
||||
@Aspect |
//@Aspect
|
||||
@Component |
//@Component
|
||||
@Order(1) |
//@Order(1)
|
||||
public class ThreadLocalInitAspect { |
//public class ThreadLocalInitAspect {
|
||||
|
//
|
||||
private static final Logger log = LoggerFactory.getLogger(ThreadLocalInitAspect.class); |
// private static final Logger log = LoggerFactory.getLogger(ThreadLocalInitAspect.class);
|
||||
|
//
|
||||
@Before(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") |
// @Before(value = "execution(* com.epmet.controller.*Controller*.*(..)) ")
|
||||
public void before(JoinPoint point) throws Throwable { |
// public void before(JoinPoint point) throws Throwable {
|
||||
// 清理权限过滤中的变量残留
|
// // 清理权限过滤中的变量残留
|
||||
try { |
// try {
|
||||
ThreadLocalConstant.sqlFilter.remove(); |
// ThreadLocalConstant.sqlFilter.remove();
|
||||
ThreadLocalConstant.requirePermissionTl.remove(); |
// ThreadLocalConstant.requirePermissionTl.remove();
|
||||
} catch (Exception e) { |
// } catch (Exception e) {
|
||||
log.error("清理sqlFilter缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); |
// log.error("清理sqlFilter缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
|
||||
} |
// }
|
||||
} |
// }
|
||||
} |
//}
|
||||
|
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.commons.tools.filter; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ThreadLocalConstant; |
||||
|
|
||||
|
import javax.servlet.*; |
||||
|
import javax.servlet.annotation.WebFilter; |
||||
|
import java.io.IOException; |
||||
|
|
||||
|
/** |
||||
|
* @Description 全局过滤器,可在请求结束的时候清除线程变量残留 |
||||
|
* @author wxz |
||||
|
* @date 2021.07.19 10:19:24 |
||||
|
*/ |
||||
|
@WebFilter(value = "/*") |
||||
|
public class GlobalFilter implements Filter { |
||||
|
|
||||
|
@Override |
||||
|
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { |
||||
|
try { |
||||
|
filterChain.doFilter(servletRequest, servletResponse); |
||||
|
} catch (Throwable e) { |
||||
|
throw e; |
||||
|
} finally { |
||||
|
// 清除线程变量残留
|
||||
|
ThreadLocalConstant.sqlFilter.remove(); |
||||
|
ThreadLocalConstant.requirePermissionTl.remove(); |
||||
|
ThreadLocalConstant.requestParam.remove(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.feign.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.DataReportOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class DataReportOpenFeignClientFallBackFactory implements FallbackFactory<DataReportOpenFeignClient> { |
||||
|
private DataReportOpenFeignClientFallBack fallback = new DataReportOpenFeignClientFallBack(); |
||||
|
|
||||
|
@Override |
||||
|
public DataReportOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class EpmetCommonServiceOpenFeignClientFallbackFactory implements FallbackFactory<EpmetCommonServiceOpenFeignClient> { |
||||
|
|
||||
|
private EpmetCommonServiceOpenFeignClientFallback fallback = new EpmetCommonServiceOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public EpmetCommonServiceOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.EpmetHeartOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class EpmetHeartOpenFeignClientFallbackFactory implements FallbackFactory<EpmetHeartOpenFeignClient> { |
||||
|
|
||||
|
private EpmetHeartOpenFeignClientFallback fallback = new EpmetHeartOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public EpmetHeartOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class EpmetMessageOpenFeignClientFallbackFactory implements FallbackFactory<EpmetMessageOpenFeignClient> { |
||||
|
|
||||
|
private EpmetMessageOpenFeignClientFallback fallback = new EpmetMessageOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public EpmetMessageOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.OssFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class OssFeignClientFallbackFactory implements FallbackFactory<OssFeignClient> { |
||||
|
|
||||
|
private OssFeignClientFallback fallback = new OssFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public OssFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.EpmetPointOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class EpmetPointOpenFeignClientFallbackFactory implements FallbackFactory<EpmetPointOpenFeignClient> { |
||||
|
|
||||
|
private EpmetPointOpenFeignClientFallback fallback = new EpmetPointOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public EpmetPointOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.EpmetThirdOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class EpmetThirdOpenFeignClientFallbackFactory implements FallbackFactory<EpmetThirdOpenFeignClient> { |
||||
|
private EpmetThirdOpenFeignClientFallback fallback = new EpmetThirdOpenFeignClientFallback(); |
||||
|
@Override |
||||
|
public EpmetThirdOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.ThirdOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class ThirdOpenFeignClientFallbackFactory implements FallbackFactory<ThirdOpenFeignClient> { |
||||
|
|
||||
|
private ThirdOpenFeignClientFallback fallback = new ThirdOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public ThirdOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.GovAccessFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Description fallBackFactory,用于抛出异常之后,返回一个Fallback降级处理对象 |
||||
|
* @author wxz |
||||
|
* @date 2021.07.15 09:54:14 |
||||
|
*/ |
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class GovAccessFeignClientFallBackFactory implements FallbackFactory<GovAccessFeignClient> { |
||||
|
|
||||
|
/** |
||||
|
* 降级处理对象 |
||||
|
*/ |
||||
|
private GovAccessFeignClientFallBack fallBack = new GovAccessFeignClientFallBack(); |
||||
|
|
||||
|
@Override |
||||
|
public GovAccessFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallBack; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.GovIssueOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class GovIssueOpenFeignClientFallBackFactory implements FallbackFactory<GovIssueOpenFeignClient> { |
||||
|
|
||||
|
private GovIssueOpenFeignClientFallBack fallback = new GovIssueOpenFeignClientFallBack(); |
||||
|
|
||||
|
@Override |
||||
|
public GovIssueOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.GovOrgOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class GovOrgOpenFeignClientFallbackFactory implements FallbackFactory<GovOrgOpenFeignClient> { |
||||
|
|
||||
|
private GovOrgOpenFeignClientFallback fallback = new GovOrgOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public GovOrgOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.GovProjectOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class GovProjectOpenFeignClientFallbackFactory implements FallbackFactory<GovProjectOpenFeignClient> { |
||||
|
|
||||
|
private GovProjectOpenFeignClientFallback fallback = new GovProjectOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public GovProjectOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.GovVoiceOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class GovVoiceOpenFeignClientFallbackFactory implements FallbackFactory<GovVoiceOpenFeignClient> { |
||||
|
|
||||
|
private GovVoiceOpenFeignClientFallback fallback = new GovVoiceOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public GovVoiceOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.OperAccessOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class OperAccessOpenFeignClientFallbackFactory implements FallbackFactory<OperAccessOpenFeignClient> { |
||||
|
private OperAccessOpenFeignClientFallback fallback = new OperAccessOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public OperAccessOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.OperCrmOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class OperCrmOpenFeignClientFallbackFactory implements FallbackFactory<OperCrmOpenFeignClient> { |
||||
|
|
||||
|
private OperCrmOpenFeignClientFallback fallback = new OperCrmOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public OperCrmOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.feign.OperCustomizeOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class OperCustomizeOpenFeignClientFallbackFactory implements FallbackFactory<OperCustomizeOpenFeignClient> { |
||||
|
|
||||
|
private OperCustomizeOpenFeignClientFallback fallback = new OperCustomizeOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public OperCustomizeOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.resi.group.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class ResiGroupOpenFeignClientFallbackFactory implements FallbackFactory<ResiGroupOpenFeignClient> { |
||||
|
|
||||
|
private ResiGroupOpenFeignClientFallback fallback = new ResiGroupOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public ResiGroupOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.resi.partymember.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
||||
|
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Component |
||||
|
@Slf4j |
||||
|
public class ResiPartyMemberOpenFeignClientFallbackFactory implements FallbackFactory<ResiPartyMemberOpenFeignClient> { |
||||
|
|
||||
|
private ResiPartyMemberOpenFeignClientFallback fallback = new ResiPartyMemberOpenFeignClientFallback(); |
||||
|
|
||||
|
@Override |
||||
|
public ResiPartyMemberOpenFeignClient create(Throwable cause) { |
||||
|
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
||||
|
return fallback; |
||||
|
} |
||||
|
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue