New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate RequestAttributes across Hystrix Thread boundary #1379
Conversation
Current coverage is 73.95% (diff: 100%)@@ master #1379 diff @@
==========================================
Files 187 185 -2
Lines 5751 5683 -68
Methods 0 0
Messages 0 0
Branches 864 862 -2
==========================================
- Hits 4294 4203 -91
- Misses 1149 1180 +31
+ Partials 308 300 -8
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure your spacing is consistent before and after {
and }
.
I think the code looks OK, lets see if anyone else on the team has any objections as I am not familiar with the code.
@@ -70,6 +71,11 @@ public HasFeatures hystrixFeature() { | |||
return HasFeatures.namedFeatures(new NamedFeature("Hystrix", HystrixCommandAspect.class)); | |||
} | |||
|
|||
@Bean | |||
public HystrixConcurrencyStrategy hystrixConcurrencyStrategy(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be opt-in (@ConditionalOnProperty
)? Since there can only be one HystrixConcurrencyStrategy
?
Exactly what I need. But @spencergibb is right. There is always one IMO it would be nice if there would be a This way it would be easier to hook into it. I hope this was understandable 😑. What do you guys think? Edit: I could provide a pull request as soon as I have time and my approach is fine for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See opt-in comment
ping @taxone on requested changes |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
This code fixes this open issue.
The problem with OAuth2 is that Hystrix threads can't access the request/session scoped beans stored by Spring in the main thread, so it's necessary to copy the attributes managed by the Spring RequestContextHolder from the main thread to the threads managed by Hystrix thread pool.