These are chat archives for spring-cloud/spring-cloud

25th
Oct 2016
007bond007
@007bond007_twitter
Oct 25 2016 00:00
I am sure there is some property or some magic incantation that will select the use of this schema registry client over the default one, but so far I'm drawing blanks since my explicit creation of the bean is happening too late to be of use
Marius Bogoevici
@mbogoevici
Oct 25 2016 00:16
please file that as a bug
the confluent bean registry client should be registered as a bean
if that doesn’t work, then there’s a bug on our end
registering an alternate schema registry client should be as simple as this:
replace that with new ConfluentSchemaRegistryClient() and set the endpoint propely - if that doesn’t work, then there’s an issue on our end
007bond007
@007bond007_twitter
Oct 25 2016 00:54
I ended up consing the bean in Main -- copied your code and swapped Default for Confluent (you get the idea) -- that seems to be happier
Now I have to get the receiver to be happy with what it's getting -- I'm sure it's the same wrong-bean-flavor issue in the receiver app
```
```
Dang this thing! I wanted to paste in the bean code but the Force is not with me
007bond007
@007bond007_twitter
Oct 25 2016 01:00
Just to wrap up before I go -- setting the client to also use the Confluent bean (same trick with putting the bean in main) makes the reciever able to correclty get the transmitted content. Yay!
007bond007
@007bond007_twitter
Oct 25 2016 14:50
@mbogoevici A follow up -- looks like I will be creating that bug report and example that shows the issue: if I put the @Bean registration for the Confluent schema registry client directly in Main, things work. Moving the exact code into config/RegistryClient (@Configuration annotated) causes the failure of using the wrong schema registry client bean. When I get the code pushed and the bug created, please take a look -- it's likely I am doing something dumb with the bean configuration and there really is no bug, other than my level of ignorance.
Marius Bogoevici
@mbogoevici
Oct 25 2016 14:51
thanks for the follow up - I will take a look today
Stevo Slavić
@sslavic
Oct 25 2016 15:05
hello
about zuul in spring cloud netflix
found in docs that default ribbon isolation strategy is semaphore
seems commands are blocking
Dave Syer
@dsyer
Oct 25 2016 15:11
I believe so. It was so that security (in particular) works in the backend calls. There are some new features that work with thread isolation though. I haven't really used them much.
Stevo Slavić
@sslavic
Oct 25 2016 15:12
found comment in code
// we want to default to semaphore-isolation since this wraps
// 2 others commands that are already thread isolated
that's in AbstractRibbonCommand.run
Dave Syer
@dsyer
Oct 25 2016 15:15
Right, but that's inside a block that processes the config if you set it to SEMAPHORE.
So you can always do that if you want to
You are going to have to add more config to get security contexts passed down to the hystrix commands though
Stevo Slavić
@sslavic
Oct 25 2016 15:20
don't have those needs at the moment, to propagate security context
so if not using anything thread local for underlying calls, I guess it's safe to use thread isolation
from hystrix docs:
"Generally the only time you should use semaphore isolation (SEMAPHORE) is when the call is so high volume (hundreds per second, per instance) that the overhead of separate threads is too high; this typically only applies to non-network calls."
Dave Syer
@dsyer
Oct 25 2016 15:27
The overhead of separate threads is very high no matter what they say there
But it's up to you
Stevo Slavić
@sslavic
Oct 25 2016 15:28
I agree
it doesn't seem possible to make ribbon commands non-blocking, correct?
007bond007
@007bond007_twitter
Oct 25 2016 15:31
@mbogoevici Code example is created here https://github.com/sbb/schema-registry-bug-report.git bug report to follow when I figure out how to create one :)
Dean Poulin
@DeanPoulin
Oct 25 2016 15:40

After googling around a bit about Spring Security and OAuth2 with Spring Boot, I ended up on this issue: spring-projects/spring-boot#4331. After reading this comment (https://github.com/spring-projects/spring-boot/issues/4331#issuecomment-242350462) and trying the suggestion:

@Bean
public OrderedRequestContextFilter requestContextFilter() {
    return new OrderedRequestContextFilter();
}

When I made an HTTP request to the application, I was properly redirected to the oauth2.client.userAuthorizationUri, and the exception didn't occur.

007bond007
@007bond007_twitter
Oct 25 2016 15:44
@mbogoevici spring-cloud/spring-cloud-stream#695
Dave Syer
@dsyer
Oct 25 2016 15:45
@DeanPoulin Spring Boot adds one of those for you
so you must have switched it off
I would look into how that happened and maybe stop doing it if I were you
Dean Poulin
@DeanPoulin
Oct 25 2016 15:45
@dsyer, maybe it's the autowiring. In my example here (https://github.com/DeanPoulin/spring-boot-oauth2-mvc), I haven't done anything to configure that.
Maybe something automatically done with @EnableWebMvc
pradeepkusingh
@pradeepkusingh
Oct 25 2016 16:02
What are the fixes included in CamdenSR1 ?
Dave Syer
@dsyer
Oct 25 2016 16:03
@pradeepkusingh there's a link to the release notes in the spring.io blog announcement
pradeepkusingh
@pradeepkusingh
Oct 25 2016 16:03
Thanks @dsyer
Dave Syer
@dsyer
Oct 25 2016 16:03
@DeanPoulin Yes, indeed. @EnableWebMvc switches off the web mvc autoconfig.
(I'm sure it says so in the user guide as well)
Dean Poulin
@DeanPoulin
Oct 25 2016 16:05
@dsyer ah ok. I had been following along with this guide https://spring.io/guides/tutorials/spring-boot-oauth2. That sample wasn't using the annotation @EnableSpringMvc and my app had that. I'll read through the documentation regarding that since I really need to know the inner workings of that anyway. Thanks.
pradeepkusingh
@pradeepkusingh
Oct 25 2016 16:16
@dsyer Any plan to integrate zuul 2 ?
Spencer Gibb
@spencergibb
Oct 25 2016 16:16
when it is released
pradeepkusingh
@pradeepkusingh
Oct 25 2016 16:17
lol.. I thought Netflix already released it
Stevo Slavić
@sslavic
Oct 25 2016 19:48
was confused earlier, was against common sense that execution.isolation.thread.timeoutInMilliseconds is applicable even when isolation strategy is semaphore, but that's Hystrix config property, not Spring Cloud issue
Stevo Slavić
@sslavic
Oct 25 2016 20:21
in a test, on a constrained environment, initial requests for every downstream service are taking ~2sec (test driver logs request and response timestamp); had to increase execution.isolation.thread.timeoutInMilliseconds from 5sec to 10sec otherwise forwarding error, timeout exception was being thrown, still don't get it why
as if something in between starting timeout for initial execution of command, and making actual request is taking more than to get response itself
and that's only for initial execution, every next one was working fine, below command timeout
Ryan Baxter
@ryanjbaxter
Oct 25 2016 20:39
@sslavic probably not the answer you are looking for….but I think a lot of people have seen that
no one has dug into it though
Stevo Slavić
@sslavic
Oct 25 2016 20:40
true, noticed spring-cloud/spring-cloud-netflix#768