Closed nmorado closed 8 years ago
@aivans how to dynamic route and add route info not start app
@RequestMapping("/reDirect")
public String reDirect(HttpServletRequest request) {
ZuulRoute route_cy=new ZuulRoute();
route_cy.setId("erp_cy");
route_cy.setPath("/erp_cy/**");
route_cy.setUrl("http://169.254.50.169:8081");
discoveryClientRouteLocator.addRoute(route_cy);
ZuulRoute route_gwzx=new ZuulRoute();
route_gwzx.setId("erp_gwzx");
route_gwzx.setPath("/erp_gwzx/**");
route_gwzx.setUrl(" http://localhost:9000");
discoveryClientRouteLocator.addRoute(route_gwzx);
String id=request.getSession().getId();
return "redirect:/erp_gwzx/";
}
@aivans first ,i use ui gateway to offer one point endpoint services ,at the same time ,the backends service machine can't be access by the Internet, when users open the browser the ui server route to the sso system,when login success,the sso server redirect to the ui gateway ,the ui gateway according to the session id get user info from redis ,now the requirements is according to the userID, the ui gateway route to different pc get ui pages. the first problem is how i get zuul route config info from database the second is how ui gateway according to userid add route to zuul and zuul route to diff pc,(because some service such as http://192.168.1.22, there not the context, at the same time can't use http Re-direct 302, ) ,dynamic add the zuul route and bypass to the diff pc get ui page
Duplicates #706 & #705
not sure if this one is currently supported.
need to add (maybe also remove, or update) existing routes to a running zuul proxy.
is this currently possible? if not - any ideas on how we might achieve the same without really restarting your app and updating mapping in a properties file?
thanks