Commit Graph
100 Commits
Author SHA1 Message Date
Dave Syer eb475769ca Remove confusing profile from settings.xml 2015-10-20 09:27:59 -04:00
Dave Syer d3000a23e9 Fix ordering problem with Zuul tests 2015-10-20 07:18:29 -04:00
Dave Syer 1fe28af3f0 Fix issue with forward:... routes
We have to ensure that the ZuulController is not mapped on a
forward otherwise we just go back through the same code
path and render nothing.
2015-10-20 06:46:31 -04:00
Dave Syer cd30bea0c8 Add smarts for local route handling in Zuul proxy
User can provide a url in the route that starts with "forward:"
(instead of "http:" etc.) to handle the request locally.

Also properly ignores ignored routes, so they can be handled locally
(rather than giving up and sending 404).

Fixes gh-536
2015-10-18 09:59:06 -04:00
Dave Syer 43cab5f9b5 Clarify secure application discovery a bit 2015-10-18 09:22:12 -04:00
Dave Syer a7abfd4242 Upgrade to Zuul 1.1
Still a release candidate (not yet GA), but seems to work, so we'll
try and update before Spring Cloud is released again.

Fixes gh-546, fixes gh-567, fixes gh-553 (probably)
2015-10-03 08:26:57 +01:00
Dave Syer 5f84bcddd6 Align with package changes in Spring Cloud Config 2015-10-01 11:53:35 +01:00
Dave Syer 3ef58cdc39 Change DiscoveryClient->EurekaClient in docs 2015-09-30 11:34:34 +01:00
Dave Syer 17dc4f6f55 Update some dependencies 2015-09-30 11:34:34 +01:00
Dave Syer 4877de4916 Remove unused dependencies 2015-09-29 17:49:59 +01:00
Dave Syer c6fda88fed Support for ServerIntrospector in Feign client
Other Ribbon clients in Spring Cloud use a ServerIntrospector
to check if the Server wanted to be secure. This change levels things
up (and makes the Spring Feign Client a lit easier to customize).

See gh-414
2015-09-29 15:57:11 +01:00
Dave Syer 422bc42cf6 Be less greedy with logging request bodies in Zuul traces
Most clients send "Transfer-Encoding: chunked" so this isn't often
an issue, but if they don't (e.g. if you use "-H Expect:" with
curl) then it's not a great idea to slurp it all into memory.

Fixes gh-563
2015-09-29 09:43:16 +01:00
Dave Syer f1f239d774 Change hystrix command key to be the service ID in Zuul proxy
When using Ribbon the hystrix config and metrics are namespaced
as "RibbonCommand" (via the group key). the command key can then be
serviceId, making it easier to remember how to configure
Ribbon and Hystrix.

Fixes gh-329
2015-09-29 09:14:50 +01:00
Dave Syer a38ba34049 Try to guess whether a ribbon client is looking for HTTPS
There are usually some hints available, especially if the Server
came from Eureka. Unfortunately Server on it's own doesn't contain
enough information (why?), but as a fallback we can guess that
anyone using port 443 is secure.

Fixes gh-459
2015-09-28 17:53:37 +01:00
Dave Syer d1cb42946b Explicitly snag secure URL for config server if desired
If the configserver registers with securePortEnabled=true we should
respect that in the discovery process.

Fixes gh-450
2015-09-25 13:39:45 +01:00
Dave Syer 3697ce7fd9 Fix broken test (assumptions about eureka-first) 2015-09-25 13:29:44 +01:00
Dave Syer ded968ad58 Ensure changes to eureka metadata are relected on refresh
And also when using eureka-first for discovering config server.
The EurekaClient is very rigid and initializes itself, registering
with the remote service on instantiation. Hance it needs to be
in @RefreshScope for it to be properly refreshable. Doing that
leads to a sequence of other changes (e.g. to account for the
fact that there is no @RefreshScope in bootstrap context).

Fixes gh-551
2015-09-24 13:37:17 +01:00
Dave Syer cf3ae735b2 Fix test (exclude commons refresh processing if not available) 2015-09-23 14:43:16 +01:00
Dave Syer 797544e668 Clean up eureka lifecycle
When the parent (bootstrap) context registers the app as well as consuming
the registry it causes problems, e.g. when you refresh that context is
re-created and destroyed, which tends to unregister the app and it's hard
to get it back. It is simpler if the parent context use eureka read-only.
To ensure this we have to remove the @EnableDiscoveryClient from the
bootstrap context.

