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

5th
Jun 2018
7cat
@7upcat
Jun 05 2018 01:55
does spring cloud 'Embedding the Config Server ' property 'spring.cloud.config.server.bootstrap' support JDBCBackend ?
CH4:D
@chad_d_stud_twitter
Jun 05 2018 02:34
is there a way to override ZuulException with an ExceptionHandler?
vikrantch-hk
@vikrantch-hk
Jun 05 2018 04:24
@marcosbarbero thanks I'll try with boot 1.5
Marcos Barbero
@marcosbarbero
Jun 05 2018 07:14
@chad_d_stud_twitter what do you mean by override ZuulException? Maybe this helps you.
CH4:D
@chad_d_stud_twitter
Jun 05 2018 07:14
@marcosbarbero , i want it to throw my own error object like i do with my other services using ControllerAdvice ErrorHandler
Marcos Barbero
@marcosbarbero
Jun 05 2018 07:23
the link above may help you
CH4:D
@chad_d_stud_twitter
Jun 05 2018 07:34
hmm this assumes your service catches the error from zuul
but i want the error to be thrown by zuul
example, i have a filter that requires a validation and if that fails i want it to throw an exception
this is the body of my Zuul filter

    @Override
    public Object run() throws ZuulException {
        EndpointResult result = new EndpointResult();    
        AuthRequest gr = new AuthRequest();

        result = service.validate(gr).map((resp) -> resp)
                .orElse(result);
        log.info("validate: " + result.getStatus());
        if ("fail".equals(result.getStatus())) {
            throw new ZuulException(result.getError().toString(), HttpStatus.SC_FORBIDDEN, result.getError().toString());
        }

        return null;
    }
i want the zuulexception to contain a json object of result
Tommy Ludwig
@shakuzen
Jun 05 2018 07:51
Does Spring Cloud officially mention what versions of Java it supports? I don’t see anything mentioned on the project page http://projects.spring.io/spring-cloud/
I know Finchley is Java 8 baseline, but I’m curious about what testing/support there is for Java 9/10/11
Marcos Barbero
@marcosbarbero
Jun 05 2018 09:01
Maybe you can extend the ZuulException and do whatever you want, won't it work @chad_d_stud_twitter ?
Marcin Grzejszczak
@marcingrzejszczak
Jun 05 2018 11:10
@shakuzen we currently don’t test against anything else than Java 8
Tommy Ludwig
@shakuzen
Jun 05 2018 11:51
@marcingrzejszczak Thanks for the response. Are there plans to be compatible with and test later Java releases?
From my ad hoc testing locally, things are working fine anyways on Java 10 now
Marcin Grzejszczak
@marcingrzejszczak
Jun 05 2018 11:55
we are planning to but now we want to be GA ;)
Tommy Ludwig
@shakuzen
Jun 05 2018 11:56
sounds good to me :)
CH4:D
@chad_d_stud_twitter
Jun 05 2018 13:52
@marcosbarbero and how do i use it within the API Gateway server? afaik, it has its own exception handler that i can’t seem to override
on other services a simple @ControllerAdvice would do the trick but not this one
Marcos Barbero
@marcosbarbero
Jun 05 2018 13:56
I can be wrong in this one, but if you just extend the ZuulException its type will still be the same
so the handling for zuul may still work
Joshua Street
@jjstreet
Jun 05 2018 17:33
hey all
this is most likely a pretty specific question, but has anyone had luck manually creating feign clients on a Zuul proxy application?
no eureka, only list of servers
Matt Benson
@mbenson
Jun 05 2018 18:32
@dsyer I would expect that GenericScope wouldn't have been a separate class from RefreshScope if it were not intended for reuse. Have you tried using two GS subclasses in the same application context?
Matt Benson
@mbenson
Jun 05 2018 21:10
RE above, spring-cloud/spring-cloud-commons#378
rewriting bad user.email :/
Matt Benson
@mbenson
Jun 05 2018 21:21
I'll send a fixed one later