It took me quite a bit, to figure out how to configure Zuul to use a loadbalanced route without Eureka. I hope this short explicit example will clarify it for other people.
It turns out that the suckiness of Zuul with multipart requests
comes almost entirely from the Multipart handling in Spring's
DispatcherServlet. This change makes the proxy routes available
on an alternative path /zuul/<normal_path> (where
/zuul is the default value of zuul.servletPath). I have
tested those with 800MB file uploads using the main method in
the FormZuulServletProxyApplicationTests and the main
observation is that there is no OutOfMemory error (no-one tries
to download the complete request body). It works with Ribbon
and with the simple (HttpClient) filter. With Ribbon you
will need to set some timeouts if you want to upload files
as large as that, e.g. see application.yml in the tests:
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 60000
ribbon:
ConnectTimeout: 3000
ReadTimeout: 60000
You need to set "Transfer-Encoding: chunked" in the
incoming request. Chrome does not do this by default
apparently, but I was able to test with curl, e.g.
$ curl -v -H "Transfer-Encoding: chunked" \
-F "file=@mylarg.iso" \
localhost:9999/zuul/direct/file
The old proxy paths through the DispatcherServlet are still
available (for backwards compatibility and for convenience of
having the paths available at the root of the context path).
Fixes gh-254
If you are using AMQP there needs to be a ConnectionFactory (from
Spring Rabbit) in the application context. If there is a single
ConnectionFactory it will be used, or if there is a one qualified as
@[Hystrix,Turbine]ConnectionFactory it will be preferred over others,
otherwise the @Primary one will be used. If there are multiple
unqualified connection factories there will be an error.
See https://github.com/spring-cloud/spring-cloud-bus/issues/13
Users need to know how to configure and use the Eureka
metadata because it isn't immediately obvious and does
require some decisions to be made.
Fixes gh-102
and also allow explicitly configured services to be unignored. I.e.
zuul:
ignoredServices: *
routes:
foo: /foo/**
Will expose only the foo service.
Fixes gh-198
The Eureka instance has to provide status page and health check
URLs. We only provide a sensible default if the app is a vanilla
Actuator. This change shows users explicitly how to customize those
settings.
Fixes gh-192
The ProxyRouteLocator now has a retryable property (default
null which means Ribbon will choose the default - usually false).
Fixes gh-115, fixes gh-124
This change adds an ApplicationListener that sets some high priority
properties in the Environment to allow server.port and management.port
to keep their usual meaning, but have server.port apply only to turbine.
Actuator endpoints can be enabled with management.port (different to
server.port otherwise there will be a conflict between Netty and Tomcat).
Fixes gh-143, fixes gh-140
With this change users can elect not to install the proxy features
but still have a Zuul server with @Beans of type ZuulFilter added
automatically.
Fixes gh-104