Tested with vanilla config server and eureka with the 'eureka-first'
sample and the 'zuul-proxy-eureka' sample.

Fixes gh-421
2015-09-23 14:15:07 +01:00
Dave Syer eb8a902056 Ensure eureka client re-registers after config client activity
Reverts part of a change made for gh-349 and rationalizes a bit of the
Eureka configuration. The Eureka client cannot be shutdown without
attempting to restart it (but there isn't an obvious public API for
that), so it's better not to shut it down at all.

See gh-421
2015-09-23 13:02:15 +01:00
Dave Syer 61294659bf Add back (and deprecate) old 'amqp' poms 2015-09-23 09:46:49 +01:00
Dave Syer ee5b9c6382 Revert back to snapshot 2015-09-08 16:39:58 +01:00
Dave Syer a11a7709bf Bump to M1 2015-09-08 16:39:15 +01:00
Dave Syer 72c89c51e6 Fix autoconfig ordering so that health indicators always work 2015-09-02 13:27:49 +01:00
Dave Syer 80f2735ea5 Merge branch '1.0.x'
Conflicts:
	.travis.yml
2015-08-25 15:13:20 +01:00
Dave Syer 7fc9811975 Use TRAVIS_BRANCH if available 2015-08-25 14:52:31 +01:00
Dave Syer b3ca7430b0 Move ghpages to script 2015-08-25 14:15:51 +01:00
Dave Syer 00cc64c6c5 Different special treatment of README 2015-08-25 14:04:43 +01:00
Dave Syer c905822005 Special treatnment of README 2015-08-25 12:56:15 +01:00
Dave Syer 56fae9330f Try to debug CI failures 2015-08-25 12:44:08 +01:00
Dave Syer c1cb0025c1 Use subdirectory for gh pages docs 2015-08-25 12:37:15 +01:00
Dave Syer 89ebf1fa3f Fix ghpages script to work on branches 2015-08-25 12:29:41 +01:00
Dave Syer ddd1b35b71 Merge branch '1.0.x' 2015-08-25 11:13:46 +01:00
Dave Syer ad86d48c6a Use HttpHeaders for headers (case insensitive)
Fixes gh-306
2015-08-25 11:13:29 +01:00
Dave Syer 67748d6626 Update readmes 2015-08-14 11:09:53 +01:00
Dave Syer cb5a8c107d Add Maven wrapper 2015-08-14 10:05:52 +01:00
Dave Syer b0b4916d3c If user configures hostname for eureka client, do not refresh it
Fixes gh-463
2015-07-27 17:55:01 +01:00
Dave Syer 5bb778811f Merge branch '1.0.x' 2015-07-18 10:37:09 +01:00
Dave Syer f682c42001 Merge branch '1.0.x' 2015-07-10 11:48:36 +01:00
Dave Syer 91d288d781 Update to Spring Boot 1.3, stage I (make it compile) 2015-07-03 09:54:16 +01:00
Dave Syer d046791b3e Move starters into home projects 2015-06-26 15:09:53 +01:00
Dave Syer 9a45beec1d Update to Brixton 2015-06-26 12:57:06 +01:00
Dave Syer 3519ecf224 Prepare master for next snapshot 2015-06-26 10:57:19 +01:00
Dave Syer 72cecacea7 Fix path to docs in README raw text 2015-06-25 12:31:29 +01:00
Dave Syer e17766e916 Add dependency management for starters 2015-06-25 11:46:01 +01:00
Dave Syer 29841f9f57 Revert "add optional spring-security-rsa"
This reverts commit 06d4d1e158.
2015-06-24 20:24:50 +01:00
Dave Syer a903b5d58c Fix guava imports 2015-06-24 17:31:06 +01:00
Dave Syer 25651f4835 Add sidecar to BOM 2015-06-24 17:23:39 +01:00
Dave Syer 652e4b96b3 Nail explicit dependencies for s-c-context 2015-06-23 17:58:59 +01:00
Dave Syer a63b825690 Add call to Lifecycle.stop()
See gh-377
2015-06-08 06:33:45 +01:00
Dave Syer 23cde30063 Align metrics with Spring Boot 1.3
Should be no change for users of Boot 1.2 right now, but with this
patch it is possible to use 1.3 with the new conventions for metrics
(e.g. in particular exporting by declaring beans of type
MetricWriter)
2015-06-02 15:29:08 +01:00
Dave Syer bd808a76fa Add health.config for documentation purposes only 2015-05-27 10:27:02 +01:00
Dave Syer 3809bcbc90 More 1.0.2 snapshots 2015-05-01 16:24:20 +01:00
Dave Syer 0587df4ae2 Fix parent version 2015-05-01 16:19:51 +01:00
Dave Syer 53c0e0a246 Fix parent version 2015-05-01 16:19:21 +01:00
Dave Syer bad44ec8ab Fix parent version 2015-05-01 16:15:48 +01:00
Dave Syer fde4741333 Update to 1.0.3 snapshots 2015-05-01 11:22:13 +02:00
Dave Syer c77322348c Add example for SEMAPHORE in @HystrixCommand 2015-05-01 11:20:21 +02:00
Dave Syer b28fd07cdb Update to 1.0.2 snapshots 2015-04-23 11:11:21 +01:00
Dave Syer 22c261c8ce Update connectors version 2015-04-22 11:40:25 +02:00
Dave Syer 936a3b334e Set explicit cookie policy in HTTP client in RibbonClientConfiguration
When the Apache HTTP client is being set up for the Ribbon client we can jump
in and explicitly set a cookie policy. Obviously, since the client will generally
be shared across sessions, the only sensible default is IGNORE_COOKIES.

