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

26th
Jan 2016
Dreampie
@Dreampie
Jan 26 2016 02:03
@dsyer are you still there?
Dreampie
@Dreampie
Jan 26 2016 02:08
I raised @ModelAttribute issue, if you completed ,I 'll get the notice
thanks
spring-cloud/spring-cloud-netflix#792
Dreampie
@Dreampie
Jan 26 2016 03:39
same class name @FeignClient will be overried
grelaxus
@grelaxus
Jan 26 2016 08:56
Have to re-post my question I asked the other day as it still appears: @dsyer : I'm getting through the Spring Security and AngularJS tutorial (http://spring.io/guides/tutorials/spring-security-and-angular-js). And facing a problem in Part 5 (SSO with OAuth2): if I use separate SecurityConfiguration in the UI (like in vanilla or spring-session parts, https://github.com/spring-guides/tut-spring-security-and-angular-js/blob/master/spring-session/ui/src/main/java/demo/UiApplication.java), then the custom csrfHeaderFilter doesn't get applied (at least I suspect so), the default version of OncePerRequestFilter is applied instead, which seems to be using X-CSRF-TOKEN, rather than X-XSRF-TOKEN. As a result I get following message when logout:
DEBUG 8634 --- [nio-8080-exec-2] o.s.security.web.csrf.CsrfFilter: Invalid CSRF token found for http://localhost:8080/logout. If I do all configuration in the UiApplication (like here https://github.com/spring-guides/tut-spring-security-and-angular-js/blob/master/oauth2-vanilla/ui/src/main/java/demo/UiApplication.java), then I don't get the invalid token message. The question is what is the difference and why this happens? What to do if I want my configuration in a separate class?
Another question wrt part5 is when I logout (the case above without csrf problem) I'm forwarded to '#/', which looks like logged out screen (no logout button, no greeting), but as soon as I refresh the page, I see the screen as I logged in (without logging in). Is it because I'm still logged in on AuthorizationServer or there is something wrong in my code?
Thank you.
Dave Syer
@dsyer
Jan 26 2016 09:53
It's not really a spring-cloud question. Maybe better to put it here: https://gitter.im/spring-guides/tut-spring-security-and-angular-js?
Dreampie
@Dreampie
Jan 26 2016 10:13
@dsyer were you see overriding same name bean image?
Dave Syer
@dsyer
Jan 26 2016 10:43
Sorry, I have no idea what that question is referring to
lewis-ing
@lewis-ing
Jan 26 2016 12:37
@dsyer When I start 2 Eureka server of the peer awareness,So I start other apps for client,It's work
and then I shutdown one eureka server,and client app still try to connect before eureka server and have not fail-over
Dave Syer
@dsyer
Jan 26 2016 13:58
I guess so
Ryan Baxter
@ryanjbaxter
Jan 26 2016 15:06
I am reading about the sidecar support in Spring Cloud and in the documenation it states "Run the resulting application on the same host as the non-jvm application."
is this a requirement?
Marcos Barbero
@marcosbarbero
Jan 26 2016 15:09
@ryanjbaxter yes, it is.
Ryan Baxter
@ryanjbaxter
Jan 26 2016 15:09
what happens when you are running the apps in Cloud Foundry?
Marcos Barbero
@marcosbarbero
Jan 26 2016 15:10
The sidecar application binds the IP (or hostname) from the current machine to eureka
I never run applications in Cloud Foundry, I'm sorry but I can't help.
Ryan Baxter
@ryanjbaxter
Jan 26 2016 15:12
sidecar.health-uri contains the location of the non-ivm app so it should know if the non-jvm app is up
even if its not on the same host
Marcos Barbero
@marcosbarbero
Jan 26 2016 15:20
I'm assuming you are using eureka, once you have eureka to register your apps the application will bind the hostname or the IP, depends on the options you have configured. The thing about run the sidecar on the same host as the non-jvm application is about the registering on eureka, it will always get the sidecar hostname or IP, if you run in a different host the requests will never reach the correct host
Ryan Baxter
@ryanjbaxter
Jan 26 2016 15:21
ah i see, so you are saying the other services wont know where the non-jvm app is bc its not on the same host as eureka
im sorry on the same host as the sidecar
i guess it also assumes that the sidecar is on the same host so the non-jvm app can use the Zuul proxy in the sidecare to communicate with other services as well
Marcos Barbero
@marcosbarbero
Jan 26 2016 15:29
You're right
Dave Syer
@dsyer
Jan 26 2016 15:55
I saw a blog that someone wrote about using the sidecar to register a database service
That must have been a different host?
Ryan Baxter
@ryanjbaxter
Jan 26 2016 16:20
@dsyer is there any reason why the non-jvm app can’t just register with eureka itself?
Dave Syer
@dsyer
Jan 26 2016 16:21
No. But then you need to modify it, and that isn't always possible.
Ryan Baxter
@ryanjbaxter
Jan 26 2016 16:21
what do u mean "modify it”?
Dave Syer
@dsyer
Jan 26 2016 16:22
Well you need to insert some code in it to register and send heartbeats
They are just HTTP calls, but the only higher level language bindings are in Java
Ryan Baxter
@ryanjbaxter
Jan 26 2016 16:25
right
its a node app, so was possibly looking into using this https://www.npmjs.com/package/eureka-js-client
or seeing if it would work at least
Dave Syer
@dsyer
Jan 26 2016 16:28
That's a possibility
Daco
@dacofr
Jan 26 2016 22:33
FYI : i found a solution to have my own HealthIndicator registered before DiscoveryCompositeHealthIndicator : For this i've annote my AutoConfigClass with @AutoConfigureOrder
@Configuration
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
public class ManageAutoConfiguration
{
    @Bean
    public ProjectHealthIndicator projectHealthIndicator() {
        return new ProjectHealthIndicator();
    }
}