Using Spring as an object factory to control the lifecycle of ribbon clients.
So far we have a single, parameterized configuration class for all clients, but
can be extended to allow user to supply additional configuration. The current
model for user extensions is
@EnableRibbonClient(@RibbonClient(name = "foo", configuration = FooConfiguration.class))
public class MainConfiguration {
...
}
So in this example, MainConfiguration is part of the "main" application context
and FooConfiguration is used to create the Ribbon client and load balancer for
the "foo" service.
The default behaviour is now to strip the prefixes (global and
route-specific) by default. E.g.
zuul:
prefix: /api
routes:
customers: /customers/**
Will forward /api/customers/101 to /101 on the customers service
See gh-43
Handle InstanceRegisteredEvent and RefreshScopeRefreshedEvent in ZuulHandlerMapping rather than ProxyRouteLocator.
Move /routes endpoint out of ZuulHandlerMapping into RoutesEndpoint (because of a problem when I added @RefreshScope to ZuulHandlerMapping)
We now support prefix stripping per service, e.g.
zuul:
routes:
customers:
path: /customers/**
stripPrefix: true
Will route /customers/101 -> /101 (on the customers service)
See gh-77
User can now specify zuul.routes.*.{path,url,serviceId} (with
"url" and "serviceId" mutually exclusive (and "location" is a
synonym) separately, or can use a one-one short form, like the
old style.
See gh-77
Bean instantiation ordering was causing external (user-supplied)
filter beans to replace the defaults, not append to them. Separating
out the autowired map of beans into a spearate class was enough to
fix it.
Fixes gh-78
Also adds support for context paths in physical URL mappings, e.g.
zuul.route.http\://localhost\:8081/app=/stores/**
will result in a proxy forward of /stores/foo to
http://localhost:8081/app/stores/foo
Fixes gh-73
This allows mappings to be at the root and not have to be prefixed. It also allows mappings to fall through to other handler mappings. Patterns are now Ant-style via AntPathMatcher.
fixes gh-72
If the prefix is set we also set configPath=<prefix> in the
instance metadata, so config clients can pick it up and add it
to the home page URL.
Fixes gh-64, fixes gh-65