I couldn't find a way round this without using deprecated APIs (but there
are other instances of that in our code because of the way Netflix uses
it, so maybe that doesn't matter).

Fixes gh-301
2015-04-16 13:28:37 +01:00
Dave Syer 873854810a Fix eureka instance metadata in Cloud Foundry example 2015-04-02 13:45:05 +01:00
Dave Syer 555b1f1c06 Use UrlPathHelper to determine the current url path in Zuul
If the app has a context path then the route locator does not match
the whole requestURI (as provided by the raw servlet API), but Spring
has a utility for stripping it off, so we can just use that.

Fixes gh-270
2015-04-01 12:05:05 +01:00
Dave Syer 5961931caf Make /error path a special case in ZuulHandlerMapping
If there is a default route (/**) then the ZuulHandlerMapping will
mask the /error path in a normal Spring Boot application. This change
makes it a special case so that ZuulHandlerMapping will never map
the /error route (the one specified by the ErrorController).

Fixes gh-284
2015-04-01 11:50:33 +01:00
Dave Syer 5f9c3e6073 Ensure management.port=-1 switches off actuator endpoints in turbine 2015-03-26 09:37:50 +00:00
Dave Syer 3714cee51d Clarify impact of @ComponentScan on @RibbonClient
Fixes gh-281
2015-03-26 09:36:27 +00:00
Dave Syer d0021f0415 Clarify turbine config
Also fixes gh-277 (metioning starters explicitly).
2015-03-25 09:42:00 +00:00
Dave Syer e60a0fc4fb Re-initialize DiscoveryClient if config client is in "eureka-first"
This was kind of ugly, and caused a static usage of the eureka
DiscoveryCLient to become necessary again, just so the @Bean that is
provided for the user stays accurate (it has to be the one in the main
application context, even if the parent boot strap has different
instance metadata).

I tested with a vanilla Eureka server and config server, and used the
client in tests/eureka-first.

Fixes gh-268
2015-03-23 16:53:50 +00:00
Dave Syer cdc5681694 Clarify role of filter beans in @EnableZuulProxy 2015-03-20 14:48:39 +00:00
Dave Syer 3ba7cfbff2 Add link to github in rendered docs 2015-03-20 11:47:28 +00:00
Dave Syer 1c54e6b937 Add annotation processor 2015-03-20 11:47:27 +00:00
Dave Syer 444f3c8010 Feign client builder should not assume all annotations are the same
Simple solution is to check for instanceof before casting.

Fixes gh-265
2015-03-19 12:13:19 +00:00
Dave Syer b03b2f5629 Add ping stream to turbine AMQP
This change adds more data to the stream with {"type":"Ping"}
so (I believe) the existing dashboard client will discard it,
but stay alive.

Fixes gh-264
2015-03-18 17:03:25 +00:00
Dave Syer 72a182c914 Make turbine AMQP into an application (optional) 2015-03-18 15:55:08 +00:00
Dave Syer da24fa6d20 Refactor for config client stuff moving to commons 2015-03-18 15:42:41 +00:00
Dave Syer 369a00cb71 Validate hostname (serviceId) in @FeignClient
Since hostnames ahve quite strict syntax (e.g. no underscores) we should
validate the feign client name to prevent nasty surprises at runtime.

Fixes gh-263
2015-03-18 10:35:57 +00:00
Dave Syer 3445d093c7 Fix RabbitAdmin so it actually finds the Declarables 2015-03-17 16:08:57 +00:00
Dave Syer cc2159f77b Use separate RabbitAdmin to declare queues and exchanges
Fixes gh-259
2015-03-16 14:57:58 +00:00
Dave Syer 9357bdd9db Remove log4j notes since Eureka no longer requires it 2015-03-13 17:15:08 +00:00
Dave Syer 0391cfff65 Allow streaming of multipart requests in Zuul proxy
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
2015-03-13 16:55:30 +00:00
Dave Syer da4f5d3454 Fix issue with servlet request wrappers in Zuul
Because of the way that a FormBodyServletRequestWrapper was
implemented (extending the Zuul servlet 2.5 wrapper) it could
barf at runtime if anyone called its servlet 3.0 methods. The fix
for that was to extract our Servlet30RequestWrapper and extend that
instead.

Also tweaked the DebugFilter a bit so it doesn't try and display
the whole payload. Probably speeds up file uploads a bit but the
fact that we have to store the whole request body in memory is
going to kill us eventually.

See gh-254
2015-03-13 13:07:33 +00:00
Dave Syer 164c9f8755 Add bintray properties 2015-03-06 10:48:29 +00:00
Dave Syer e3a20d5d6b Update to next snapshot 2015-03-03 14:56:26 +00:00
Dave Syer ab714bd970 Add release profile for distribution management 2015-02-27 15:49:52 +00:00
Dave Syer 2d35ae1632 Back to configure->config 2015-02-27 15:23:51 +00:00
Dave Syer 7e579c9a91 Use method accessor not field 2015-02-27 12:38:39 +00:00
Dave Syer 8ac43cca52 Add @*ConnectionFactory to qualify the preferred instance
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
2015-02-27 12:32:41 +00:00
Dave Syer a954e88fc6 Config package name change 2015-02-25 17:12:50 +00:00
Dave Syer e096fd8e05 Move RibbonInterceptor into commons
It didn't depend on Ribbon at all so it can live in the commons
project.
2015-02-25 14:58:36 +00:00
Dave Syer e6f30ebfce Exclude mockito-all from zuul 2015-02-25 14:25:11 +00:00
Dave Syer 0b8f85529c Refresh health indicator for config server if present
Listen for heartbeats from discovery so that state changes can trigger
a new status (and the client doesn't rely on the old address of the
server if it has now changed).

Fixes gh-232
2015-02-25 09:17:40 +00:00
Dave Syer 8b81eb8b2c Tweak autoconfig for feign
It doesn't make sense to @EnableFeignClients in autoconfig
because the user needs to specify a package to scan. It does
make sense (sort of) to set up the encoder/decoder/logger etc.

See gh-226
2015-02-23 17:23:05 +00:00
Dave Syer 1d35804831 Retain scheme (e.g. https) in URL from @FeignClient
When the URL is passed down to Ribbon and reconstructed from
a LoadBalancer the Server only knows about host and port, so the scheme
has to come from the original declaration.

There's still a potential problem with Eureka remote services that
are available with a non-secure port as well (probably fairly rare).

Fixes gh-221
2015-02-23 10:02:51 +00:00
Dave Syer fadfc67f8f Add some more docs for Eureka metadata
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
2015-02-16 10:31:36 +00:00
Dave Syer 043732aef3 More careful handling of multipart data in proxy
To write file data the message converter needs the file content
to be provided in the form of an HttpEntity per file.

Fixes gh-197 again
2015-02-12 18:37:54 +00:00
Dave Syer 96335e1d24 Fix broken test 2015-02-09 17:00:22 +00:00
Dave Syer c9b4761544 More defensive exception handling 2015-02-09 16:39:14 +00:00
Dave Syer 8dd9b830e0 Add logic for servlet prefix in ProxyRouteLocator
If the ServerProperties contain a servletPath then the handler mapping
does not contain that prefix, but the incoming request URI does. This leads
to some interesting prefix stripping gymnastics. All the existing tests
assumed that the prefix was empty (the default for a Spring boot app).

See gh-199
2015-02-09 15:04:54 +00:00
Dave Syer 6f569976e8 Avoid NPE if discovery is not available yet 2015-02-06 17:54:50 +00:00
Dave Syer 29383de8c1 Allow zuul.ignoredServices to be a pattern
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
2015-02-05 17:00:17 +00:00