-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf($OpenFeign): add support for Spring Cloud CircuitBreaker Resilie…
…nce4J
- Loading branch information
1 parent
ee9065e
commit 9568372
Showing
9 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...main/java/com/jmsoftware/maf/springcloudstarter/configuration/OpenFeignConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright By ZATI | ||
* Copyright By 3a3c88295d37870dfd3b25056092d1a9209824b256c341f2cdc296437f671617 | ||
* All rights reserved. | ||
* | ||
* If you are not the intended user, you are hereby notified that any use, disclosure, copying, printing, forwarding or | ||
* dissemination of this property is strictly prohibited. If you have got this file in error, delete it from your | ||
* system. | ||
*/ | ||
package com.jmsoftware.maf.springcloudstarter.configuration; | ||
|
||
import feign.Target; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.cloud.openfeign.CircuitBreakerNameResolver; | ||
import org.springframework.context.annotation.Bean; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
/** | ||
* Description: OpenFeignConfiguration, change description here. | ||
* | ||
* @author 钟俊 (za-zhongjun), email: jun.zhong@zatech.com, date: 2/3/2022 3:52 PM | ||
* @see | ||
* <a href='https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/#spring-cloud-feign-circuitbreaker'>Feign Spring Cloud CircuitBreaker Support</a> | ||
**/ | ||
@Slf4j | ||
@SuppressWarnings("AlibabaClassNamingShouldBeCamel") | ||
public class OpenFeignConfiguration { | ||
@Bean | ||
public CircuitBreakerNameResolver circuitBreakerNameResolver() { | ||
return (String feignClientName, Target<?> target, Method method) -> feignClientName + "_" + method.getName(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...n/FeignClientConfigurationProperties.java → ...y/FeignClientConfigurationProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters