-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from jihor/feature-max-retries
Add retry capabilities
- Loading branch information
Showing
7 changed files
with
149 additions
and
39 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
24 changes: 24 additions & 0 deletions
24
...st/java/info/developerblog/examples/thirft/simpleclient/configuration/CountingAspect.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,24 @@ | ||
package info.developerblog.examples.thirft.simpleclient.configuration; | ||
|
||
import org.aspectj.lang.annotation.Aspect; | ||
import org.aspectj.lang.annotation.Before; | ||
import org.aspectj.lang.annotation.Pointcut; | ||
|
||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
/** | ||
* @author jihor ([email protected]) | ||
* Created on 2016-09-30 | ||
*/ | ||
@Aspect | ||
public class CountingAspect { | ||
public AtomicInteger counter = new AtomicInteger(0); | ||
|
||
@Pointcut("execution(* org.springframework.cloud.client.loadbalancer.LoadBalancerClient.choose(..))") | ||
private void loadBalancerServerChoice() {} | ||
|
||
@Before("loadBalancerServerChoice()") | ||
public void before(){ | ||
counter.incrementAndGet(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...java/info/developerblog/examples/thirft/simpleclient/configuration/TestConfiguration.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 |
---|---|---|
@@ -1,10 +1,18 @@ | ||
package info.developerblog.examples.thirft.simpleclient.configuration; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.EnableAspectJAutoProxy; | ||
|
||
/** | ||
* Created by aleksandr on 18.02.16. | ||
*/ | ||
@Configuration | ||
@EnableAspectJAutoProxy | ||
public class TestConfiguration { | ||
@Bean | ||
public CountingAspect countingAspect(){ | ||
return new CountingAspect(); | ||
} | ||
|
||
} |
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