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

18th
May 2015
Leon Radley
@leon
May 18 2015 07:41
God morning!
I’m trying to hook up one of my .net services to zuul, but since the .net service isn’t registered with eureka I’m getting "Load balancer does not have available server for client”
How do I get around that?
The question also applies to when I want to proxy “my self”, in that I’ve exposed an and point in the same spring boot app, and would like the front end to be able to call that endpoint without having to care about the authentication.
If I leave the zuul configuration empty it adds the other services registered in eureka, but not it self.
Dave Syer
@dsyer
May 18 2015 07:57
I don't know about that "self-proxy" use case. You can certainly proxy localhost (we do it in tests all the time). But why?
And I'm not sure what you want with the .net service. Is it passive and it just wants to be called from behind a proxy? Or does it want to call other services? Or register itself?
Leon Radley
@leon
May 18 2015 07:58
If I’ve exposed an api via the resource server, that api is protected with oauth, If I now via angular want to call that api without having to supply the auth token
I would like to call the api though the zuul proxy
Dave Syer
@dsyer
May 18 2015 07:59
Then you can just register the route manually?
Do you want to use eureka, or just get it working?
Leon Radley
@leon
May 18 2015 07:59
Since it know’s itself, the manual registering is probably what I’m after
Dave Syer
@dsyer
May 18 2015 08:00
zuul.routes.myservice.url=...
Leon Radley
@leon
May 18 2015 08:00
I’ll give it a go
Leon Radley
@leon
May 18 2015 08:02
I got it working with eureka too, It was just a matter of waiting for eureka to register the service
Dave Syer
@dsyer
May 18 2015 08:03
I suppose we could do an optimization for local routes (using a forward). But I'd also expect you can just set stateless(false) in the resource server configurer and authenticate with a cookie.
With eureka did you register directly or using a sidecar?
Leon Radley
@leon
May 18 2015 08:05
The resource server is going to be used by other apps, It’s just me thinking DRY...
With eureka did you register directly or using a sidecar?, did you mean the .net services?
I’m not in charge of the .net services, so they don’t use eureka at all
Dave Syer
@dsyer
May 18 2015 08:08
OK, I thought you meant you had registered it with Eureka.
I suppose there's nothing preventing you from doing that. But it's fragile.
Leon Radley
@leon
May 18 2015 08:08
No I’m manually adding them to zuul
Dave Syer
@dsyer
May 18 2015 08:08
Right. Not Eureka.
Leon Radley
@leon
May 18 2015 08:08
yes
Dave Syer
@dsyer
May 18 2015 08:08
OK
Leon Radley
@leon
May 18 2015 08:09
since they are only running one instance
but we may be adding multiple instances later on
sidecar seems promising
Leon Radley
@leon
May 18 2015 08:36
I’m having troubles with zuul an https. If I try to proxy one of the .net services I get a java.net.SocketTimeoutException: connect timed out
Doesn’t zuul handle https calls?
Dave Syer
@dsyer
May 18 2015 09:14
Never tried it
Leon Radley
@leon
May 18 2015 09:16
But i’m guessing it should be supported. I’ll have a look around for any open issues. But It’s probably a zuul problem and not a spring cloud one
Dave Syer
@dsyer
May 18 2015 09:59
It's using Apache HTTP components
If it doesn't work it must be something to do with the way that is set up
Does the backend have a valid SSL cert?
Leon Radley
@leon
May 18 2015 10:00
yes it does, it’s hosted on azure, with a valid wildcard cert
Leon Radley
@leon
May 18 2015 12:16

It seems like zuul is authenticating against the auth server for every request with zuul.
I know I’ve read somewhere that you can cache the authentication token. But I can’t remember where.

Any suggestions?

Dave Syer
@dsyer
May 18 2015 12:22
It is cached in the session
OAuth2ClientContext
(assuming you mean the user's access token)