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

Sep 2016
Sep 29 2016 03:07
how to add ZuulRoute in code and for ui gateway to route
Sep 29 2016 04:50
@625096233 Is this what you mean?
    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String handleRequest() {
        return "forward:/ux/";
Sep 29 2016 04:59
according to the userid add route
public String reDirect(HttpServletRequest request) {
    ZuulRoute route_cy=new ZuulRoute();

//    discoveryClientRouteLocator.addRoute(route_cy);

    ZuulRoute route_gwzx=new ZuulRoute();
    route_gwzx.setUrl(" http://localhost:9000");


    String id=request.getSession().getId();

    /*URL url = null;
    try {
        url = new URL("");
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block

    return "redirect:/erp_gwzx/";
because can't config the route info into yml,it is dynamic ,
Sep 29 2016 05:18
@625096233 Sorry I have never tried that.
(if you want the current request to get forwarded, which it kind of looks like)
Sep 29 2016 08:44
you are welcome
it probably can't work well
now i extend the ZuulHandlerMapping
first add route
second registerHandlers
Dave Syer
Sep 29 2016 08:50
Whatever works for you (it's not really clear what you need and why)
Sep 29 2016 10:34
@dsyer i need in code add the route config (that probably is new pc contain the ui and backend services previously we can't know the pc so there no config about this pc in yml )
because the pc config info is dynamic from other system,when user login ,i can get the config info from the session ,so i can get the user belong to which system, last the ui gateway route to the pc which user belong to
David Welch
Sep 29 2016 19:55
hey, to get ConfigurationProperties to update when consul changes, do we have to tag them with @RefreshScope? or is it automagic?
Marcos Barbero
Sep 29 2016 19:57
I never used Consul before but if you have some cloud-bus configured the @ConfigurationProperties will be magically updated.
David Welch
Sep 29 2016 19:58
nice. imagine it should be the same then. will find out shortly I guess :D
Spencer Gibb
Sep 29 2016 20:22
@dwelch2344 yes, @ConfigurationProperties don’t need @RefreshScope. They will be updated automatically.
David Welch
Sep 29 2016 21:18
woot. thanks
Bill Bauernschmidt
Sep 29 2016 21:23
I need some help overriding the RequestSpecificRetryHandler used by the RibbonLoadBalancingHttpClient. We have a customized version that we had working with the old RestClient but can't figure out how to get it working with the new client in the Camden release. Any tips or examples?