Compare commits

..
2152 Commits
Author SHA1 Message Date
buildmaster fb6676d634 Update SNAPSHOT to 2.1.0.RC3 2018-12-20 21:11:11 +00:00
Ryan Baxter c1bbb9cbb3 Updating API usage for Boot 2.1.x. 2018-12-18 16:18:06 -05:00
Spencer Gibb e65f78f06b Merge branch '2.0.x' 2018-12-18 14:49:49 -05:00
Ryan Baxter 4e7e187323 Fix bug where host contains protocol characters (#97)
Fixes #94
2018-12-18 14:48:31 -05:00
Olga Maciaszek-Sharma a1a45125ea Upgrade openfeign to 10.1.0 (#95)
Upgrade to OpenFeign 10.1.0
2018-12-13 18:03:35 +01:00
Ryan Baxter b00abe7b68 Fixing docs 2018-12-12 12:22:46 -05:00
buildmaster b9cb792820 Going back to snapshots 2018-12-11 21:52:28 +00:00
buildmaster a38ebe40c8 Update SNAPSHOT to 2.1.0.RC2 2018-12-11 21:51:44 +00:00
buildmaster a064530141 Going back to snapshots 2018-12-11 16:38:12 +00:00
buildmaster 61afb5dcd6 Update SNAPSHOT to 2.1.0.RC1 2018-12-11 16:37:40 +00:00
Ryan Baxter 20017afdca Merge remote-tracking branch 'origin/2.0.x' 2018-12-11 10:04:16 -05:00
wzslw 88a6682f46 Update pom.xml (#88)
Remove duplicate dependency
2018-12-11 10:02:58 -05:00
Ryan Baxter f267c2255b Merge remote-tracking branch 'origin/2.0.x' 2018-12-11 09:12:30 -05:00
Ryan Baxter dd7b869a12 Uncommenting assert 2018-12-10 12:30:03 -05:00
Momo d46fb3a92e Add support for feign's QueryMap annotation for Object mapping (#79)
* Add QueryMapParameterProcessor

* Add license to QueryMapParameterProcessor

* Use SpringQueryMap instead of QueryMap. Add test.

* Add documentation and license to SpringQueryMap

* SpringQueryMap docs

* Fix typos
2018-12-06 21:26:36 +01:00
buildmaster cc2fe823c3 Going back to snapshots 2018-11-18 09:42:08 +00:00
buildmaster f1975e5200 Update SNAPSHOT to 2.1.0.M2 2018-11-18 09:41:37 +00:00
buildmaster 5ddd771ed5 Bumping versions to 2.0.3.BUILD-SNAPSHOT after release 2018-10-23 18:11:07 +00:00
buildmaster 9f9c41ab59 Going back to snapshots 2018-10-23 18:11:06 +00:00
buildmaster 4dd68ca2f2 Update SNAPSHOT to 2.0.2.RELEASE 2018-10-23 18:08:54 +00:00
Ryan Baxter af094d0bfc Remove rogue content in docs 2018-10-02 16:41:14 -04:00
Ryan Baxter e85e74e311 Merge remote-tracking branch 'origin/2.0.x' 2018-10-02 13:08:37 -04:00
Ryan Baxter 77cdd40f7d Add missing properties to additional-spring-configuration-metadata. Fixes #61 2018-10-02 13:07:19 -04:00
buildmaster 71675455a3 Going back to snapshots 2018-09-21 21:40:58 +00:00
buildmaster a39e6316b5 Update SNAPSHOT to Greenwich.M1 2018-09-21 21:40:12 +00:00
sdoeringNew 750cb35e6a Add builder for feign clients. (#56)
Utilizes the logic from the registrar and the factory bean. The changes to them have been made minimal invasive.

Fixes gh-42
2018-09-19 09:37:51 -04:00
Kerwin Bryant b512c451fd optimized automatic configuration (#70) 2018-09-19 09:35:01 -04:00
Ryan Baxter da6a51778f Merge branch '2.0.x' of github.com:spring-cloud/spring-cloud-openfeign into 2.0.x 2018-09-12 15:00:42 -04:00
Ryan Baxter 9fc19bb6fe Updating dependencies. Fixes #68 2018-09-12 14:56:33 -04:00
Kerwin Bryant 3e3e486648 Support to set loadBalancerKey (#50)
* Support to override CachingSpringLoadBalancerFactory to customize the FeignLoadBalancer instance.
2018-09-12 14:38:15 -04:00
Spencer Gibb 15bda96e91 Merge branch '2.0.x' 2018-09-05 16:09:38 -04:00
Eugene e0bf63bed1 Added support for MultipartFile (#66)
Fixes gh-62

### Notes
The solution is based on
```
        <dependency>
            <groupId>io.github.openfeign.form</groupId>
            <artifactId>feign-form-spring</artifactId>
            <version>3.3.0</version>
        </dependency>
```

Class `feign.form.spring.SpringFormEncoder` was added inside `org.springframework.cloud.openfeign.support.SpringEncoder` because it's doesn't has some checks:
1. Check of  `bodyType` on null.
`org.springframework.cloud.openfeign.support.SpringEncoder#encode` don't handle situation when `bodyType` is null.

2. No check for content type `multipart/form-data` in header. 
`feign.form.FormEncoder` requires `multipart/form-data` in header for proper processing.

All this checks added and tests are passed.
2018-09-05 16:07:56 -04:00
Nicklas Holm a33fd6d869 Add spring boot configuration processor. Fixes #63 (#64) 2018-09-05 10:01:53 -04:00
Ryan Baxter 06ccb9d1e5 Remove code which was calling FallbackFactory with RuntimeException. Fixes #41 (#58) 2018-08-17 10:23:37 -04:00
Halvdan Hoem Grelland 52bea35160 Support Spring formatting annotations for params (#48)
* Add factory for Param.Expander using ConversionService. Instances use ConversionService and passes annotations (through TypeDescriptor) - ConversionService can now pick up @DateTimeFormat and @NumberFormat and convert the params applying those.
2018-08-15 07:19:24 -04:00
Ryan Baxter d57cea265e Fix invalid URI error when Feign request URI does not end in /. See sc-netflix #3136 2018-08-13 14:26:24 -04:00
Spencer Gibb 7148cce790 Upgrades to openfeign 9.7.0
fixes gh-53
2018-08-06 11:52:45 -04:00
Spencer Gibb 88fae41f02 Updates to work with boot 2.1.0 2018-08-03 15:04:17 -04:00
buildmaster 34cb91bc4c Bumping versions to 2.0.2.BUILD-SNAPSHOT after release 2018-07-31 19:06:45 +00:00
buildmaster 58dc45d230 Going back to snapshots 2018-07-31 19:06:45 +00:00
buildmaster 80af701ccf Update SNAPSHOT to 2.0.1.RELEASE 2018-07-31 19:04:57 +00:00
Ryan Baxter 46bc5da424 Make netflix starters optional. Fixes #35 (#36) 2018-07-25 20:11:00 -04:00
Ryan Baxter 7dcb696ec4 Use OK Http client bean instead of instance variable. Fixes #46 2018-07-24 09:44:45 -04:00
Ryan Baxter 69461d4385 Adding spring boot autoconfigure processor. Fixes #43. 2018-07-09 09:31:35 -04:00
Matt Benson 8364b16b8e expose configuration metadata for property 'feign.hystrix.enabled' (#40) 2018-06-28 07:28:32 -04:00
Ian Hu 6d4686624e Fix typo in comments (#38) 2018-06-26 07:10:51 -04:00
buildmaster 51ad63231d Bumping versions to 2.0.1.BUILD-SNAPSHOT after release 2018-06-18 20:33:23 +00:00
buildmaster 6c09501d77 Going back to snapshots 2018-06-18 20:33:22 +00:00
buildmaster 7e1c91c8b8 Update SNAPSHOT to 2.0.0.RELEASE 2018-06-18 20:31:53 +00:00
Spencer Gibb 674b88b467 Updates to s-c-build 2.0.2.BUILD-SNAPSHOT 2018-06-05 15:42:52 -04:00
Fernando F D Bittencourt a57c416d4a Explaining the return in case of exception. (#32) 2018-06-01 16:44:09 -04:00
Karl Nicholas ffd4290e06 Update package to correct package in two test files. (#30) 2018-05-31 15:58:09 -04:00
Ryan Baxter 804ef91620 Merge branch 'master' of github.com:spring-cloud/spring-cloud-openfeign 2018-05-31 07:54:28 -04:00
Ryan Baxter 48e2f70757 Updating sc-build to 2.0.2.BUILD-SNAPSHOT 2018-05-31 07:54:04 -04:00
Rafael Renan Pacheco 569628689b Format "Creating Feign Clients Manually" snippet (#29) 2018-05-29 11:09:05 -04:00
buildmaster af02a8c692 Going back to snapshots 2018-05-24 23:56:03 +00:00
buildmaster 21be1e129c Update SNAPSHOT to 2.0.0.RC2 2018-05-24 23:55:25 +00:00
Gerasimov Gennady 18111801d3 Misspelling fix according to https://github.com/spring-cloud/spring-cloud-openfeign/issues/24 (#25) 2018-05-24 11:41:38 -04:00
Ryan Baxter e27d4d38e5 Fixing compatibility issues between netflix and openfeign as well as boot 1.5.x and 2.0.x 2018-05-18 14:17:09 -04:00
Ryan Baxter 01a2cda776 Remove misplaced StringEncoder setting when dealing with protobuf. Porting change from sc-netflix #2453 2018-05-18 13:53:58 -04:00
Ryan Baxter 9ac36c7f3f Use type parameter instead of class. Fixes problem when OK HTTP is not on the classpath. 2018-05-02 15:52:36 -04:00
buildmaster f4fc531857 Going back to snapshots 2018-04-20 20:31:00 +00:00
buildmaster 596b42291f Update SNAPSHOT to 2.0.0.RC1 2018-04-20 20:30:19 +00:00
buildmaster 17fa94f704 Going back to snapshots 2018-03-22 21:22:08 +00:00
buildmaster baf92c8226 Update SNAPSHOT to 2.0.0.M2 2018-03-22 21:21:31 +00:00
Ryan Baxter 30b05c7361 FIxing links 2018-03-21 20:08:28 -04:00
Ryan Baxter 042244428f Fix NPE when body is empty. Fixes #12. 2018-03-13 16:33:59 -04:00
Ryan Baxter 485583dad8 Refactor spring retry code (#10) 2018-03-12 22:16:44 -04:00
MCoulombe727 c45f1532da Fix the race condition with the GC since the ConcurrentReferenceHashMap holds soft references to clients. (#6)
Fixes gh-5
2018-03-09 12:39:58 -05:00
Ryan Baxter 537599fad2 Adding codacy badge 2018-03-09 07:53:48 -05:00
Ryan Baxter d4e95cd777 Merge branch 'master' of github.com:spring-cloud/spring-cloud-openfeign 2018-03-09 07:32:33 -05:00
Ryan Baxter 1fa53b8bf9 Added codecov link to readme 2018-03-09 07:31:37 -05:00
Ryan Baxter 2d7909a8ec codecov.yml for comments on pr 2018-03-08 20:26:06 -05:00
buildmaster d68016149d Going back to snapshots 2018-02-26 21:52:00 +00:00
buildmaster 92ccccac2f Update SNAPSHOT to 2.0.0.M1 2018-02-26 21:51:37 +00:00
Ryan Baxter 139cc9dab4 Changes and new tests from Netflix 2018-02-22 15:43:04 -05:00
Ryan Baxter 30d9245821 Updated from netflix 2018-02-20 15:34:38 -05:00
Ryan Baxter 26d8e6450b Moving new code over from netflix 2018-02-20 14:27:38 -05:00
Ryan Baxter 8138dbd792 Adding circleci badge 2018-02-06 20:35:43 -05:00
Ryan Baxter 840cdee7bb Adding circle config 2018-02-06 20:28:44 -05:00
Ryan Baxter bc9741591b Documentation updates 2018-02-06 20:18:41 -05:00
Ryan Baxter 217443048f openfeign project 2018-02-05 20:25:44 -05:00
Andreas Evers 4c181c9671 Small fix for wrong routes details endpoint (#2706) 2018-02-05 07:49:40 -05:00
Igor Suhorukov 076df77563 Optimize thread safe code and replace the synchronized class "StringBuffer" by an unsynchronized one "StringBuilder". (#2704) 2018-02-04 20:09:09 -05:00
Ryan Baxter 07411bba40 Fix compilation errors due to changes in commons 2018-02-02 07:47:57 -05:00
Igor Suhorukov 24dfd4ae76 fix issue with assertion in HystrixStreamTests, polish diamond operator and follow class field naming convention (#2703)
* fix assertion check

* polish: replace the type specification in this constructor call with the diamond operator ("<>"),
make EUREKA_PACKAGES final to avoid issue "static non-final field names should comply with a naming convention"
2018-02-01 19:15:51 -05:00
Spencer Gibb b2ebfc0ecb Updates to new ServletEndpoint and ControllerEndpoint 2018-01-29 18:56:11 -05:00
Spencer Gibb eb0681f9c2 Get dynamic instanceinfo in ServiceRegistry.getStatus()
See https://github.com/spring-cloud/spring-cloud-commons/issues/310
2018-01-29 17:48:35 -05:00
Spencer Gibb 041b493a25 polish 2018-01-26 17:09:16 -05:00
Spencer Gibb a81eb771e5 Updates for new HttpTraceRepository 2018-01-26 16:21:58 -05:00
Ryan Baxter acf427974b Filter name change in boot 2.0 2018-01-26 11:47:25 -05:00
Ryan Baxter c3475f194e Fix failing unit test 2018-01-26 10:20:46 -05:00
saga f7e5b7f726 Minor changes (#2681) 2018-01-25 07:35:53 -05:00
Spencer Gibb 29ad943f0a Use scheme in load balancing if provided. 2018-01-23 00:44:28 -05:00
Ryan Baxter d4e7f25e3b Merge remote-tracking branch 'origin/1.4.x' 2018-01-22 13:54:09 -05:00
Spencer Gibb e0ad44f2f1 Updates to new location of SecurityAutoConfiguration 2018-01-22 13:38:09 -05:00
saga ff68e0f66e Prevent RibbonRoutingFilter throws exceptions when Http status codes are non-standard(Against the 1.4.x branches) (#2671)
* This PR fixes #2639 and against the 1.4 branches
2018-01-22 11:27:15 -05:00
Dave Syer 08b8034eca Remove commons-logging as explicit dependency
Hopefully spring boot logging provides enough of the API for
Archaius to work (I think that's the only reason it was there).
Causes issues with logging switching to JUL at odd times (like
on context closed events).
2018-01-20 09:36:55 +00:00
Ryan Baxter d3385f8cd6 Merge remote-tracking branch 'origin/1.4.x' 2018-01-19 15:46:04 -05:00
Ryan Baxter d51112e6af Pass the right request to getSecureRequest. Fixes #2667. (#2669) 2018-01-19 15:27:15 -05:00
Ryan Baxter 6bfb7c6d6e Merge remote-tracking branch 'origin/1.4.x' 2018-01-19 12:37:07 -05:00
Ryan Baxter 3c9792545b Merge remote-tracking branch 'origin/1.4.x' 2018-01-18 20:03:43 -05:00
Ryan Baxter 1c79bd2646 Flip disable ssl flag for SimpleHostRoutingFilter. Fixes #2503. 2018-01-18 14:01:41 -05:00
Ryan Baxter 6bb5830220 Remove deprecated ZuulFallbackProvider in favor of FallbackProvider. Add route parameter to fallbackResponse. Fixes #2655 (#2664) 2018-01-18 13:40:43 -05:00
Biju Kunjummen 7b7cf7e5e8 Uses ApplicationContextRunner, removes main method in tests (#2626) 2018-01-17 18:30:01 -05:00
Ryan Baxter c79ac8ba19 Remove / from prefix if present.
Fixes #2625
2018-01-17 18:16:18 -05:00
Toshiaki Maki 89cb8d1d9c Add commandProperties in HystrixCommands (#2656) 2018-01-17 15:09:24 -05:00
reillylm 06672462ab fix zuul intro typo (#2658) 2018-01-17 14:37:35 -05:00
Spencer Gibb 6fd4f44125 Fix updates from micrometer 2018-01-17 12:28:01 -05:00
Spencer Gibb f7172dd0c5 Polish 2018-01-17 12:13:27 -05:00
Spencer Gibb 1c51c9fa5e Updates test to account for new application context id rules from boot 2 2018-01-17 11:45:56 -05:00
Ryan Baxter a399cca7ce Use disableSslProperty when creating Feign http cients. Fixes 2652. (#2654) 2018-01-16 20:10:50 -05:00
Spencer Gibb 736317e684 Fix test 2018-01-16 16:43:08 -05:00
buildmaster 3c0c054d62 Bumping versions to 1.4.3.BUILD-SNAPSHOT after release 2018-01-16 12:56:05 +00:00
buildmaster 3a07faf23a Going back to snapshots 2018-01-16 12:56:04 +00:00
buildmaster 0bfa706a39 Update SNAPSHOT to 1.4.2.RELEASE 2018-01-16 12:43:02 +00:00
Ryan Baxter 837267fb0a Bumping version to next release 2018-01-12 14:37:33 -05:00
Spencer Gibb 6a3c509768 Supports /hystrix.stream for webflux
fixes gh-2629
2018-01-11 16:02:07 -05:00
saga 31b4646882 remove extra aware interface (#2636) 2018-01-11 15:51:24 -05:00
Ryan Baxter 16a5b00738 Add core dependency back to Hystrix starter or else starter wont include Hystrix implementation. 2018-01-11 14:17:15 -05:00
Ryan Baxter 8d18dfbc3d Set hystrix timeout for Zuul routes based on whether the hystrix command timeout, default timeout, or ribbon timeouts are set. Fixes #2606 (#2633) 2018-01-11 10:05:02 -05:00
Guillaume Berche e4870c94f2 Refine Feign manual client doc (#2627) 2018-01-11 07:51:26 -05:00
saga 241468ab7a Remove redundant default parameter (#2635) 2018-01-11 07:47:54 -05:00
saga 94d7d2574b Minor changes (#2632)
* Remove invalid import

* Remove invalid line
2018-01-10 10:51:47 -05:00
Spencer Gibb dd978169da Use new RibbonProperties consistently. 2018-01-09 17:11:01 -05:00
Spencer Gibb ca81bdf71e Ribbon utilities 2018-01-09 15:15:08 -05:00
Ryan Baxter 84f56ec3b2 Move Ribbon to its own module (#2548)
* Move Ribbon to its own module. Fixes #2299
2018-01-09 08:25:40 -05:00
Igor Kryvenko 208117bdd3 hotfix/add-log-ribbon (#2619)
* Add logging to RibbonLoadBalancerRetryPolicy
2018-01-09 00:55:35 -05:00
Ryan Baxter d2155dc561 Only strip the prefix if it actually part of the path. Fixes #2377 (#2624) 2018-01-08 14:42:33 -05:00
Spencer Gibb db66e1c3d4 polish 2018-01-08 13:14:25 -05:00
saga 113b49e283 Remove useless import (#2622) 2018-01-08 07:35:53 -05:00
Igor Kryvenko b48189790c Fixes gh - 2594 (#2611) 2018-01-04 11:08:37 -05:00
saga 882219f962 spring-retry listener features (#2609) 2018-01-04 09:42:26 -05:00
Ryan Baxter 8dfcdbed76 Adding repos to sc-netflix-hystrix-contract pom 2018-01-04 07:49:06 -05:00
Ryan Baxter 8017995ba3 Moving sc-build to 1.3.8.BUILD-SNAPSHOT 2018-01-03 19:42:03 -05:00
Ryan Baxter ca399ffd0b Moving dependencies to snapshots 2018-01-03 16:28:41 -05:00
Ryan Baxter bf67680f4b Fix management port property to align with Boot 2.0 2018-01-03 16:11:12 -05:00
Ryan Baxter b24a0524ed Merge remote-tracking branch 'origin/1.4.x' 2018-01-03 14:43:14 -05:00
Ryan Baxter a4c995a394 Disable following redirects in SimpleHostRoutingFilter. Fixes #2578. (#2608) 2018-01-03 14:19:39 -05:00
Bertrand Renuart fb0d53a796 Invoke super.onCacheRefreshed() before custom logic (#2604) 2018-01-02 20:10:06 -05:00
Nastya Smirnova 9deab33dc1 fixes #2524 (#2574)
set proper status and health eureka urls if prefer ip address is set
2018-01-02 15:42:59 -05:00
Toshiaki Maki 29adaf26e9 Use verifyError (#2602) 2018-01-02 14:25:26 -05:00
saga b3acc1390c Add check to prevent StackOverflowError (#2580) 2018-01-02 14:24:54 -05:00
Riz Joj 3abc89b9e7 EurekaHealthCheckHandler: Added protected getter to obtain CompositeHealthIndicator (#2583)
* Adding protected getter to obtain CompositeHealthIndicator. This allows subclasses to obtain this indicator's health details map which is useful for error reporting.
2018-01-02 14:13:43 -05:00
周立 04560724d3 fix wrong sentence. (#2582)
* fix wrong sentence.
2018-01-02 14:06:34 -05:00
Spencer Gibb 81aadc3e05 Add test dependency for spring-security-rsa
fixes no class def found error
2018-01-01 16:48:02 -05:00
buildmaster 7c20c274d7 Bumping versions to 1.3.7.BUILD-SNAPSHOT after release 2017-12-21 21:34:12 +00:00
buildmaster 7339021684 Going back to snapshots 2017-12-21 21:34:11 +00:00
buildmaster 579fb1bfa7 Update SNAPSHOT to 1.3.6.RELEASE 2017-12-21 21:30:03 +00:00
Silas Mahler 0859350715 Fix typo in Turbine example url (#2568) 2017-12-20 17:59:09 -05:00
Spencer Gibb 4165fe221b Allow overriding of initialize() 2017-12-20 14:55:03 -05:00
Ryan Baxter d76454b1ec Adding issue and contributing templates 2017-12-20 14:37:35 -05:00
Spencer Gibb 50924f296f Moves from archaius to boot properties.
This fixes problems in testing while maintaining backwards compatibility.

Allows upgrade of zuul to 1.3.1
2017-12-20 14:31:36 -05:00
Spencer Gibb 0a689b5008 polish 2017-12-20 14:30:25 -05:00
Spencer Gibb ac1ac4d5b1 Reinstates upgrade to zuul 1.3.1 2017-12-20 14:29:55 -05:00
Ryan Baxter 53ffb11a21 Revert "Update zuul-core to 1.3.1 version (#2547)"
This reverts commit 348d1c5b8a.
2017-12-19 19:35:46 -05:00
Nastya Smirnova 348d1c5b8a Update zuul-core to 1.3.1 version (#2547) 2017-12-19 16:21:10 -05:00
saga 434fb6e9fa Refactor the getScanner method of the FeignClientsRegistrar class (#2559) 2017-12-19 15:46:04 -05:00
Kerwin Bryant 90094b6b9a public FeignLoadBalancer.RibbonRequest and FeignLoadBalancer.RibbonResponse to the user to customize their needs (#2536) 2017-12-19 14:43:39 -05:00
Tim Ysewyn 4f2f4f6a60 Added util method to upgrade the connection to a secure one. (#2551)
* Added util method to upgrade the connection to a secure one.

- Adds support for websocket URIs
- Fixes bug where a non-secure scheme other than http would be changed to https
- Deprecated `updateToHttpsIfNeeded` in favor of `updateToSecureConnectionIfNeeded`

* Expect http when no scheme was set

* Skip update to secure connection when the uri is empty
2017-12-19 14:08:00 -05:00
周立 1210db9a15 Change spring-cloud-starter-hystrix-netflix-dashboard to spring-cloud-starter-netflix-hystrix-dashboard (#2560)
Change spring-cloud-starter-hystrix-netflix-dashboard to spring-cloud-starter-netflix-hystrix-dashboard
2017-12-18 09:06:55 -05:00
周立 94358489ef Change spring-cloud-starter-hystrix-dashboard to spring-cloud-starter-netflix-hystrix-dashboard (#2561)
Change spring-cloud-starter-hystrix-dashboard to spring-cloud-starter-netflix-hystrix-dashboard
2017-12-18 09:05:30 -05:00
Tomasz Juchniewicz 06398da4df Allow multiple values in @RequestMapping(produces|consumes) for Spring MVC endpoints. (#2523)
Fixes gh-808.
2017-12-15 14:43:43 -05:00
Craig Rueda 504720e366 InputStream should always be closed after reading contents from upstreams (#2501)
* InputStream should always be closed after reading contents from upstreams
2017-12-15 14:07:34 -05:00
Ryan Baxter 3d7892c2e6 Merge remote-tracking branch 'origin/1.4.x' 2017-12-12 12:58:03 -05:00
Spencer Gibb 170739e662 Fix compile error, ignore broken tests 2017-12-11 21:38:44 -08:00
Ryan Baxter 07de257371 Merge remote-tracking branch 'origin/1.3.x' into 1.4.x 2017-12-08 17:19:57 -08:00
Fahim Farook 6e2238f231 Update Eureka Server's service-urls upon EnvironmentChangeEvent. (#2455)
Fixes gh-2421
2017-12-08 15:07:05 -08:00
saga f640ffd251 SimpleHostRoutingFilter should pull InputStream from RequestContext
Fixes #2513
2017-12-08 14:45:57 -08:00
Ryan Baxter 0401ad96e5 Fixes double encoding when creating secure URLs (#2526)
* Fixes double encoding when creating secure URLs.  Fixes #2478.
2017-12-08 10:39:21 -08:00
saga 05cd507d9a Adjust the code format (#2507)
* Adjust the code format
2017-12-03 22:30:18 -05:00
Ryan Baxter 3e90724505 Switched branch in docs and merged changes forward 2017-12-03 15:22:24 -08:00
Ryan Baxter efb91874f8 Correcting image links. Fixes #2487 2017-12-03 15:06:48 -08:00
buildmaster 4e8d58869e Going back to snapshots 2017-12-02 02:57:45 +00:00
buildmaster 32efd30dc0 Update SNAPSHOT to 2.0.0.M5 2017-12-02 02:54:51 +00:00
Spencer Gibb eec4c8cf85 remove empty files 2017-12-01 21:46:27 -05:00
Daniel Lavoie ebdcca4fa8 Hystrix Dashboard Cannot display anything for Turbine Stream (#2484)
Closes #2475
2017-12-01 16:38:15 -05:00
Daniel Qian d38f390b95 fix documentation typo (#2488) 2017-12-01 16:30:46 -05:00
Spencer Gibb e3cdb76373 Revert "fix zuul filters package url in Edgware (#2493)" (#2495)
This reverts commit d5e3cad80e.
2017-11-30 21:26:21 -05:00
周立 d5e3cad80e fix zuul filters package url in Edgware (#2493)
fix zuul filters package url in Edgware
2017-11-30 21:23:08 -05:00
周立 2287e0caf2 fix zuul filters package url in Edgware (#2489)
fix zuul filters package url in Edgware
2017-11-30 10:48:35 -05:00
Spencer Gibb b8a357b685 Upgrade wiremock to 1.2.0.RELEASE 2017-11-28 14:45:11 -05:00
Spencer Gibb ff5bf153bf Merge branch '1.4.x'
# Conflicts:
#	docs/pom.xml
2017-11-28 12:39:24 -05:00
Spencer Gibb dde7ff4c45 Update docs branches 2017-11-28 12:38:23 -05:00
Spencer Gibb 1cf1f435a6 Update eureka to 1.8.6
fixes gh-2456
2017-11-28 12:25:02 -05:00
Spencer Gibb 4e40cad235 Polish test 2017-11-28 11:25:49 -05:00
saga 14c1d461b7 Improve the document (#2474)
Replace @Configuration, @ComponentScan, @EnableAutoConfiguration with @springbootapplication.
2017-11-28 06:30:41 -05:00
Spencer Gibb 07c4604c9b Polish test 2017-11-28 01:16:34 -05:00
Spencer Gibb ef755f3ad3 Merge branch 'master' into 2.0.x 2017-11-27 22:52:09 -05:00
Spencer Gibb e19ecf71da Updates for boot 2.0 compatibility 2017-11-27 14:31:19 -05:00
Spencer Gibb 7c62bd8871 Updates for boot 2.0 compatibility 2017-11-27 13:44:59 -05:00
saga 6c52269dc5 Associated with this PR # 2466 (#2470)
Use StringBuffer for String concatenation
2017-11-27 07:55:39 -05:00
saga 736a3e4610 Format indent adjustment (#2468)
Format indent adjustment
2017-11-26 07:32:33 -05:00
Spencer Gibb ae34b77371 Updates for boot 2.0 compatibility 2017-11-22 12:30:54 -05:00
Spencer Gibb 946a46f2b1 Merge branch 'master' into 2.0.x 2017-11-21 19:27:49 -05:00
Spencer Gibb 1e87b50998 Update releaser build to build docs 2017-11-21 18:37:48 -05:00
Spencer Gibb f59a228daf Pass system properties to releaser build command 2017-11-21 17:48:01 -05:00
Ryan Baxter db3a412c8a Fixing command to run maven 2017-11-20 16:10:55 -05:00
Ryan Baxter 202f96876e Bumping versions to 1.4.1.BUILD-SNAPSHOT after release 2017-11-20 16:03:53 -05:00
Ryan Baxter 2489d5e234 Going back to snapshots 2017-11-20 16:03:52 -05:00
Ryan Baxter 64ad2ba20c Update SNAPSHOT to 1.4.0.RELEASE 2017-11-20 15:54:27 -05:00
Yongsung Yoon 60c4e1b007 Add support loadBalancerKey in RibbonRoutingFilter of Zuul for Canary test (#2439)
* Add support loadBalancerKey in RibbonRoutingFilter

* Add documentation about how to provide a loadBalancerKey to Ribbon

* Add integrationtest for RibbonRoutingFilter's loadBalancerKey support
2017-11-20 06:28:23 -05:00
Ryan Baxter 6e3b4fdd7b Adds backoff policies when retrying requests (#2436)
* Adds backoff policies when retrying requests.  Fixes #2195

* fixing final variable
2017-11-16 20:11:55 -05:00
buildmaster d7b40e1052 Going back to snapshots 2017-11-15 01:45:33 +00:00
buildmaster 8e412f08bc Update SNAPSHOT to 2.0.0.M4 2017-11-15 01:43:03 +00:00
Nastya Smirnova 62a8f72b98 Incorrect statusPageUrl and healthCheckUrl are reported to Eureka if management.context-path is not set (#2145) 2017-11-14 12:54:12 -05:00
Spencer Gibb aaec6c4ca1 polish 2017-11-13 15:17:58 -05:00
Ryan Baxter 89441ac126 Added zuul timeout documentation. Fixes #2201 2017-11-10 15:54:05 -05:00
Ryan Baxter 9a6dad11bc Fixing test failures 2017-11-08 16:08:07 -05:00
Ryan Baxter d9f7842aec Fix HystrixClientFallbackFactory implementation in docs. Fixes #2428 2017-11-08 11:00:51 -05:00
Ryan Baxter 65762b1dce Remove deprecated RetryableStatusCodeException. Fixes #2003 (#2427) 2017-11-07 17:26:17 -05:00
Nastya Smirnova ba24811356 Report jmx and management ports to Eureka metadata map (#1830)
Follows: https://github.com/spring-cloud/spring-cloud-netflix/pull/1317
2017-11-07 13:42:23 -05:00
agseijas 573d52119a Adds feign-* missing managed dependencies (#2417)
Probably we could import a bom from feign.
2017-11-07 10:56:10 -05:00
Ryan Baxter 3cafacc3e9 Fixes #2415 2017-11-06 15:43:20 -05:00
Spencer Gibb f511c267ce Fix circular reference during object creation. 2017-11-06 08:37:59 +02:00
Spencer Gibb 799fbf43d1 polish 2017-11-06 08:26:33 +02:00
Spencer Gibb c4b075b1c8 Removes log4j-to-slf4j exclusion 2017-11-01 17:13:10 -04:00
Spencer Gibb 8112ddfec2 Temporarily excludes log4j-to-slf4j 2017-11-01 16:28:06 -04:00
Spencer Gibb 5a1708185a Fix removal of getLocalServiceInstance() 2017-10-30 18:25:22 -04:00
Spencer Gibb 35e2af7711 Merge branch 'master' into 2.0.x 2017-10-30 18:20:45 -04:00
Spencer Gibb a805b53d86 Merge branch 'daniellavoie-no-eureka-fix' 2017-10-30 18:10:15 -04:00
Daniel Lavoie c0c59320a5 Regression fix for hystrix stream without eureka registration 2017-10-30 18:10:11 -04:00
Spencer Gibb 388ec98087 Updates for changes to boot 2 2017-10-30 17:45:40 -04:00
Spencer Gibb 271bfcfb31 Fix tests 2017-10-27 18:43:31 -04:00
Spencer Gibb 2be1fb5123 Fix test 2017-10-27 17:36:38 -04:00
Spencer Gibb 70b0c06349 Fix zuul tests 2017-10-27 17:13:32 -04:00
Spencer Gibb bd7d8c944c Going back to snapshots 2017-10-27 16:39:34 -04:00
Spencer Gibb 355adf8369 Update SNAPSHOT to 2.0.0.M3 2017-10-27 16:37:39 -04:00
Spencer Gibb c9ce7af0f2 Add repositories 2017-10-27 16:26:38 -04:00
Spencer Gibb 086aa43055 Trying to fix tests 2017-10-27 16:16:21 -04:00
Spencer Gibb 103bd6475f Trying to fix tests 2017-10-27 16:03:38 -04:00
Spencer Gibb 5cc94532a7 remote routes defined in file 2017-10-27 15:44:23 -04:00
Spencer Gibb e07ed0bd9c Attempt to debug test in jenkins 2017-10-27 15:29:37 -04:00
Spencer Gibb 391add0945 Attempt to debug test in jenkins 2017-10-27 15:15:53 -04:00
Spencer Gibb cf576055f6 rename potential conflicting ribbon contexts 2017-10-27 14:17:01 -04:00
Spencer Gibb 0d84e72d76 points build.sh at correct mvnw location 2017-10-27 12:26:28 -04:00
Spencer Gibb 4932eef1c9 Adds toObservable function to HystrixCommands.
Lets user have full control over how the Observable is created with
sane defaults for eager/non-eager cases.
2017-10-24 14:46:41 -04:00
Spencer Gibb c6a00c1a71 Move to proper reactor testing 2017-10-24 14:22:31 -04:00
Stephane Maldini a67a077906 fix overflow issue with hystrix timeout operator (#2391)
- The fix adds a necessary buffer between the rx-rs adapter and
the timeout operator introduced in AbstractCommand. Unfortunately,
the hystrix operator does not comply with RS backpressure requirements.
It will always request an unbounded demand to a source regardless of
the command consumer demand. With this commit we protect RS adapter and
downstream flow from overflow. Ideally a rework of the operator should
be planned.
2017-10-24 14:01:44 -04:00
JagmohanSharma 798a4bb2b9 https://github.com/spring-cloud/spring-cloud-netflix/issues/2387 (#2388)
In order to fix issue with TPS in hystrix-dashboard threadpool section, removing average calculation for propertyValue_metricsRollingStatisticalWindowInMilliseconds. This was done for hystrixCommand.js previously but not for hystrixThreadpool.js.
2017-10-24 13:18:34 -04:00
Spencer Gibb eb07e2b058 remove java version property 2017-10-23 22:15:37 -04:00
Spencer Gibb a878472a73 Updates to boot 2.0.0 endpoint and properties. 2017-10-23 21:47:37 -04:00
Spencer Gibb ef508b4223 Merge branch 'master' into 2.0.x 2017-10-23 21:22:20 -04:00
Spencer Gibb df7f31098c Going back to snapshots 2017-10-23 17:44:26 -04:00
Spencer Gibb fa9524f9c9 Update SNAPSHOT to 1.4.0.RC1 2017-10-23 17:39:56 -04:00
Spencer Gibb 1368f059bb Change contract property name 2017-10-23 17:16:32 -04:00
Spencer Gibb 8701060355 Add workaround for locally failing test. 2017-10-23 17:05:30 -04:00
Spencer Gibb ee067ed3f2 Merge branch 'raiRaiyan-gh-2303' 2017-10-23 14:43:38 -04:00
Raiyan b57dedb74a - Eureka client auto configures the secure port when secure port is enabled
- The eureka instance auto registration also changes the secure port when the server port is random (0)

Fixes gh-2303
2017-10-23 14:43:20 -04:00
Spencer Gibb d7c13adac0 Merge branch 'tiny-dancer-patch-1' 2017-10-23 14:19:13 -04:00
mg bd2473a7bf Update spring-cloud-netflix.adoc
Update documentation to reflect https://github.com/spring-cloud/spring-cloud-netflix/issues/1048
2017-10-23 14:18:40 -04:00
Gregor Zurowski de16cb71f1 Add new filters actuator endpoint (#2244)
* Add new Zuul filters endpoint and refactor routes endpoint
* Refactor FiltersEndpoint
- Extend from AbstractEndpoint and simplify code
- Move tests classes into package endpoint
- Remove usage of Lombok
* Conditionally enable Zuul routes and filters endpoints
* Provide FilterRegistry to FiltersEndpoint via constructor
2017-10-23 14:08:00 -04:00
Spencer Gibb 4995844f04 Upgrade to eureka 1.8.4
fixes gh-2386
2017-10-21 17:45:12 -04:00
Nastya Smirnova ffc431753b Create TurbineClustersProvider
Extract separate class TurbineClustersProvider to be able to provide custom solution for retrieving configured clusters (#2219)
2017-10-20 21:46:29 -04:00
Spencer Gibb 67f887d870 Update HystrixCommands to use a builder.
Otherwise there would be an explosion of overloaded methods.
2017-10-19 15:52:04 -04:00
Spencer Gibb 5a337fd6c1 Move test to correct package 2017-10-19 14:27:58 -04:00
Spencer Gibb b71ecc1c24 Remove deprecated DiscoveryClient.getLocalServiceInstance() 2017-10-18 11:49:43 -04:00
Spencer Gibb 71bd19d5df Merge branch 'master' into 2.0.x
# Conflicts:
#	spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTests.java
#	spring-cloud-netflix-zuul/src/main/java/org/springframework/cloud/netflix/zuul/ZuulProxyAutoConfiguration.java
2017-10-18 11:36:41 -04:00
Spencer Gibb 28de82e63c Use updated Registration rather than getLocalServiceInstance()
See https://github.com/spring-cloud/spring-cloud-commons/issues/265
2017-10-18 11:34:38 -04:00
Spencer Gibb b4709f5db5 Update to hystrix-contract.
Updates to 2.0.0
2017-10-17 15:07:07 -04:00
Spencer Gibb b0dccc0f81 Merge branch 'master' into 2.0.x
# Conflicts:
#	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/metrics/DefaultMetricsTagProvider.java
#	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/rx/DeferredResultSubscriber.java
#	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/rx/ResponseBodyEmitterSubscriber.java
#	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/rx/RxResponse.java
#	spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/support/RibbonCommandContextTest.java
#	spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/rx/ObservableReturnValueHandlerTests.java
#	spring-cloud-netflix-dependencies/pom.xml
2017-10-17 14:10:22 -04:00
Spencer Gibb 6c65266f05 Formatting spaces->tabs 2017-10-17 13:37:28 -04:00
Spencer Gibb 6ffe2f1af2 Downgrade archaius to 0.7.4 for java 7 compatibility.
see https://github.com/Netflix/archaius/pull/522
2017-10-17 13:12:26 -04:00
Dave Syer 5f26d02433 Merge branch 'master' into 2.0.x 2017-10-17 10:47:46 +01:00
Dave Syer 68ce0cf25f Merge branch 'feature/eureka-stubs' 2017-10-17 10:47:35 +01:00
Dave Syer 0b638884f7 Fix merge in Turbine Stream tests 2017-10-17 10:46:08 +01:00
Dave Syer b704dc50c3 Add restassured dependency manually 2017-10-17 10:22:15 +01:00
Dave Syer 62b6d6def2 Fix hystrix tests broken by 2.0 migration 2017-10-17 10:19:20 +01:00
Dave Syer 8d886eedfe Merge branch 'feature/eureka-stubs' into 2.0.x 2017-10-16 21:35:02 +01:00
Spencer Gibb 7cff8ddbd3 Add missing jackson serialization for instanceinfo.
Port information was missing from data sent to eureka.

fixes gh-2372
2017-10-16 16:23:51 -04:00
Dave Syer 9d1eed6a82 Add script to build contract utils 2017-10-16 16:54:35 +01:00
Dave Syer eeadc829b9 Parameterize contract version 2017-10-13 15:17:46 +01:00
Dave Syer efe040549c Move contract helper out of the reactor build 2017-10-13 15:17:46 +01:00
Dave Syer 5bc9e65cdd Add tests for server metadata 2017-10-13 15:17:46 +01:00
Dave Syer d6a604051f Split tests up into individual methods 2017-10-13 15:17:46 +01:00
Dave Syer 51a03b30f2 Consolidate stub tests into one place 2017-10-13 15:17:46 +01:00
Dave Syer 561f3b2fbf Add wiremock verification 2017-10-13 15:17:46 +01:00
Dave Syer 3a7af2c8fe Generate some stubs, yay! 2017-10-13 15:17:46 +01:00
Dave Syer 26c7c362d2 Add property to tests, parameterizing stubs 2017-10-13 15:17:46 +01:00
Dave Syer 0642ea52c9 Remove unused stubs file 2017-10-13 15:17:46 +01:00
Dave Syer 957e33207e Stabilise some tests 2017-10-13 15:17:46 +01:00
Dave Syer a39fe345b5 Remove deprecated annotation 2017-10-13 15:17:46 +01:00
Dave Syer 40e72ddb8c Tweak assertions a bit 2017-10-13 15:17:46 +01:00
Dave Syer 195c3fd75d Extract utility class into shared library for contract tests 2017-10-13 15:17:46 +01:00
Dave Syer c626bccad3 Add rest template to extract SSE events and assert them
The message has to be sent after the endpoint starts up, which only
happens after the first request is accepted, so we put that logic
in the response extractor.
2017-10-13 15:17:46 +01:00
Dave Syer e295188075 Add tests for body of message 2017-10-13 15:17:46 +01:00
Dave Syer 7804e1bd59 Add Spring Cloud Contract for hystrix stream 2017-10-13 15:17:46 +01:00
Spencer Gibb 2870007392 Adds HystrixCommands helper object. 2017-10-11 23:18:06 -04:00
Spencer Gibb fc9d442599 No longer require spring-boot-starter-web in eureka-client starter.
See gh-2359
2017-10-11 23:17:47 -04:00
Spencer Gibb f4321dd3d6 Add dependency management for rxjava-reactive-streams
Allows for bridging webflux when using hystrix commands.

fixes gh-2355
2017-10-10 12:25:39 -04:00
Spencer Gibb d76416f03c Merge branch 'master' into 2.0.x 2017-10-04 19:35:34 -04:00
Spencer Gibb 6b6889b8b4 Fixes refresh scope bean type. 2017-10-04 19:32:57 -04:00
Spencer Gibb 070e4b5c50 Move to zuul.test package. 2017-10-04 19:16:30 -04:00
Fahim Farook f809c119bd Allow init params to be set on ProxyStreamServlet. (#2335)
* Allow init params to be set on ProxyStreamServlet.

Fixes gh-2301

* Added unit test for #gh-2301
2017-10-03 13:43:17 -04:00
Ryan Baxter a806dc920f Bumping versions to 1.3.6.BUILD-SNAPSHOT after release 2017-10-02 16:22:49 -04:00
Ryan Baxter 74fc02b2cc Going back to snapshots 2017-10-02 16:22:48 -04:00
Ryan Baxter c1fc987d96 Update SNAPSHOT to 1.3.5.RELEASE 2017-10-02 16:17:55 -04:00
Alex Sartan 7f97a61ed5 Fix minor grammar issue in Zuul doc (#2336) 2017-10-01 13:25:32 -04:00
Spencer Gibb 94e8c5196c Fix hystrix stream servlet name. 2017-10-01 11:47:17 -04:00
Spencer Gibb 39b1c0fe0d Update routes endpoint to new endpoint infrastructure.
fixes gh-2318
2017-09-29 16:30:46 -04:00
Spencer Gibb 6f2fc1deae Update to BindingServiceProperties 2017-09-29 15:43:09 -04:00
Spencer Gibb a2d8f0639c Move zuul to its own module. (#2332)
fixes gh-2298
2017-09-29 15:35:57 -04:00
Spencer Gibb 91808bb042 Add support for feign OptionalDecoder
fixes gh-1982
2017-09-28 22:18:52 -04:00
Ryan Baxter 25337dd440 Move Archaius to its own module (#2308)
* Move Archaius to its own module.  

Fixes gh-2300\
2017-09-28 21:28:40 -04:00
Spencer Gibb ec25771453 Upgrade Eureka to v1.8.2
fixes gh-2216
2017-09-28 20:16:02 -04:00
Spencer Gibb c544f4aef6 Move zuul metrics to micrometer.
fixes gh-2317
2017-09-28 18:20:11 -04:00
Spencer Gibb 0ce21c4b15 Fix SpringMvcContractTests
fixes gh-2312
2017-09-28 17:38:39 -04:00
Spencer Gibb ce4d560dc1 Fix RibbonClientHttpRequestFactoryTests
fixes gh-2314
2017-09-28 17:25:47 -04:00
Spencer Gibb 87e98edd61 Move test security uname/pswd to constants. 2017-09-28 17:05:01 -04:00
Spencer Gibb 61513287ce Migrate /hystrix.stream to management context.
fixes gh-2309i
2017-09-28 16:50:13 -04:00
Ryan Baxter 8011b66e53 Merge branch '2.0.x' of github.com:spring-cloud/spring-cloud-netflix into 2.0.x 2017-09-28 15:26:54 -04:00
Ryan Baxter ea8a62ab8e Removing @Ignore 2017-09-28 15:26:25 -04:00
Spencer Gibb 5358b5ba10 polish 2017-09-28 15:13:23 -04:00
Ryan Baxter 1f7f5f90dc Remove @Ignore commented out 2017-09-28 14:48:29 -04:00
Ryan Baxter 14fc7f1ae0 Removing @Ignore 2017-09-28 14:45:29 -04:00
Ryan Baxter c58ae8be21 Removing @Ignore 2017-09-28 14:22:01 -04:00
Spencer Gibb c568ded7c9 remove TODO since servlet 3.0 support is still needed. 2017-09-27 16:13:38 -04:00
Spencer Gibb 0717767297 Fix or ignore tests 2017-09-26 15:24:09 -04:00
Spencer Gibb 10fc74c0ec Fix or ignore tests 2017-09-26 15:24:01 -04:00
Spencer Gibb c9e7d81e8e Fix security in mock eureka server application 2017-09-26 14:00:59 -04:00
Spencer Gibb 312a1d70f7 comment out broken tests 2017-09-25 23:45:57 -04:00
Spencer Gibb d1bc20ac33 Fix spring security tests. 2017-09-25 23:26:42 -04:00
Spencer Gibb 031355790f Remove rx package and classes.
These things are now much better dealt with in Spring MVC and WebFlux
2017-09-25 17:23:02 -04:00
Spencer Gibb 49fdcae8c2 Compile fixes for boot 2 2017-09-25 17:20:58 -04:00
Spencer Gibb 56395596e5 Remove spring-boot metrics information 2017-09-25 17:20:28 -04:00
Spencer Gibb c511440ed9 Remove deprecated starters
fixes gh-1946, gh-2220, gh-2221, gh-2222
2017-09-25 17:19:34 -04:00
Spencer Gibb 8f4ff0e166 Remove spring-boot metrics information 2017-09-25 17:19:08 -04:00
Spencer Gibb 6775e76e5f Remove deprecated starters
fixes gh-1946, gh-2220, gh-2221, gh-2222
2017-09-25 17:17:26 -04:00
Ryan Baxter b9a479607c Merge remote-tracking branch 'origin/master' into 2.0.x 2017-09-25 14:18:49 -04:00
Andre Dörnbrack 05a3db3cc0 Fix zuul post retry (#2209)
Modfied RibbonCommandContext to make request entity resettable. fixes gh-892
2017-09-25 13:59:31 -04:00
Ryan Baxter 145b7ce69a Remove @EnableDiscoveryClient and @EnableEurekaClient (#2242)
* Remove @EnableDiscoveryClient and @EnableEurekaClient as there are now optional.  Fixes #2241.
2017-09-25 13:18:04 -04:00
Ryan Baxter c6fa162728 Merge pull request #2293 from mattjbray/fix-requestmapping-headers
SpringMvcContract: Ignore RequestMapping headers with no value.
2017-09-22 21:15:53 +01:00
Matt Bray 527dc2cc48 SpringMvcContract: Ignore RequestMapping headers with no value.
According to:

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html#headers--

the `headers` field can take several formats:

1. Require the header with a concrete value: `"My-Header=myValue"`
2. Require the header with any value: `"My-Header"`
3. Require the header is absent: `"!My-Header"`
4. Require the header with a negated value : `"My-Header!=myValue"`

This fixes `parseHeaders` for cases 2-4 (which previously threw a `StringIndexOutOfBoundsException`).

Fixes gh-1778.
2017-09-22 18:01:04 +01:00
Dave Syer 7672ee3666 Fix hystrix command keys in tests to be unique 2017-09-21 12:13:19 +01:00
Dave Syer 7ca4f33dcf Remove System.err from test 2017-09-21 11:30:07 +01:00
Spencer Gibb 78e4cb4410 Fix for potential NPE 2017-09-12 17:50:57 -06:00
Spencer Gibb 5cfe0f077f Fix compile errors 2017-09-12 17:38:07 -06:00
spccold baa50c136a simplify org.springframework.cloud.netflix.zuul.filters.ProxyRequestH… (#1965)
* simplify org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper#setResponse

* Update ProxyRequestHelper.java
2017-09-11 17:32:16 -04:00
Ryan Baxter fa9a8bbf95 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-09-08 14:15:26 -04:00
Ryan Baxter 24d0bedf7d Merge pull request #2255 from DominikMostek/fallback_cause
Fallback cause is propagated to fallback provider
2017-09-08 14:12:52 -04:00
Ryan Baxter 8aeca9c2a8 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-09-08 14:10:58 -04:00
Ryan Baxter 38b8786ede Merge pull request #2261 from ryanjbaxter/timeout-values
Adjust Ribbon connect and read timeout values
2017-09-08 14:08:46 -04:00
Ryan Baxter 146513aeb0 Set Ribbon connect and read timeout values to equal the Hystrix timeout. Fixes #1827. 2017-09-08 10:19:01 -04:00
Ryan Baxter 81c6ece801 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-09-07 12:59:58 -04:00
Dominik Mostek 4dc5088fb2 Updated documentation with new FallbackProvider 2017-09-07 12:55:33 +02:00
Dominik Mostek 4c53fd2bf6 Fallback cause is propagated to fallback provider
Cause can now be propagated to fallback provider in order to respond accordingly to a exception type.
New interface is introduced in order not to break any existing falback providers.
2017-09-07 12:23:37 +02:00
Jin Zhang 885425e2a3 format 'pom.xml' code style (#2257) 2017-09-06 22:26:20 -04:00
Ryan Baxter b74c77b74f Merge pull request #2256 from ryanjbaxter/update-rxjava-version
Update rxjava version
2017-09-06 20:21:12 -04:00
Ryan Baxter 1bc8e8fd3a Update rxjava version. Fixes #2248. 2017-09-06 16:02:04 -04:00
Gregor Zurowski 6dbdb1d8ed Remove commons-lang builders (#2243)
This commit removes usages of commons-lang builders for equals,
hashCode and toString methods.

Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-08-31 19:26:53 -04:00
Tom Cawley ea5585e381 Dynamic filtering on Zuul SimpleRouteLocator.getRoutes()
* Introduce getRoutesMap() so subclasses can have read/write access to configured/discovered routes.
2017-08-31 19:20:33 -04:00
Ryan Baxter ace95a3355 Merge pull request #2240 from gzurowski/remove-lombok-from-docs
Remove Lombok from documentation
2017-08-31 16:47:25 -04:00
Spencer Gibb 019615f376 remove commons.lang.builder 2017-08-31 14:45:48 -06:00
Ryan Baxter a8d40afd58 Merge pull request #2239 from gzurowski/remove-lombok-from-netflix-core
Remove Lombok from spring-cloud-netflix-core module
2017-08-31 16:22:50 -04:00
Marcin Grzejszczak 1e0e078c17 Merge branch 'master' into 2.0.x 2017-08-31 15:01:56 +02:00
Marcin Grzejszczak ebe3800c75 Merge branch '1.3.x' 2017-08-31 15:01:12 +02:00
Marcin Grzejszczak 30b98bea85 Referrencing resources from sc-build 2017-08-31 15:01:05 +02:00
Gregor Zurowski d9738a7ee5 Remove Lombok from documentation
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-08-31 12:15:35 +02:00
Gregor Zurowski d778b938e7 Remove Lombok from spring-cloud-netflix-core module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-08-31 12:01:03 +02:00
Marcin Grzejszczak e7b91c0a85 Merge branch 'master' into 2.0.x 2017-08-29 16:02:26 +02:00
Marcin Grzejszczak 5e9fa908b4 Merge branch '1.3.x' 2017-08-29 15:59:39 +02:00
Marcin Grzejszczak 91808c5fd9 Updated whitelists 2017-08-29 15:57:17 +02:00
Marcin Grzejszczak 0784b1ee19 Migrated to new docs; fixes #2237 2017-08-29 15:54:31 +02:00
Marcin Grzejszczak b3cdd72754 Bumped libs' 2017-08-29 15:54:01 +02:00
Marcin Grzejszczak 9d2964ee7d Merge branch 'master' into 2.0.x 2017-08-29 15:07:14 +02:00
Marcin Grzejszczak 4a8913f7ea Migrated to new docs; fixes #2237 2017-08-29 15:04:32 +02:00
Ryan Baxter 8fbd73af1e Going back to snapshots 2017-08-24 17:54:53 -04:00
Ryan Baxter 1be2b2c295 Update SNAPSHOT to 1.4.0.M1 2017-08-24 17:49:28 -04:00
Ryan Baxter 02778fd670 fixing links in docs 2017-08-24 17:07:42 -04:00
Ryan Baxter 985f014f40 bumping sc-build version 2017-08-24 16:44:46 -04:00
Nastya Smirnova 2a63d07146 Extract getApplications method in CommonsInstanceDiscovery
This allows the ability to override behavior of retrieving configured applications
2017-08-21 13:49:42 -04:00
Ryan Baxter 947d30c5c4 Bumping versions to 1.3.5.BUILD-SNAPSHOT after release 2017-08-18 13:59:32 -04:00
Ryan Baxter e71ce3395d Going back to snapshots 2017-08-18 13:59:31 -04:00
Ryan Baxter f5e7be25dd Update SNAPSHOT to 1.3.4.RELEASE 2017-08-18 13:55:59 -04:00
Ryan Baxter ded32cd66a Merge remote-tracking branch 'origin/master' into 2.0.x 2017-08-18 13:23:04 -04:00
Ryan Baxter c8d024c25f Merge pull request #2213 from ryanjbaxter/deprecation-warnings-for-starters
Adds deprecation warning to starters
2017-08-18 13:21:25 -04:00
Ryan Baxter b519ad8d18 Adds deprecation warning to starters. Fixes #2148. 2017-08-18 12:30:45 -04:00
Ryan Baxter fcb1f5dc54 Bumping versions to 1.3.4.BUILD-SNAPSHOT after release 2017-08-18 07:55:23 -04:00
Ryan Baxter 9b7a2f93ad Going back to snapshots 2017-08-18 07:55:22 -04:00
Ryan Baxter 9ce253b644 Update SNAPSHOT to 1.3.3.RELEASE 2017-08-18 07:51:04 -04:00
Spencer Gibb 5a9d24044f Going back to snapshots 2017-08-17 16:02:06 -06:00
Spencer Gibb b853da673c Update SNAPSHOT to 2.0.0.M2 2017-08-17 15:53:24 -06:00
Ryan Baxter d56b5abde2 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-08-17 14:48:24 -04:00
Ryan Baxter 24cbbb9a11 Merging 1.3.x into master 2017-08-17 14:47:45 -04:00
Ryan Baxter ed57c8f0fa Merge pull request #2208 from ryanjbaxter/document-https-hystrix-dashboard
Document untrusted certificates when connecting to hystrix.stream endpoint
2017-08-17 14:32:52 -04:00
Ryan Baxter 07b99704ee Fixes #1523. Document untrusted certificates when connecting to hystrix.stream endpoint. 2017-08-17 14:02:14 -04:00
Biju Kunjummen 9440e4d153 Fixes #2083. Porting #1916 to the 1.3.x branch. 2017-08-17 12:29:23 -04:00
Spencer Gibb 1e1ade3cbd Merge branch 'master' into 2.0.x 2017-08-16 03:30:47 -06:00
Spencer Gibb 1840647458 Move EurekaClient.close() to EurekaRegistration.close().
This moves the lifecycle of the eureka client of of EurekaServiceRegistry.

fixes gh-2099
2017-08-16 00:53:40 -06:00
Spencer Gibb 7471dcd3bf Merge branch 'master' into 2.0.x 2017-08-10 14:06:42 -06:00
Spencer Gibb c3114e65bf Merge branch '1.3.x' 2017-08-10 13:59:46 -06:00
Spencer Gibb c2aa60f292 Update test of setContentLengthLong to include param.
Otherwise useServlet31 was always returning false.

fixes gh-2196
2017-08-10 13:58:45 -06:00
Spencer Gibb 96fb8d280e Merge branch 'master' into 2.0.x 2017-08-04 14:59:08 -06:00
Spencer Gibb e4e29e1316 Move tests out of default and base package 2017-08-04 14:37:28 -06:00
Biju Kunjummen 63f975ad43 Sync up matching of ignored paths and route paths (#2163)
Signed-off-by: João Salavessa <joao.salavessa@sky.uk>
2017-08-04 15:41:58 -04:00
Olivier Bourgain a01fc5b758 Fix check then act issue (#2160) 2017-08-04 15:40:10 -04:00
Ryan Baxter a3953fba65 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-08-04 11:00:46 -04:00
Ryan Baxter 481e31220b Merge remote-tracking branch 'origin/1.3.x' 2017-08-04 10:57:41 -04:00
Ryan Baxter 040ce4db81 Merge pull request #2177 from repos-jmp/1.3.x
Fixes gh-2125
2017-08-04 10:51:08 -04:00
Ryan Baxter 488075de9b Merge remote-tracking branch 'origin/master' into 2.0.x 2017-08-03 13:18:07 -04:00
Ryan Baxter 8fb89b25d9 Merge pull request #2080 from ryanjbaxter/http-client-centralization
Centralizing HTTP client creation and configuration
2017-08-03 13:02:09 -04:00
Jayanth MP 099c9024bb Fixes gh-2125
(Updated okhttp3 from v3.6.0 to v3.8.1)
2017-08-02 17:24:19 +05:30
Ryan Baxter bd7e75f4b3 Merge remote-tracking branch 'Upstream/master' into http-client-centralization 2017-08-01 16:46:07 -04:00
Ryan Baxter a358764b9a Merge remote-tracking branch 'origin/master' into 2.0.x 2017-07-31 20:53:26 -04:00
Ryan Baxter b3d61a6de7 Removing duplicate install goal 2017-07-31 20:22:45 -04:00
Dave Syer 0bfd86880b Merge branch 'master' into 2.0.x 2017-07-26 12:14:25 +01:00
Dave Syer e5b14e4177 Fix all the start poms to be jars again
They are all deprecated but that's no reason to break them.
2017-07-26 12:13:25 +01:00
Spencer Gibb e9f0112e28 Merge branch 'master' into 2.0.x 2017-07-25 08:58:57 -06:00
Spencer Gibb 0de86d3faf fix hashCode 2017-07-25 08:58:39 -06:00
Gregor Zurowski aa2159b7e5 Remove Lombok from spring-cloud-netflix-eureka-client module (#2131) 2017-07-24 19:07:18 -04:00
Spencer Gibb 894cfc2acd Merge branch 'master' into 2.0.x 2017-07-24 16:22:01 -06:00
Biju Kunjummen 1c30c24639 Replace o.s.b.a.PropertyPlaceholderAuto* with o.s.b.a.context.PropertyPlaceholderAuto* (#2155) 2017-07-24 18:11:20 -04:00
Spencer Gibb 7e37e0dac0 Add commons-logging as a dependency of archaius 2017-07-24 16:07:04 -06:00
Spencer Gibb cd177ab0b1 Merge branch 'master' into 2.0.x 2017-07-24 14:48:15 -06:00
Spencer Gibb cd2ed8eeee Restore turbine stream dependencies. 2017-07-24 14:37:31 -06:00
Spencer Gibb c7a084aa25 Fix versions of new starters 2017-07-21 14:46:35 -06:00
Spencer Gibb 6952d1ab48 Merge branch 'master' into 2.0.x 2017-07-21 14:23:55 -06:00
Spencer Gibb 112a3e27a6 Fix versions of new starters 2017-07-21 14:21:44 -06:00
Daniel Lavoie bbac5a730f Rename starters to include -netflix- (#1886)
Fixes gh-665
2017-07-21 15:59:32 -04:00
Daniel Lavoie 348c96bf13 Optionally remove Jersey dependencies from Eureka Client (#1850)
Fixes gh-1849
2017-07-21 15:55:57 -04:00
Biju Kunjummen fd783734ac Add docs for default ribbon client configuration (#2142)
fixes #1741
2017-07-21 11:45:01 -04:00
Biju Kunjummen fc4f375a65 Restore ignored test - works cleanly for a full build (#2146) 2017-07-21 11:41:10 -04:00
Spencer Gibb 1d6b47ceef Bumping versions to 1.3.3.BUILD-SNAPSHOT after release 2017-07-20 11:39:09 -06:00
Spencer Gibb cda1c876b2 Going back to snapshots 2017-07-20 11:39:08 -06:00
Spencer Gibb 6112ea2558 Update SNAPSHOT to 1.3.2.RELEASE 2017-07-20 11:30:44 -06:00
Spencer Gibb 57ecd0ec10 Merge branch 'master' into 2.0.x 2017-07-20 10:16:47 -06:00
Spencer Gibb 37129671b6 Merge branch '1.3.x' 2017-07-20 10:06:32 -06:00
Spencer Gibb 97f1655ff7 Ensure ordering of feign ribbon client configuration.
On certain platforms and compilers the generated bytecode is not what
the configuration expected. By moving inner classes to the upper level
and using @Import this will guarantee the proper order.

fixes gh-2086
2017-07-20 10:02:05 -06:00
Spencer Gibb 3c409d3bc1 Merge branch 'master' into 2.0.x 2017-07-19 12:18:59 -06:00
Spencer Gibb 1cf509c365 Merge branch '1.3.x' 2017-07-19 12:12:01 -06:00
Spencer Gibb 6b530b0269 Ensure ordering of ribbon client configuration.
On certain platforms and compilers the generated bytecode is not what
the configuration expected. By moving inner classes to the upper level
and using @Import this will guarantee the proper order.

fixes gh-2086
2017-07-19 12:11:07 -06:00
Jayanth e525ab7d64 Hystrix open threshold documentation (#2136)
fixes gh-1943
2017-07-18 17:18:01 -04:00
Spencer Gibb 12c7ae1e05 Merge branch 'master' into 2.0.x 2017-07-18 12:42:59 -06:00
Spencer Gibb 31d19fd51a Remove commons.lang.builder refs 2017-07-18 11:05:05 -06:00
Spencer Gibb 74540e9f4d Merge branch '1.3.x' 2017-07-18 10:57:41 -06:00
Spencer Gibb afc8a99d7e Add @NestedConfigurationProperty to transport.
Needed in `EurekaClientConfigBean` because `CloudEurekaTransportConfig` is a separate class.

Fixes gh-2138
2017-07-18 10:56:41 -06:00
Tummala Dhanvi (c0mrad3) 859a79ad35 Document prefer hostname #2084 (#2092) 2017-07-18 12:39:43 -04:00
Ryan Baxter 130dfb6358 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-07-14 13:46:20 -04:00
Ryan Baxter 6ab27328cc Merge pull request #2128 from gzurowski/remove-lombok-from-eureka-server
Remove Lombok from spring-cloud-netflix-eureka-server module
2017-07-14 13:44:12 -04:00
Gregor Zurowski 72c31ca524 Polish code
- Remove formatter markers
- Use StringBuilder in toString method

Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-14 16:26:04 +02:00
Gregor Zurowski 4d69941593 Remove Lombok from spring-cloud-netflix-eureka-server module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-14 11:49:33 +02:00
Ryan Baxter 91f22b502f Merge remote-tracking branch 'origin/master' into 2.0.x 2017-07-13 09:56:40 -04:00
Ryan Baxter 0d19a55ddd Merge pull request #2120 from gzurowski/remove-lombok-log-from-eureka-client
Remove Lombok logging from spring-cloud-netflix-eureka-client module
2017-07-13 09:36:02 -04:00
Ryan Baxter ceef16f0c8 Merge pull request #2121 from gzurowski/remove-lombok-log-from-eureka-server
Remove Lombok logging from spring-cloud-netflix-eureka-server module
2017-07-13 09:35:38 -04:00
Ryan Baxter 187f34dfee Merge pull request #2122 from gzurowski/remove-lombok-log-from-core
Remove Lombok logging from spring-cloud-netflix-core module
2017-07-13 09:35:09 -04:00
Ryan Baxter 96b1e40c0a Merge pull request #2123 from gzurowski/fix-maven-warnings
Fix Maven warnings about missing plugin versions
2017-07-13 09:34:09 -04:00
Gregor Zurowski 63d77a8b81 Fix Maven warnings about missing plugin versions
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-13 09:38:53 +02:00
Gregor Zurowski 8022342e81 Remove Lombok logging from spring-cloud-netflix-eureka-server module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-13 09:21:32 +02:00
Gregor Zurowski 6379e15ce1 Remove Lombok logging from spring-cloud-netflix-eureka-client module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-13 09:20:29 +02:00
Gregor Zurowski 5b075623ff Remove Lombok logging from spring-cloud-netflix-core module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-13 08:48:56 +02:00
Marco Schulte 46cbaa053c Fixed NPE if origin is unset (#2100) 2017-07-12 15:41:32 -04:00
Ryan Baxter 0a423fc433 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-07-12 11:14:27 -04:00
Ryan Baxter ffc33b4c69 Merge pull request #2105 from gzurowski/routes-endpoint-details
Provide more Zuul route details in the routes actuator endpoint
2017-07-12 10:47:49 -04:00
Ryan Baxter 1d3773ab5e Merge pull request #2111 from gzurowski/remove-lombok-from-turbine-stream
Remove Lombok from spring-cloud-netflix-turbine-stream module
2017-07-12 10:35:48 -04:00
Ryan Baxter a968b4bec8 Merge pull request #2112 from gzurowski/remove-lombok-from-turbine
Remove Lombok from spring-cloud-netflix-turbine module
2017-07-12 10:35:06 -04:00
Ryan Baxter 65902d11e4 Merge pull request #2113 from gzurowski/remove-lombok-from-sidecar
Remove Lombok from spring-cloud-netflix-sidecare module
2017-07-12 10:34:12 -04:00
Ryan Baxter 050dc31c97 Merge pull request #2114 from gzurowski/remove-lombok-from-hystrix-dashboard
Remove Lombok from spring-cloud-netflix-hystrix-dashboard module
2017-07-12 10:33:29 -04:00
Gregor Zurowski aae96faa76 Remove Lombok from spring-cloud-netflix-hystrix-dashboard module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-11 23:25:05 +02:00
Gregor Zurowski 0dea44acf4 Remove Lombok from spring-cloud-netflix-turbine module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-11 23:14:40 +02:00
Gregor Zurowski b158f6f2b7 Remove Lombok from spring-cloud-netflix-turbine-stream module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-11 23:00:18 +02:00
Ryan Baxter 11da3d4e3c Merge remote-tracking branch 'Upstream/master' into http-client-centralization 2017-07-11 16:48:19 -04:00
Gregor Zurowski 5f4fc247a4 Remove Lombok from spring-cloud-netflix-sidecare module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-11 22:39:15 +02:00
Ryan Baxter 78ba3c5394 Cleanup and code review fixes. 2017-07-11 14:49:44 -04:00
Gregor Zurowski 781fa3ea0c Add documentation about the detailed output of the routes endpoint
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-11 15:56:13 +02:00
Gregor Zurowski a08b661af6 Remove usage of Lombok
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-11 10:38:51 +02:00
Spencer Gibb 068b236eba fix compilation error 2017-07-10 11:54:27 -06:00
Ryan Baxter 726fa3910d Merge remote-tracking branch 'origin/master' into 2.0.x 2017-07-10 13:34:37 -04:00
Ryan Baxter d0009ba05a Merge pull request #2087 from brenuart/gh1534
React on ContextClosedEvent only if from "our" context
2017-07-10 13:33:39 -04:00
Ryan Baxter e2a19ce086 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-07-10 11:49:57 -04:00
Ryan Baxter ab9b5ba3ec Merge pull request #2104 from gzurowski/use-filter-constants
Use filter constants where appropriate
2017-07-10 11:49:06 -04:00
Ryan Baxter 3b4ed6c0a4 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-07-10 11:42:06 -04:00
Ryan Baxter 70d39aae7b Merge pull request #2107 from yongsungyoon/fix-compile-error-on-ejc
Fix compilation problem on eclipse java compiler
2017-07-10 11:39:04 -04:00
Ryan Baxter 56ccc46f5f Added documentation 2017-07-09 15:26:24 -04:00
Ryan Baxter ff33905704 Updating property names 2017-07-09 14:21:10 -04:00
Ryan Baxter 69739420fa Takes advantage of new builder pattern. Also reverted elimination of properties for feign and ribbon. 2017-07-09 13:39:04 -04:00
Yongsung Yoon 2b593bc742 Fix compilation problem on eclipse java compiler 2017-07-10 00:36:07 +09:00
Gregor Zurowski eb1b7baf1c Provide more Zuul route details in the routes actuator endpoint
Add a parameter to control the level of details returned with the
routes actuator endpoint. If requested, return all available Zuul route
details including ID, prefix, sensitive headers, etc.

Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-08 22:40:39 +02:00
Gregor Zurowski 05eef0e8f5 Use filter constants
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-07 22:16:11 +02:00
Eko Kurniawan Khannedy c2c634707e FeignClient Configuration Properties (#1942)
* add feign client properties

* configure feign builder from properties if exists

* change string config to class config and add unit test for feign client using configuration properties

* refactoring and add primary flag configuration

* add decode404 in feign client configuration properties

* change unit test properties decode404 to true

* remove lombok from FeignClientProperties and change primary attribute to default-to-properties

fixes gh-1931
2017-07-07 15:31:56 -04:00
Biju Kunjummen 0579b326be Support for re-writing Location Headers (#1863)
* Support for re-writing Location Headers

* Added additional constructor for Route, removed auto-configuration of LocationRewriteFilter

* Polished docs, more tests
2017-07-07 15:21:44 -04:00
Gregor Zurowski 70a26fec26 Use static import for constants (#2103)
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-07 14:35:49 -04:00
Ryan Baxter 02ec9bb98e Merge remote-tracking branch 'Upstream/master' into http-client-centralization 2017-07-07 10:54:08 -04:00
Ryan Baxter b2f608b884 OK HTTP Client changes 2017-07-07 10:10:53 -04:00
Gregor Zurowski a496dc8170 Use constant utility classes instead of constant interfaces (#2081)
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2017-07-06 12:01:26 -04:00
Bertrand Renuart 8ad15399d6 React on ContextClosedEvent only if originating from "our" context (not another like a child) 2017-07-03 15:52:01 +02:00
Yongsung Yoon 8e11514e7c Add options for RibbonCommand to use separate thread pools for hystrix (#2074)
* Add options for RibbonCommand to use separate thread pools for hystrix

* Remove lombok annotation and Add getter/setter for ZuulProperties$HystrixThreadPool

* Add doc about how to configure hystrix thread pools in Zuul Developer Guide

* Add testcases for HystrixThreadPoolKey of RibbonCommand

* Tiny change about if block in AbstractRibbonCommand
2017-06-30 20:03:52 -04:00
Spencer Gibb 89cb5573d9 bump commons to 1.3.0ˆ 2017-06-30 17:33:57 -06:00
Spencer Gibb 23ebd6ac08 Merge branch 'master' into 2.0.x 2017-06-30 17:12:10 -06:00
Spencer Gibb 5856d76e65 Merge branch '1.3.x' 2017-06-30 17:11:18 -06:00
Spencer Gibb 86b1f6ede3 Make aspect method public
fixes gh-2063
2017-06-30 17:10:27 -06:00
Spencer Gibb 68f13c4985 Going back to snapshots 2017-06-28 10:40:29 -06:00
Spencer Gibb 3f4783dfab Update SNAPSHOT to 2.0.0.M1 2017-06-28 10:38:12 -06:00
Spencer Gibb 03df8cbf43 remove rxjava mvc documentation.
this is now handled by spring-framework
2017-06-28 10:32:02 -06:00
Ryan Baxter 572305d7c8 Fixing code formatting 2017-06-28 12:00:11 -04:00
Ryan Baxter 2aa93abc0f Centralizing HTTP client creation and configuration 2017-06-28 11:43:52 -04:00
Ryan Baxter 0be3d23369 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-06-20 13:27:13 -04:00
Ryan Baxter e2954d0117 Merge pull request #2059 from brandon-atkinson/gh-2042
Rename *Test.java -> *Tests.java. Fixes #2042
2017-06-20 10:49:11 -04:00
Brandon Atkinson 497b95ec64 Rename *Test.java -> *Tests.java. Fixes #2042 2017-06-19 20:41:54 -04:00
Ryan Baxter 02e7594de5 Bumping s-c-stream to Ditmars 2017-06-19 14:06:44 -04:00
Ryan Baxter 7efa68e853 Merge remote-tracking branch 'origin/1.3.x' 2017-06-19 14:05:29 -04:00
Ryan Baxter 003fefa61d Bumping release version 2017-06-19 14:04:29 -04:00
Ryan Baxter 619580afe5 Merge remote-tracking branch 'origin/master' into 2.0.x 2017-06-16 12:31:00 -04:00
Ryan Baxter 5c035768b0 Merge remote-tracking branch 'origin/1.3.x' 2017-06-16 11:51:09 -04:00
Ryan Baxter 9a878b0fbd Merge pull request #2044 from bright/override_all_hystrix_concurrency_strategy_methods
Override getThreadPool from HystrixConcurrencyStrategy and delegate to
2017-06-16 11:27:06 -04:00
Piotr Mionskowski 779b026e6b Override getThreadPool from HystrixConcurrencyStrategy and delegate to
existing strategy if present. Fixes #2035
2017-06-15 06:06:58 +02:00
Ryan Baxter ccae4e4ce2 Bumping s-c-config version to 1.4.0 2017-06-14 16:40:48 -04:00
Dave Syer a7675470ab Merge branch 'master' into 2.0.x 2017-06-13 14:21:59 +01:00
Dave Syer d39a22945b Merge branch '1.3.x' 2017-06-13 13:58:08 +01:00
Dave Syer aac7799e3e Clean up Zuul context in all tests 2017-06-13 13:57:16 +01:00
Dave Syer 63b2916993 Merge branch 'master' into 2.0.x 2017-06-12 16:16:54 +01:00
Dave Syer 310f558e9c Merge branch '1.3.x' 2017-06-12 16:15:44 +01:00
Dave Syer 1a0428da97 Merge branch '1.3.x' 2017-06-12 15:52:24 +01:00
Dave Syer 4783b07407 Support for multi-valued (batched) events in stream aggregator
This allows clients to send batched up events in the same format as
before (or to continue to send single events). We can switch the
default format to an array in 1.4.x.
2017-06-12 15:44:35 +01:00
André Dörnbrack 0334c5a289 Cleanup. Cherry picking #2031. 2017-06-09 12:42:12 -04:00
André Dörnbrack 12a9a2e485 code cleanup 2017-06-09 12:34:04 -04:00
Ryan Baxter 7f7cdccb6b Merge remote-tracking branch 'origin/master' into 2.0.x 2017-06-09 12:31:44 -04:00
Ryan Baxter f9424231a9 Merge pull request #2031 from doernbrackandre/fix_whitespaces_in_retryable_status_codes_list
fixes a problem with whitespaces in list of retryable status codes
2017-06-09 12:00:38 -04:00
Dave Syer d4ba70db5c Merge branch '1.3.x' 2017-06-09 13:31:17 +01:00
Dave Syer a59f5e1c4f Clean up some resources to keep tests running 2017-06-09 13:24:57 +01:00
André Dörnbrack 02316d4ee0 Merge branch 'fix_whitespaces_in_retryable_status_codes_list' of github.com:doernbrackandre/spring-cloud-netflix into fix_whitespaces_in_retryable_status_codes_list 2017-06-09 13:39:44 +02:00
André Dörnbrack 4f148de74d code cleanup 2017-06-09 13:37:56 +02:00
André Dörnbrack 9f10d5207f fixes a problem with whitespaces in list of retryable status codes 2017-06-09 10:12:24 +02:00
Ryan Baxter 484bde10b3 Adding 404 to list of retryable status codes 2017-06-08 16:18:11 -04:00
Ryan Baxter 8281757da8 Add path to try and fix intermittent failures with RetryableZuulApplicationTests pass 2017-06-08 15:43:15 -04:00
Ryan Baxter 4e25e2eb81 Revert "Trying a plain RestTemplate in an attempt to fix intermittent test failures."
This reverts commit f552426304.
2017-06-08 15:34:57 -04:00
Ryan Baxter f552426304 Trying a plain RestTemplate in an attempt to fix intermittent test failures. 2017-06-08 15:16:03 -04:00
Spencer Gibb c046901d8f spring 5 updates 2017-06-08 12:32:52 -06:00
Spencer Gibb 3bfc90a8bb Merge branch 'master' into 2.0.x 2017-06-08 12:19:43 -06:00
Spencer Gibb 15295dd294 Merge remote-tracking branch 'origin/master' 2017-06-08 12:18:45 -06:00
Ryan Baxter 1405a1894b Closing response in Feign load balancer 2017-06-08 13:48:56 -04:00
Ryan Baxter a1c8cfe967 Close response when retry on certain status codes. Fixes #1970. 2017-06-08 13:48:56 -04:00
Ryan Baxter f0b424c84f Merge pull request #2021 from ryanjbaxter/response-code-retry-close-wait
Close response when retry on certain status codes
2017-06-08 13:47:27 -04:00
Spencer Gibb 582746587b Merge branch '1.3.x' 2017-06-08 11:35:45 -06:00
Spencer Gibb a69fe71406 Make archaius highest priority auto-configuration. 2017-06-08 11:35:05 -06:00
Spencer Gibb 13155ce64c Upgrade eureka to v1.7.0
fixes gh-2028
2017-06-07 13:14:07 -06:00
Jin Zhang c5d95ca805 SendErrorFilter: put response code into RequestContext, keep consistent with normal cases (#2004) 2017-06-07 12:06:35 -04:00
Spencer Gibb 52ee7c8700 Boot 2.0 compatibility fixes 2017-06-06 10:56:13 -06:00
Spencer Gibb cfb314198a merge fixes 2017-06-06 10:55:52 -06:00
Spencer Gibb 74ff65954f Merge branch 'master' into 2.0.x 2017-06-06 09:59:55 -06:00
Ryan Baxter 0b2fc81be4 Closing response in Feign load balancer 2017-06-06 10:44:42 -04:00
Spencer Gibb 9e180b8ba7 Merge branch '1.3.x' 2017-06-05 16:41:57 -06:00
Spencer Gibb e08a6e8a48 Move zuul host routing timeouts to boot properties.
Previously, these were managed directly via archaius, but due to
some combination of changes in boot 1.5.x (likely a tomcat change as
zuul filters were initialzed in a servlet context listener) and Dalston,
The filter was created before archaius could be initialized.

The properties are backwards compatible and are in the
`ZuulProperties.Host` object.

fixes gh-1950
2017-06-05 16:40:12 -06:00
Ryan Baxter 7d06c140fa Close response when retry on certain status codes. Fixes #1970. 2017-06-05 14:36:49 -04:00
Ryan Baxter d914406c84 Merge pull request #2000 from rpahli/master
use only default https ports for https check
2017-06-01 20:08:10 -04:00
Biju Kunjummen 31a3ff61e8 GH-1916: Spring Boot Auto-configuration based Zuul Server and Proxy (#1951) 2017-06-01 15:12:42 -04:00
Spencer Gibb 3773047a06 Bump to version 1.4.0.BUILD-SNAPSHOT 2017-06-01 12:50:57 -06:00
Spencer Gibb 72b7ee2480 Merge remote-tracking branch 'origin/2.0.x' into 2.0.x 2017-06-01 12:35:05 -06:00
pahli a1d089038d make property injection optional 2017-05-31 23:55:17 +02:00
Ryan Baxter 562e604cee Merge pull request #2002 from ryanjbaxter/deprecate-RetryableStatusCodeException
Deprecates RetryableStatusCodeException
2017-05-31 16:33:58 -04:00
pahli 71c906b00b add private accessor 2017-05-31 22:33:10 +02:00
pahli 6d22a407cc use @ConfigurationProperties 2017-05-31 22:25:51 +02:00
pahli bdfbe3a87e make secure ports for DefaultServerIntrospector configurable 2017-05-31 22:09:35 +02:00
Ryan Baxter 18ec564249 Fixing typo 2017-05-31 14:36:12 -04:00
Ryan Baxter cb3613db71 Fixing typo 2017-05-31 14:35:38 -04:00
Ryan Baxter 7dbfe15d1a Deprecates RetryableStatusCodeException in favor of the same class in s-c-commons 2017-05-31 14:22:15 -04:00
Spencer Gibb 92277a01ac Merge branch 'master' into 2.0.x 2017-05-31 11:39:19 -06:00
Rico Pahlisch ccf8f86c8d use only default https ports for https check
spring boot uses all high ports and there are some trouble if ports end with 443 (e.g. 24443, ...)
2017-05-31 12:04:09 +02:00
Spencer Gibb 7425f974cb Adds timeout test.
see gh-1950
2017-05-25 14:51:58 -06:00
Spencer Gibb 73f3345638 Fix tests 2017-05-25 12:37:34 -06:00
Spencer Gibb 302f805295 Fix compilation issues 2017-05-25 10:49:29 -06:00
Spencer Gibb 58e62ebd06 Bumping versions to 1.3.2.BUILD-SNAPSHOT after release 2017-05-22 12:18:04 -06:00
Spencer Gibb 0de72d2dad Going back to snapshots 2017-05-22 12:18:03 -06:00
Spencer Gibb 7898ad772b Update SNAPSHOT to 1.3.1.RELEASE 2017-05-22 12:09:31 -06:00
Spencer Gibb 25a1881127 Ignore feign.hystrix.enabled.
Let SecurityContextConcurrencyStrategy be installed as the hystrix
concurrency strategy regardless of if feign's hystrix support is installed.

fixes gh-1969
2017-05-22 09:47:49 -06:00
Spencer Gibb 34350cb7ec Merge branch 'strelok1-master' 2017-05-19 19:00:24 -06:00
Roman Rodov e130ec03ad Add management.context-path to status & health url
fixes gh-1795
2017-05-19 18:59:37 -06:00
Spencer Gibb 0cd544b4ce Merge branch 'lalib-gh-1720' 2017-05-19 18:22:26 -06:00
balp 6362be8196 Adds ability to customize simple host conn pool
The timeToLive and timeUnit parameters added to configure connection pool.

Fixes gh-1720
2017-05-19 18:22:04 -06:00
Biju Kunjummen aa4d9d62bc Test for validating that local service instance resolves for hystrix metrics (#1922) 2017-05-19 18:40:49 -04:00
Spencer Gibb cd44a52084 Update feign to 9.5.0
fixes gh-1956
2017-05-16 21:07:19 -06:00
Spencer Gibb 98fd3c7379 Upgrade Hystrix to v1.5.12
fixes gh-1955
2017-05-16 19:52:41 -06:00
Spencer Gibb 7cfbcbd9e2 fix compile/test issues related to boot 2.0 changes 2017-05-16 19:43:01 -06:00
Luke Tornquist 73b5609e63 Allow easier subclassing of SimpleRouteLocator
Fixes gh-1598
2017-05-15 14:48:15 -04:00
Jin Zhang fe06370aa2 correct comments in FeignClient, SendResponseFilter, RibbonRoutingFilter (#1935) 2017-05-15 13:44:14 -04:00
Spencer Gibb a1b1a7d702 Moves EurekaHealthIndicator creation to auto config.
Fixes a race condition introduced in 1.3.0

fixes gh-1933
2017-05-15 10:04:31 -06:00
Ryan Baxter ccdf0d9f95 Removing duplicate and incorrect dependency. Fixes #1941. 2017-05-15 10:48:39 -04:00
Ryan Baxter 8d1a82f9b4 Merged some commits and fixed compile issues 2017-05-12 12:21:47 -04:00
Ryan Baxter 287ce9c0ff Merge pull request #1877 from yongsungyoon/master
Add @Component for Feign Hystrix Fallback example in doc
2017-05-11 11:40:39 -04:00
윤용성(Yongsung Yoon)/개발혁신팀/SKP b8ed846247 Update docs to indicate the need of declaring feign's fallback implementation as a Spring bean 2017-05-11 11:29:59 +09:00
Ryan Baxter 2a9a62d0f6 Merge pull request #1926 from TheSentinel454/issues_1676_wildcard_type_support
Add support for Wildcard Types in Feign Client.  Fixes gh-1676
2017-05-10 16:04:38 -04:00
Dave Syer 16dc2f63f1 Merge master 2017-05-10 11:40:28 +01:00
Dave Syer 377bccf12a Update to latest cloud dependencies 2017-05-10 11:37:53 +01:00
Dave Syer 030a8e7111 Remove Lombok from hystrix stream 2017-05-10 11:09:15 +01:00
Luke Tornquist 189d926c6a Correct import order 2017-05-09 16:10:08 -04:00
Luke Tornquist d993fe217c Format using provided Eclipse formatter. 2017-05-09 13:20:01 -04:00
Luke Tornquist 8983c9bce1 Add support for Wildcard Types in Feign Client. Fixes gh-1676 2017-05-09 13:16:12 -04:00
Dave Syer ced1f36d19 bump spring cloud build version 2017-05-05 17:16:18 +01:00
Ryan Baxter e698fa664b Cherry Picking #1910 2017-05-04 11:55:26 -04:00
Ryan Baxter ab2cf59bf6 Merge pull request #1907 from spccold/zuul-filter-bugfix
change HttpServletResponse to HttpServletRequest
2017-05-03 09:53:17 -04:00
Ryan Baxter a315ac9e54 Merge pull request #1906 from lowzj/master-removeUnusedImport
polish FeignLoadBalancer, remove unused import statement
2017-05-02 10:05:06 -04:00
wuwo c6347ec9c8 change HttpServletResponse to HttpServletRequest 2017-05-02 17:26:42 +08:00
lowzj ac8379af29 polish FeignLoadBalancer, remove unused import statement 2017-05-02 17:13:41 +08:00
Dave Syer 69622e909b Fix typo in test method name 2017-04-27 10:29:59 +01:00
Biju Kunjummen 910167de09 Ribbon based on Eureka disabled, if Eureka client is not enabled (#1892)
Ribbon client configuration based on Eureka is disabled if eureka.client.enabed is set to false.

Fixes gh-335
2017-04-26 14:45:35 -04:00
Ryan Baxter 29fb58de84 Merge pull request #1884 from ryanjbaxter/pass-config-in-retryhandler
Pass config in retry handler
2017-04-24 20:05:29 -04:00
Ryan Baxter dbf17dea18 Pass config in retry handler. Fixes #1879. 2017-04-24 14:09:04 -04:00
Ryan Baxter 7fcbc0fd5a Merge pull request #1880 from daniellavoie/mvn-3.5.0
Update mvnw to 3.5.0
2017-04-24 10:56:37 -04:00
Daniel Lavoie 32c79b7a91 Update mvnw to 3.5.0
Fixes gh-1847
2017-04-23 16:27:06 +02:00
Ryan Baxter 1647fc3017 Merge pull request #1876 from ryanjbaxter/upgrade-hystrix-1.5.11
Upgrade Hystrix to 1.5.11 and apply fix to hystrixcommand.js
2017-04-20 16:30:09 -04:00
Ryan Baxter 17f43fd138 Fixes #1855 2017-04-20 15:12:57 -04:00
Ryan Baxter a708ceefe8 Merge pull request #1870 from ryanjbaxter/force-eurekaclient-creation-on-refresh
Make sure the EurekaClient bean is recreated after refresh.
2017-04-20 14:53:03 -04:00
Ryan Baxter 1f12902f78 Make sure the EurekaClient bean is recreated after refresh. Fixes #1857. 2017-04-19 11:29:33 -04:00
Spencer Gibb cebbcf592e polish 2017-04-18 12:23:56 -06:00
Ryan Baxter 0c7994c502 We no longer use travis so removing configuration
Fixes #1846.
2017-04-11 13:45:57 -04:00
Ryan Baxter d412df5883 Merge pull request #1808 from gonzalad/1807
Add X-Forwarded-Port header in Zuul
2017-04-10 20:17:02 -04:00
Ryan Baxter cca3744396 Bumping versions to 1.3.1.BUILD-SNAPSHOT after release 2017-04-07 06:12:17 -04:00
Ryan Baxter c98c50291c Going back to snapshots 2017-04-07 06:12:16 -04:00
Ryan Baxter e9035ab3e0 Update SNAPSHOT to 1.3.0.RELEASE 2017-04-07 06:10:01 -04:00
Ryan Baxter d8eb4432b9 Updating mvnw script 2017-04-07 06:04:35 -04:00
Spencer Gibb e430b90cea Updates to compile 2017-04-06 21:54:06 -06:00
Spencer Gibb 08a1f07692 Merge branch 'master' into 2.0.x 2017-04-06 21:30:03 -06:00
Ryan Baxter 8dcf544079 Merge pull request #1836 from ryanjbaxter/response-code-retry
Add the ability for ribbon clients to specify response status codes they would like to retry
2017-04-05 14:01:15 -04:00
Ryan Baxter 98cbf2f47f Merge pull request #1840 from ryanjbaxter/document-hystrix-timeout
Document Hystrix timeout configuration with Ribbon clients
2017-04-05 13:46:50 -04:00
Ryan Baxter e041d87b5a Document Hystrix timeout configuration with Ribbon clients. Fixes #1828 2017-04-05 13:44:42 -04:00
Spencer Gibb 5440aca212 Merge pull request #1829 from Aloren/feature/exceptions-monitoring
* feature/exceptions-monitoring:
  Implements zuul CounterFactory
2017-04-05 11:33:40 -06:00
Anastasiia Smirnova 834980eae7 Implements zuul CounterFactory
CounterFactory is used by ZuulException and was previously initialzed
with a dummy impl.

This adds a Spring Boot CounterService based implementation.

Also adds the ability to implement a zuul TracerFactory.
2017-04-05 11:33:29 -06:00
David-V2 a61822f9c9 Added Bad Request count to Hystrix dashboard (#1839)
* brainlessly apply this : https://github.com/Netflix/Hystrix/commit/892f6a781e67f153b0bf2f7387c87ca0721955c2
2017-04-05 12:00:14 -04:00
Ryan Baxter 6290859f81 Add the ability for ribbon clients to specify response status codes they would like to retry. Fixes #1540. 2017-04-04 15:34:08 -04:00
Spencer Gibb 62408af5ea Don't set chunked encoding with GET.
fixes gh-1824
2017-04-03 14:04:07 -06:00
Ryan Baxter 711a8f0aae Merge pull request #1817 from ryanjbaxter/use-valid-hostnames-in-feign-tests
Use valid hostnames in feign tests
2017-03-28 14:31:41 -04:00
Ryan Baxter 382988a06a Fixed hostname 2017-03-28 09:48:41 -04:00
Ryan Baxter 88431bdbea Use valid hostnames in Feign retry tests 2017-03-28 09:46:16 -04:00
Ryan Baxter 62cb0ae28f Change /routes endpoint to use EndpointMvcAdapter and AbstractEndpoint (#1802)
Change /routes endpoint to use EndpointMvcAdapter and AbstractEndpoint.  

Fixes #1797
2017-03-24 16:27:41 -04:00
gonzalad 31f5a2bb73 1807: Add X-Forwarded-Port header in Zuul
Added more unit tests
2017-03-24 19:20:06 +01:00
gonzalad cb90cd9929 Add X-Forwarded-Port header in Zuul
Add X-Forwarded-Port header in Zuul PreDecorationFilter
even with X-Forwarded-Host header being absent.
2017-03-24 16:28:09 +01:00
Ryan Baxter d402587ab2 Merge pull request #1805 from ryanjbaxter/url-protocal-el-syntax
Fixes the addition of http with EL syntax
2017-03-23 16:12:04 -04:00
Ryan Baxter 02226f938e Fixes the addition of http with EL syntax. Fixes #1796 2017-03-23 15:00:55 -04:00
Spencer Gibb 37309218ec Links to sample zuul filters.
For more advanced filter examples.

fixes gh-1748
2017-03-23 12:40:41 -06:00
Michael Tecourt 03740f1369 Make EurekaDiscoveryClient.EurekaServiceInstance constructor public (#1794)
Make EurekaDiscoveryClient.EurekaServiceInstance constructor public

fixes gh-1792
2017-03-23 14:23:25 -04:00
Ryan Baxter d3314447a8 Fixed logging statement. Fixes #1798 2017-03-20 10:58:50 -04:00
Spencer Gibb 4b4bfbe1b1 Make compile for boot 2.0 2017-03-17 21:02:56 -06:00
Spencer Gibb a8b170f51c Upgrade eureka to v1.6.2
fixes gh-1786
2017-03-16 14:47:08 -06:00
Ryan Baxter a669a309f6 Revert "Version changes for Dalston.RC1"
This reverts commit a628ba1b8f.
2017-03-16 13:31:53 -04:00
Ryan Baxter a628ba1b8f Version changes for Dalston.RC1 2017-03-16 11:59:46 -04:00
Ryan Baxter 5bf87c4da1 Merge pull request #1749 from bijukunjummen/GH-1334
GH-1334: Support for eagerly initializing zuul Ribbon contexts
2017-03-15 11:46:34 -04:00
Spencer Gibb b7c5b24d43 comment out failing test 2017-03-14 20:06:07 -06:00
Spencer Gibb 44bb4f2cc3 Move load balancer construction test 2017-03-14 19:01:43 -06:00
Spencer Gibb 55a58eaf30 jmx=false for tests 2017-03-14 18:49:12 -06:00
Spencer Gibb 5d3ca843b6 jmx=false for tests 2017-03-14 18:25:44 -06:00
Spencer Gibb ecf12aa0e7 Makes ServerListUpdater respect configuration.
By default, `LoadBalancerBuilder` built a load-balancer with a `PollingServerListUpdater`. This change introduces a `ServerListUpdater` bean which creates a `PollingServerListUpdater(IClientConfig)` so that `ribbon.ServerListRefreshInterval` is respected.

 fixes gh-1304
2017-03-14 12:24:38 -06:00
Biju Kunjummen 427770a6d0 Added documentation, changed property name from serviceIds to clienNames, clients 2017-03-14 04:48:43 -05:00
Biju Kunjummen 2d9604918a Changed property name from zuul.ribbon.eager-load to zuul.ribbon.eager-load.enabled 2017-03-14 04:36:10 -05:00
Biju Kunjummen 567a6c4a9f Support for eagerly loading Ribbon clients through configuration properties 2017-03-14 04:36:10 -05:00
Biju Kunjummen 31b617b10f Fixed formatting issues, added more tests 2017-03-14 04:36:10 -05:00
Biju Kunjummen a6fe648a41 GH-1334: Support for eagerly initializing zuul Ribbon named client contexts 2017-03-14 04:36:10 -05:00
Ryan Baxter 66163bee2b Merge pull request #1771 from jh409/patch-1
Update docs as @Autowired fails with many beans
2017-03-13 12:07:03 -04:00
Jack Harris db7d352c97 Update docs as @Autowired fails with many beans
Fix a suspected typo. @Autowired throws a `NoUniqueBeanDefinitionException` if there are multiple beans of the same type without a primary, but the documentation said multiple beans 'cause `@Autowired` to work', rather than 'not work'.
2017-03-13 00:19:57 +00:00
Spencer Gibb cda92f4ba3 Upgrade Hystrix to v1.5.10
fixes gh-1766
2017-03-08 19:57:04 -07:00
Ryan Baxter 133613aeb1 Merging #1762 into master 2017-03-08 10:51:33 -05:00
Spencer Gibb 15e01dfe5d Don't remove content-length header in feign ribbon.
Previously, when feign used the Ribbon RestClient, an exception was thrown if Content-Length was set. Over time, feign has moved away from RestClient, yet removing the header still happened.

 Fixes gh-1705
2017-03-06 20:11:03 -07:00
Spencer Gibb 6df7190472 Update docs for REQUEST_URI_KEY in zuul 2017-03-03 15:19:10 -07:00
Spencer Gibb 5212d138f8 Upgrade okhttp3 to 3.6.0
Also add com.squareup.okhttp3:logging-interceptor dependency management.

fixes gh-1752
2017-03-03 09:01:11 -07:00
Bertrand Renuart 465582d20c Make sure MetricsRestTemplateAspectConfiguration is applied in time.
`MetricsRestTemplateConfiguration` creates a BeanPostProcessor used to configure RestTemplate instances when added to the application context. It should be made @ConditionalOnClass(RestTemplate) instead of @ConditionalOnBean(RestTemplate) since it should be present *before* any RestTemplate bean instance is created. (#1747)

fixes gh-1153
2017-03-02 10:32:04 -05:00
Bertrand Renuart fae60e9fae Remove unused registry private field. (#1746)
fixes gh-1745
2017-03-02 10:14:31 -05:00
Ryan Baxter c89645e069 Merge pull request #1743 from ryanjbaxter/disable-hystrix-feign
Disable Hystrix support when using Feign by default
2017-03-01 16:33:34 -05:00
Ryan Baxter 6465cf4f3e Added warning to the docs about the change in default behavior. 2017-03-01 13:15:11 -05:00
Ryan Baxter 54c052c5eb Disable Hystrix support when using Feign by default. Fixes #1277. 2017-03-01 11:35:08 -05:00
nick-pww 465b8273eb Clarify @FeignClient alias creation
fixes gh-1073
2017-02-28 15:02:15 -05:00
windinn 129e0ce4b5 Use prefer-ip-address in statusPageUrlPath
prefer-ip-address does not work in statusPageUrlPath when management port != server port

This change gets `prefer-ip-address` via a relaxed property resolver to set the value during the creation of the `EurekaInstanceConfigBean`.

fixes gh-1724
2017-02-28 13:07:43 -05:00
Spencer Gibb 309b280d0d Log warning if local instance fails.
If DiscoveryClient.getLocalServiceInstance() throws an exception (ie consul isn't available), log a warning and continue. This is useful for dev type environments.

fixes gh-1603
2017-02-28 10:26:15 -07:00
Biju Kunjummen 99d9b17a2d Moves EurekaServerConfiguration to auto-configuration
Eureka ServerConfiguration is now auto-configuration based, instead of being explicitly specified via configuration pulled in through @EnableEurekaServer. This way specific beans can be conditionally overridden, configuration can be re-ordered.
Supports PeerEurekaNodes bean to be overridden by the user

Fixes gh-1717
2017-02-28 12:00:29 -05:00
Ryan Baxter 208a741823 Merge pull request #1732 from utsman/master
Refactor ZoneUtils class
2017-02-27 09:40:49 -05:00
utsman c953d59b5a Refactor ZoneUtils class 2017-02-26 01:45:31 +09:00
Spencer Gibb c0fefc4d1a Update feign to version 9.4.0
fixes gh-1731
2017-02-24 15:05:42 -07:00
Ryan Baxter 0fcc979fe1 Merge pull request #1730 from utsman/rm-dupl-check
Remove duplicate null check
2017-02-24 14:05:26 -05:00
utsman cb9d9bd8a1 Remove duplicate null check 2017-02-25 03:13:24 +09:00
Ryan Baxter 1d5a68c9e7 Merge pull request #1728 from utsman/fix-typo
Fixed typo
2017-02-24 10:07:23 -05:00
utsman 8e3f45b899 Fixed typo 2017-02-24 23:30:39 +09:00
Ryan Baxter ea87b9bfc2 Merge branch 'master' of https://github.com/spring-cloud/spring-cloud-netflix 2017-02-20 15:56:50 -05:00
Ryan Baxter df91ff7735 using apache commons logger 2017-02-20 15:56:37 -05:00
Spencer Gibb 652fe97a1b fix logger 2017-02-20 13:54:54 -07:00
Ryan Baxter 06565765b8 removing unused imports 2017-02-20 14:25:50 -05:00
Ryan Baxter fc9c7dcdfc clearing context during setup 2017-02-20 13:39:06 -05:00
Ryan Baxter 72f1ce9096 added logging to test 2017-02-20 11:18:31 -05:00
Ryan Baxter 0abf69dc1d Merge pull request #1709 from ryanjbaxter/make-feign-retry-optional
Make the use of Spring Retry optional when using Feign
2017-02-17 18:25:28 -05:00
Ryan Baxter a4f30ebf1d Make the use of Spring Retry optional when using Feign. Fixes #1708 2017-02-17 11:12:12 -05:00
Tomasz Juchniewicz ed137a93ce Fix encoding issue in SpringEncoder for binary data (#1699)
* Fix encoding issue in SpringEncoder for binary data

Fixes gh-1698

* Fix encoding issue in SpringEncoder for binary data

Fixes gh-1698

* Fix encoding issue in SpringEncoder for binary data

Add unit test.

Fixes gh-1698
2017-02-16 14:52:15 -05:00
Lars e73ee5f690 Refactors zuul tests for better readability. (#1686)
* Refactors tests for better readability. Polishes imports. Removes hostname and port from TestRestTemplate-calls. Introduces @LocalServerPort
2017-02-16 12:48:48 -05:00
Ryan Baxter de886d6c3d Merge branch 'master' of https://github.com/spring-cloud/spring-cloud-netflix 2017-02-15 20:09:27 -05:00
Ryan Baxter 050d5f898f Porting changes that remove RetryTemplate from FeignLoadBalancer constructor from 1.2.x branch 2017-02-15 20:09:15 -05:00
Spencer Gibb e3341a19cd Add @FeignClient(primary)
Adds the ability to turn off Spring Cloud Netflix making the feign instances as primary.

fixes gh-1016
2017-02-15 17:46:12 -07:00
Spencer Gibb 8f5e3ad7c0 polish 2017-02-15 17:30:42 -07:00
Ryan Baxter 384c9b9725 Merge branch 'master' of https://github.com/spring-cloud/spring-cloud-netflix 2017-02-15 13:43:02 -05:00
Ryan Baxter 981fa5db9a Merging PR #1689 into master 2017-02-15 13:42:46 -05:00
Ryan Baxter c417a9a55e Merge pull request #1695 from ryanjbaxter/uri-equal-to-empty-string
Adds a check for an empty URI in updateToHttpsIfNeeded
2017-02-14 15:33:12 -05:00
Ryan Baxter 52ab4d3ecd Adds a check for an empty URI in updateToHttpsIfNeeded. Fixes #1690. 2017-02-14 14:50:55 -05:00
Ryan Baxter 62bc2758eb Merge pull request #1694 from ryanjbaxter/default-zuul-fallbackprovider
Add the ability to provide a default ZuulFallbackProvider
2017-02-14 14:42:09 -05:00
Ryan Baxter 731c8bf0fd Add the ability to provide a default ZuulFallbackProvider. Fixes #1506 2017-02-14 13:59:25 -05:00
Erik Kringen d78da7b994 Add support for Feign.SetterFactory (#1673)
Fixes gh-1414
2017-02-10 13:37:17 -05:00
Roman Terentiev c795bd16a7 #1203 Improve filter performance by using only one instance of AllEncompassingFormHttpMessageConverter (#1681) 2017-02-10 12:25:27 -05:00
Spencer Gibb 7237275f5d polish 2017-02-10 10:14:12 -07:00
Johannes Edmeier 3e7b196950 Close response on errors writing to the outputStream (#1372)
Currently all errors during writing to the outputStream are ignored. So the
response is read to the end. This is a problem when the response is
infite or very long running (`hystrix.stream` for example) and results in the
socket never being closed and eating up threads (on zuul and the proxied
backend). With this commit the errors during writing are not ignored resulting
in closing the response.
2017-02-10 12:12:26 -05:00
Ryan Baxter 919c8fa72a Merge pull request #1678 from lowzj/master-RequestParam
fix gh-1672, support @RequestParam without a value
2017-02-09 19:38:00 -05:00
Ryan Baxter bcb97bce1c Merging PR #1680 into master 2017-02-09 15:12:19 -05:00
Ryan Baxter 64d8883210 Adding missing commit from #1457 2017-02-09 14:29:40 -05:00
Ryan Baxter 0af99769ad Adding missing commit from PR #1457 2017-02-09 14:29:12 -05:00
lowzj c8fded80d5 fix gh-1672, support @RequestParam without a value 2017-02-09 13:58:30 +08:00
Spencer Gibb c6a3157fd8 Adds information on RibbonRoutingFilter HTTP Clients 2017-02-08 20:55:08 -07:00
Ben Klein 8afb02cf03 Zuul Developer Guide: minor edits 2017-02-08 21:20:16 -06:00
Spencer Gibb 675e4c1031 Adds example zuul filters. 2017-02-08 19:47:57 -07:00
Spencer Gibb d21d03b738 initial zuul developer guide 2017-02-08 18:53:21 -07:00
Spencer Gibb ff70c08fb9 More zuul constant and javadoc updates 2017-02-08 18:52:41 -07:00
Spencer Gibb 506a9a44af Move many zuul strings to FilterConstants.
Also adds minimal javadoc to classes.

See gh-1435
2017-02-08 12:09:53 -07:00
Spencer Gibb 10e8634d38 add additional conditional on class in case of webflux 2017-02-08 10:29:32 -07:00
Spencer Gibb a1577127b7 hopefully fix flaky test 2017-02-06 21:11:25 -07:00
Spencer Gibb 5a1f1d2c64 Remove unused import. 2017-02-06 20:20:22 -07:00
Ryan Baxter a915651797 Merge pull request #1670 from bijukunjummen/gh-1641
gh-1641: Fixed instructions for configuring EurekaIntanceConfig in AWS
2017-02-06 11:20:11 -05:00
Biju Kunjummen 133d054fc8 Fixed instructions for configuring EurekaIntanceConfig in AWS 2017-02-03 22:50:30 -08:00
Eloi c87f6ca983 delegate to the library httpclient parse the content type (#1664)
Fixes gh-1663
2017-02-02 11:05:01 -05:00
Spencer Gibb a2e1836e24 Merge pull request #1656 from sbley/master
* pull1656:
  Separate adding X-ForwardedProto header
2017-02-01 15:33:13 -07:00
Stefan Bley 53649f6020 Separate adding X-ForwardedProto header
Add X-Forwarded-Proto header in Zuul PreDecorationFilter even with X-Forwarded-Host header being absent
2017-02-01 15:33:00 -07:00
Spencer Gibb 601e220411 implement Registration.getServiceId() 2017-02-01 13:45:05 -07:00
Ryan Baxter ed6c4b1925 Revert "Version changes for 1.3.0.M1"
This reverts commit 46ee0ce161.
2017-01-27 14:25:34 -05:00
Ryan Baxter 46ee0ce161 Version changes for 1.3.0.M1 2017-01-27 13:02:13 -05:00
Ryan Baxter 71b3110acf Updating config and stream versions for Dalston 2017-01-27 12:01:33 -05:00
Eloi e6f2db70ef Maintain content type for data parts in multipart requests (#1614)
maintain multipart content type for data parts

Fixes gh-1581
2017-01-27 10:26:11 -05:00
Matt Sicker 65829c437c Fix docs about @Configuration with @FeignClient (#1650)
As discovered in #1643, using `@Configuration` on a custom configuration with `@FeignClient` is unnecessary and creates extra work for exclusion from a `@ComponentScan`. This updates the docs to make this explicit.
2017-01-26 11:40:58 -05:00
Spencer Gibb f27defbdf4 Make sure service-registry actuator is activated. 2017-01-25 15:15:46 -07:00
Spencer Gibb 41bf8eadfd Rename RESET_OVERRIDE to CANCEL_OVERRIDE 2017-01-25 14:23:34 -07:00
Spencer Gibb d76bd84466 Handle content-type with charset.
A new version of httpclient introduced by boot changed the behaviour that previously allowed the charset. It now has to be parsed out and passed to the apache `ContentType` object explicitly.

fixes gh-1649
2017-01-25 11:47:11 -07:00
Ryan Baxter ca244c5dbb Merge pull request #1637 from tmack8001/zuul-route-constructor-custom-sensitive-headers
ZuulProperties.ZuulRoute consturctor missing explicitly setting of customSensitiveHeaders boolean
2017-01-23 09:38:44 -05:00
Trevor Mack ff0ac568f4 addressing issues/1636 ZuulProperties.ZuulRoute consturctor missing explicitly setting of customSensitiveHeaders boolean when provided with sensitiveHeaders 2017-01-21 23:12:45 -08:00
Spencer Gibb 5d0b2fae86 Ignore misbehaving test 2017-01-20 13:42:04 -07:00
Spencer Gibb f8a8b3cf31 Fix broken test logic, rather than >= should be <= 2017-01-20 13:41:49 -07:00
Jin Zhang 88396411f7 improve efficiency of SendResponseFilter#addResponseHeaders() (#1622) 2017-01-20 15:08:38 -05:00
Ryan Baxter 42931f9300 Merge pull request #1626 from ryanjbaxter/apply-formatter-to-collections-1526
Remove check that does not apply Formatters to Collections
2017-01-17 11:44:26 -05:00
Ryan Baxter a5bd17c0c0 Remove check that does not apply Formatters to Collection in Feign Client parameters. Fixes #1526 2017-01-17 11:16:25 -05:00
Spencer Gibb a5e5f81d88 Changes equals assertion to greaterThanOrEquals.
Hopefully this fixes flaky tests.
2017-01-16 11:41:45 -07:00
Spencer Gibb 66da2d8f48 Merge pull request #1586 from Infrag/master
* pull1586:
  Adds composed @RequestMapping annotations support
2017-01-13 14:03:52 -07:00
Ondřej Božek b619ee00bf Adds composed @RequestMapping annotations support
Fixed short circuit condition to correctly detect @RequestMapping shortcuts (@GetMapping, @PostMaping etc.)

Fixes gh-1201
2017-01-13 14:03:37 -07:00
Johannes Edmeier 899d8bc24d Add CompositeRouteLocator (#1448)
Configure a CompositeRouteLocator by default so it is easier to compose
multiple RouteLocators.
2017-01-12 16:38:01 -05:00
Spencer Gibb bf586ba2cb polish 2017-01-12 14:32:57 -07:00
Spencer Gibb 22248dd9e9 Merge pull request #1591 from tranhungt/gzip_decompression
* gzip_decompression:
  Disables httpclient auto decompression of encoded data
2017-01-12 14:31:32 -07:00
Hung Tran 6dfc7a815b Disables httpclient auto decompression of encoded data
Applies only to SimpleHostRoutingFilter.

fixes gh-1480
2017-01-12 14:31:22 -07:00
Arnaud Brunet b27ba0434a More robust instantiation in SpringClientFactory
SpringClientFactory returns null if the class is not aware of IClientConfig.

This change catches the exception when trying the constructor with IClientConfig so classes that aren't aware of IClientConfig can be created.

Fixes gh-1608
2017-01-12 16:15:31 -05:00
Spencer Gibb 3b41b5e15f Remove mocks for application event listeners.
fixes gh-1616
2017-01-12 13:39:46 -07:00
Ryan Baxter 8029deb1e4 Merging PR #1457 into master. 2017-01-10 12:52:36 -05:00
Ryan Baxter 5ee9990d93 Upgrade Ribbon to 2.2.2
Fixes gh-1441
2017-01-09 23:38:06 -05:00
Spencer Gibb 8a9c5fe4a1 Update fixes for hystrix stream test 2017-01-09 21:11:31 -07:00
Abhijit Sarkar 45d769b05b Support header map and query map (#1361)
Adds support for Map types in feign for `@RequestHeader` and `@RequestParam`.

Fixes gh-1360
2017-01-09 22:45:03 -05:00
Rob Worsnop af032476a8 Modified RibbonAutoConfiguration to support AsyncLoadBalancerInterceptor (#1507) 2017-01-09 22:02:10 -05:00
Spencer Gibb c52309ad59 Update to spring-cloud-build 1.3.1.BUILD-SNAPSHOT 2017-01-09 17:22:08 -07:00
Spencer Gibb 8526371d25 Merge pull request #1451 from madgnome/#1341-single-deferred-result
* #1341-single-deferred-result:
  #1341 SingleDeferredResult should uses RESULT_NONE from DeferredResult instead of having its own empty result.
2017-01-09 16:44:04 -07:00
Julien Hoarau 7f4a6fd94c #1341 SingleDeferredResult should uses RESULT_NONE from DeferredResult instead of having its own empty result. 2017-01-09 16:43:40 -07:00
Spencer Gibb 6fc5d1aea3 Merge pull request #1485 from eacdy/master
* pull1485:
  fix spell error
2017-01-09 16:11:40 -07:00
周立 1860b26491 fix spell error
fix spell error
2017-01-09 16:11:30 -07:00
Thibaud Lepretre fccbe1aff4 Create sidecar.hostname and sidecar.ipAddress (#1561)
In addition to `eureka.instance.hostname` property you can now defined `sidecar.hostname` in order to set different hostname from application and its sidecar.
However if `eureka.instance.hostname` is present it will override `sidecar.hostname`.

Fixes #981
2017-01-09 17:13:36 -05:00
Bertrand Renuart fa45a9f3a4 Use a fixed size buffer for the copy operation (#1538)
Set the default buffer size to 8192 to match Tomcat and Jetty defaults
Use a buffer per worker thread and use it for subsequent requests
2017-01-09 14:38:45 -05:00
Biju Kunjummen 98cd592f3e Fix null instanceinfo on EurekaInstanceRenewedEvent (#1574)
Fixes gh-1546
2017-01-09 12:41:23 -05:00
Spencer Gibb 64b81ff5a4 Update hystrix to 1.5.9
fixes gh-1600
2017-01-09 10:11:39 -07:00
Ryan Baxter f3deb04521 Pass along client config in RibbonCommand.run (#1573)
Pass along client config in RibbonCommand.run.  

Fixes gh-1530
2017-01-09 11:55:05 -05:00
Ryan Baxter ab454f1e1b Make FeignClientRegistrar implement EnvironmentAware (#1569)
Make FeignClientRegistrar implement EnvironmentAware to inject the environment.  

Fixes gh-1568
2017-01-09 11:06:51 -05:00
Jacques-Etienne Beaudet bd6d732fc7 Fix potential decoding and reencoding issues in query params when using SimpleHostRoutingFilter (#1464)
Some webserver are picky with the encoding (uWSGI for example) and the current code behavior of decoding and reencoding the query string can lead to valid requests
rejected by the backend after the modifications in Zuul. This commit adds an optional parameter to force the original encoding of the query string in SimpleHostRoutingFilter.

Fixes gh-971
2017-01-09 10:53:16 -05:00
Ryan Baxter 4eac8a5a47 Merge pull request #1599 from ahmednasir91/upgrade-hystrix-157
Fixes #1440
2017-01-09 07:04:21 -05:00
Ahmed Nasir 82dd2ebd05 Fixes #1440 2017-01-09 14:20:31 +05:00
Ryan Baxter 1cd194a1e1 Merge pull request #1578 from rahmanusta/patch-1
Update spring-cloud-netflix.adoc
2016-12-27 19:50:08 -05:00
Rahman Usta f26a5554d5 Update spring-cloud-netflix.adoc
- Remove unintended white-space
 - Specify imagesdir
2016-12-26 16:03:41 +02:00
Spencer Gibb c380039b3e Add test to make sure eureka.instance.*virtualHostName can be set properly. 2016-12-16 14:00:31 -07:00
Bart Blommaerts 9125f54897 Tiny grammatical fix (#1552) 2016-12-15 11:29:14 -05:00
Spencer Gibb 08fe5a89e9 Move SendErrorFilter to type error.
This will clear up empty 200 responses.

fixes gh-1123
2016-12-12 15:01:32 -07:00
Ryan Baxter 2e46bdf9d2 Porting #1450 for Dalston release 2016-12-12 15:09:16 -05:00
Spencer Gibb 18b9c46a8b update eureka config first bootstrap for service registry 2016-12-12 10:43:05 -07:00
Dave Syer a99e23f9fc Update to Boot 1.5.0 2016-12-12 12:31:32 +00:00
Spencer Gibb 8b089222bd make external configurations optional 2016-12-08 13:47:19 -07:00
Spencer Gibb 5b25c9ad1a Only auto-register if conditions are correct.
s-c-commons creates an AutoServiceRegistrationProperties bean if enabled.

This commit only auto registers with eureka if that bean is available.
2016-12-08 12:27:10 -07:00
Spencer Gibb ec80797694 avoid potential NPE 2016-12-08 12:27:10 -07:00
Bertrand Renuart 8b7d6848b3 use com.netflix.loadbalancer.DummyPing instead of NoopPing
use `com.netflix.loadbalancer.DummyPing` instead of `NoopPing`

This eliminates the startup of another theadpool.

fixes gh-1504
2016-12-05 13:26:05 -05:00
Ryan Baxter edb14e2a6b Merge pull request #1528 from ryanjbaxter/feign-url-protocol-1522
Don’t add URL protocol when url is set using EL
2016-12-05 13:14:58 -05:00
Ryan Baxter 6a82644153 Don’t add URL protocol when url is set using EL. Fixes #1522. 2016-12-05 12:48:01 -05:00
Ryan Baxter ac3401bc4f Fixed import ordering 2016-12-01 20:28:29 -05:00
Ryan Baxter 9da71b1655 Removed unnecessary null check and fixed imports 2016-12-01 20:28:28 -05:00
Ryan Baxter ed31004aa8 Uses configuration from IConfigClient reference to always use the most up to date configuration. Fixes #1481. 2016-12-01 20:28:28 -05:00
Ryan Baxter fe50674c8e Merge pull request #1520 from ryanjbaxter/eureka-client-zone-doc-1327
Document Eureka client zone config
2016-12-01 19:15:38 -05:00
Spencer Gibb 1fe1ea58f6 Don't override values with defaults.
Defaults were set too late and were overriding values set in the environment.

Specifically, spring.application.name took precedence over eureka.instance.appname.

 fixes gh-1516
2016-11-30 11:55:57 -07:00
Spencer Gibb b3f1a30027 Move initalizing appname, etc.. to afterPropertiesSet 2016-11-30 11:55:24 -07:00
Spencer Gibb 111a95d262 Fix Eureka Ribbon Auto Config conditions.
Specifically, add `@ConditionalOnBean(EurekaClient.class)`.

Fixes an issue where eureka and ribbon are on the classpath, eureka.client.enabled=false which would cause a bean not found exception.

fixes gh-1511

(cherry picked from commit d1f8c03)
2016-11-29 14:56:55 -07:00
Ryan Baxter 35528a7199 Merge pull request #1496 from ryanjbaxter/upgrade-eureka-to-1.6.1
Upgrade Eureka to 1.6.1.  Fixes #1495.
2016-11-22 20:22:49 -05:00
Ryan Baxter 927b753262 Upgrade Eureka to 1.6.1. Fixes #1495. 2016-11-22 19:59:27 -05:00
Ryan Baxter 8359016981 Updating generated README 2016-11-22 17:14:39 -05:00
Ryan Baxter 5372fe9d6e Merge pull request #1494 from ryanjbaxter/document-feign-request-headers
Document how to use thread isolation with hystrix and feign.  Fixes #1191.
2016-11-22 17:08:05 -05:00
Ryan Baxter 8814da3b78 Document how to use thread isolation with hystrix and feign. Fixes #1191. 2016-11-22 15:39:13 -05:00
Bertrand Renuart 2d748bf63c use different bean names for Hystrix and HystrixStream features (#1470)
Fixes gh-1462
2016-11-16 09:39:48 -07:00
Ryan Baxter eff1f0d77a Fixes #1459 2016-11-14 15:30:28 -05:00
Spencer Gibb aec8ec43ef Fix broken test. 2016-11-07 11:24:52 -07:00
Spencer Gibb 93cd1e7a4a Upgrade to eureka 1.6.0
fixes gh-1345
2016-11-07 10:52:47 -07:00
Spencer Gibb ea4e5d76e0 Create EurekaServiceRegistry
Use the new ServiceRegistry interface

Creates a new EurekaRegistration object that aggregates classes needed
for a single registration.
2016-11-07 10:52:47 -07:00
Robin Stocker e6298f8107 Fix NoClassDefFoundError loading RxJavaAutoConfiguration without spring-webmvc (#1442)
RxJavaReturnValueHandlerConfig can only be loaded when both spring-web
and spring-webmvc are on the classpath, because it contains a reference
to the WebMvcConfigurerAdapter class.

But the ConditionalOnClass annotation only included the class from
spring-web. In our situation, only spring-web was on the classpath,
resulting in a NoClassDefFoundError for WebMvcConfigurerAdapter. Fix it
by adding that class to the condition as well.
2016-11-03 10:27:15 -04:00
Dave Syer 704a874e84 Add example of empty sensitive headers
Emphasises that it's a black list, and clarifies that you need to
set it to empty to get authorization and cookie headers.
2016-11-03 12:06:43 +00:00
Spencer Gibb 428ed6c88c Bump to 1.3.0.BUILD-SNAPSHOT 2016-10-27 15:37:59 -06:00
Ryan Baxter dd62879b7b Merge pull request #1430 from ryanjbaxter/zuul-hystrix-fallback-doc
Document Hystrix Fallback For Zuul
2016-10-27 15:33:52 -04:00
Ryan Baxter 14a31cd5f8 Switched media type to application/json 2016-10-27 15:09:21 -04:00
Ryan Baxter 8a7df36d88 Added route config 2016-10-27 15:02:17 -04:00
Ryan Baxter fe56d96295 Fixes #1429 2016-10-27 14:25:18 -04:00
Ryan Baxter fabf90bed4 Merge pull request #1375 from ryanjbaxter/simplify-retry-logic
Provide A Retry Policy For Ribbon Clients
2016-10-26 15:42:32 -04:00
Ryan Baxter c3a84f1b73 Merge remote-tracking branch 'Upstream/master' into simplify-retry-logic 2016-10-26 15:05:12 -04:00
Ryan Baxter 5a5a1aaa7f -Made spring-retry optional
-additional refactoring from changes in s-c-commons
2016-10-26 15:04:51 -04:00
Venil Noronha aef753a3a0 Adds Feign Logger factory interface (#1411)
Fixes gh-1363
2016-10-25 17:39:22 -04:00
Ryan Baxter 08028db982 Merge pull request #1425 from ryanjbaxter/eureka-app-name-default
Resolve spring.application.name via property resolver
2016-10-25 14:31:12 -04:00
Ryan Baxter 85b2fe37e2 Added some additional tests 2016-10-25 13:54:29 -04:00
Spencer Gibb 81959b5ef3 Use new FilterRegistrationBean package.
Breaks Spring Boot 1.3 compatibility, enables 1.5
2016-10-25 11:24:42 -06:00
Ryan Baxter 657d9bb8e8 Merge remote-tracking branch 'Upstream/master' into eureka-app-name-default 2016-10-25 13:04:35 -04:00
Ryan Baxter 2dfee97563 Resolve spring.application.name value via a property resolver instead of @Value. Fixes #1398 2016-10-25 12:56:08 -04:00
Dave Syer 7f075d11ee Allow Cors requests through to backend by default
Instead of blocking them (which is the default behaviour of a
Spring MVC controller) Cors requests will flow through the Zuul
filters by default. Users can control it by grabbing the
ZuulHandlerMapping in a @PostConstruct and injecting some
CorsConfiguration via its setCorsConfigurations() method.
2016-10-25 14:33:53 +01:00
Dave Syer a38b7b71ac Append to X-Forwarded-* headers instead of replacing them
This fixes most of the issues people encounter when there are
multiple proxies in the request. The tricky thing is that there
is another header "Forwarded" that we don't recognize, but which
backends probably do, at least some of the time (since it is
from an actual RFC). The problem is that "Forwarded" does not
contain the ports, so Spring UriComponentsBuilder cannot use it
to rewrite links to a specific port. Since we do not support it
already, this change doesn't make things any worse, but the
corner case is there still.
2016-10-25 12:56:49 +01:00
Dave Syer 139ab95438 Make configuration imports deterministic 2016-10-25 12:20:31 +01:00
Dave Syer 71ac67f9f1 Suppress some warnings 2016-10-25 12:20:21 +01:00
Dave Syer 0e1b856fc5 Extract proxy header manipulation into method 2016-10-25 07:50:38 +01:00
Ryan Baxter 0235d77932 Zuul Route Hystrix Fallback
Hystrix fallback support for Zuul routes.

Fixes gh-250.
2016-10-24 15:24:31 -04:00
Ryan Baxter 6e1ca54edc increased max retried to help with failures 2016-10-24 13:42:21 -04:00
Ryan Baxter 274213bc83 Merge pull request #1412 from ryanjbaxter/creating-feign-clients-with-builder
Document Manual Feign Client Creation
2016-10-20 16:12:15 -04:00
Ryan Baxter 5a42cb1b2b Updates based on latest version from commons 2016-10-20 15:09:52 -04:00
Ryan Baxter ee99efba36 Merge remote-tracking branch 'Upstream/master' into simplify-retry-logic 2016-10-20 14:38:37 -04:00
Ryan Baxter b16a95d0f2 Fixed typo 2016-10-20 13:40:59 -04:00
Ryan Baxter 2c8bac5666 Use client interface instead of Eureka directly 2016-10-20 13:31:41 -04:00
Spencer Gibb 8e6b643829 Use new ServletRegistrationBean package.
Breaks Spring Boot 1.3 compatibility, enables 1.5
2016-10-20 11:19:54 -06:00
Ryan Baxter cc24d00fde Fixes #1211 2016-10-19 20:06:52 -04:00
Spencer Gibb ddc1069e86 Move properties to new namespace.
Moving eureka.server.{expectedNumberOfRenewsPerMin,defaultOpenForTrafficCount} to eureka.instance.registry so relaxed binding can be used. Default to old values for backwards compatibility.
2016-10-19 12:36:15 -06:00
Ryan Baxter c9704d3c97 Updating versions for next release 2016-10-18 10:16:01 -04:00
Ryan Baxter 34775eb8db Revert "Version changes for the release"
This reverts commit 90d6490fea.
2016-10-18 10:11:03 -04:00
Ryan Baxter 90d6490fea Version changes for the release 2016-10-18 09:44:57 -04:00
Gregor Zurowski acb9e5ebdf Fix formatting (#1397)
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
2016-10-13 16:08:28 -04:00
Spencer Gibb 12fff7c97f Merge pull request #1339 from alenavorozhbieva/master
* pull1339:
  Support DELETE method body for SimpleHostRoutingFilter
2016-10-13 09:34:22 -06:00
Alena acb12ea7d4 Support DELETE method body for SimpleHostRoutingFilter
fixes gh-1329
2016-10-13 09:34:08 -06:00
Dave Syer e94c35d331 Exclude aws jars from eureka client by default
Saves about 5MB in the final executable jar, and it should be
optional for Spring Cloud users.
2016-10-13 10:03:19 +01:00
Ryan Baxter a685a72660 Merge pull request #1384 from bslota/master
#1376 Register and cancel event sending fix
2016-10-11 19:34:25 -04:00
Bartłomiej Słota 4aaa7d0555 InstanceRegistry class refactor + renew method test #1376 2016-10-11 21:46:25 +02:00
Ryan Baxter 2f09aa291b Merge pull request #1390 from ryanjbaxter/upgrade-zuul-1.3.0
Upgrade zuul 1.3.0
2016-10-11 14:53:39 -04:00
Ryan Baxter bdf2f25259 Fixes #1306 2016-10-11 14:27:47 -04:00
Ryan Baxter 5a0af27115 Merge remote-tracking branch 'Upstream/master' 2016-10-11 14:20:12 -04:00
Ryan Baxter 18c4bc060b Upgrade hystrix 1.5.6 (#1388)
Fixes gh-1374
2016-10-11 13:41:31 -04:00
Spencer Gibb d23aa67f7b Merge pull request #1370 from tiny-dancer/master
* pull1370:
  Warning for GC Overhead Limit Reached with servo.
2016-10-11 10:29:19 -06:00
mg 5a127d0700 Warning for GC Overhead Limit Reached with servo.
Fixes gh-947
2016-10-11 10:29:04 -06:00
Spencer Gibb aa160940df import order 2016-10-11 10:25:02 -06:00
Max Ishchenko c8829f2aa4 Prevent double url encoding for secure ribbon urls (#1389)
Secure ribbon urls were forced to use https scheme via UriComponentsBuilder, that was created from original uri. This transformation url encoded previously encoded url parts that were used to create builder. This was introduced in c883495.

This change fixes double url encoding using RibbonUtils.updateToHttpsIfNeeded that fixes double escaping case and corner case with '+' in url as well.

Fixes gh-1382
2016-10-11 10:19:33 -04:00
Bartłomiej Słota 0985c8f092 Merge pull request #1 from spring-cloud/master
Remove @Autowired from FeignClientFactoryBean
2016-10-11 00:09:45 +02:00
Bartłomiej Słota 279edf0665 super class method wrappers removal and test update #1376 2016-10-10 22:54:39 +02:00
Ryan Baxter 50fac81a30 Revert "Fixes #1374"
This reverts commit 99b86e7a29.
2016-10-10 15:32:20 -04:00
Ryan Baxter 99b86e7a29 Fixes #1374 2016-10-10 15:31:42 -04:00
Bartłomiej Słota 151e021ef9 formatting fixed + tests, fixes #1376 2016-10-08 00:24:35 +02:00
Bartłomiej Słota dd97b6a4b7 #1376 Register and cancel event sending fix 2016-10-07 00:11:24 +02:00
Spencer Gibb f30e8b7b46 Remove @Autowired from FeignClientFactoryBean
@Autowired causes NullPointerExceptions because of some unknown lifecycle issues.

fixes gh-1366
2016-10-06 10:19:46 -06:00
Spencer Gibb ba3923d706 Fix zuul error when there are colons in request param name.
Previously, parameter names with colons (ie foo:bar), caused an IllegalArgumentException because 41c364002f introduced UriTemplate to properly encode.

fixes gh-1193
2016-10-05 12:51:28 -06:00
Spencer Gibb 622cc83204 polish 2016-10-04 18:48:28 -06:00
bpicode 8e18c3d3b6 Add support for fallback factories in feign client annotation. (#1373)
Adds `@FeignClient.fallbackFactory` to define a `feign.hystrix.FallbackFactory`.

fixes gh-1117
2016-10-04 20:46:33 -04:00
Spencer Gibb 0adbd5662f polish 2016-10-04 18:39:07 -06:00
Ryan Baxter f00d1159c8 Merge remote-tracking branch 'Upstream/master' into simplify-retry-logic 2016-10-04 10:49:02 -04:00
Ryan Baxter 4c90ce437e Implementation of factory pattern for creating retry policies 2016-10-04 10:48:40 -04:00
Mathias Düsterhöft e109093b83 add config option to not ignore security headers (#1354)
* add config option to not ignore security headers
* fix field documentation of ignoreSecurityHeaders
* add documenation for  zuul.ignoreSecurityHeaders

fixes gh-1096
2016-10-03 23:30:17 -04:00
Ryan Baxter 4ba3411292 Clarified zuul.stripPrefix usage
Helps with the confusion seen in #1365
2016-10-03 13:44:02 -07:00
Jacques-Etienne Beaudet 8e1be54759 Support '+' in encoded query string when rebuilding the URI to https
RibbonUtils now replace the encoded space character '+' in the query string in favor of the equivalent '%20' when rewriting the URI in https. This is due to UriComponentsBuilder verifying the allowed characters in the encoded URI when building to the URI java.net class. The '+' is considered illegal but is widely used in the field. (#1367)
2016-10-03 14:35:30 -04:00
Spencer Gibb be6f2634b5 Allow OkHttpClient to be customized.
Moved common functionality to AbstractLoadBalancingClient
2016-09-23 14:09:41 -06:00
Ryan Baxter 7191e820a2 Implementing retry policy 2016-09-23 15:01:09 -04:00
Spencer Gibb 9eed249028 Allow customization of HttpClient.
Uses ribbon settings to set MaxConnTotal and MaxConnPerRoute. Also allows user to create a custom HttpClient as a constructor argument.

fixes gh-1149
2016-09-22 19:42:20 -06:00
Spencer Gibb bbff2b24d0 Put Apache Http Client and OkHttpClient in ribbon context.
This eliminates them being created for every zuul request.

Also makes properties consistent accross modules: ribbon.httpclient.*, ribbon.restclient.* and ribbon.okhttp.*

fixes gh-1150
2016-09-22 15:46:53 -06:00
Ryan Baxter b91fa734d2 Bumping versions for next release 2016-09-22 14:55:08 -04:00
Ryan Baxter 302eae6aeb Revert "version changes for Camden release"
This reverts commit 088afa6d71.
2016-09-22 14:21:39 -04:00
Ryan Baxter 088afa6d71 version changes for Camden release 2016-09-22 13:15:22 -04:00
Dave Syer 5f96c415e3 Upgrade xstream to 1.4.9
Fixes XXE vulnerability in Eureka Server (external entity processing
on by default in older versions of the library).
2016-09-22 16:23:27 +01:00
Ryan Baxter 6c9fa68d5a Translate ribbon.ReadTimeout to apache http client socket timeout. Fixes #1357. (#1358) 2016-09-21 14:03:14 -04:00
Dave Syer bc4f5a3788 Ensure version is scraped from parent pom 2016-09-20 13:34:30 +01:00
Dave Syer f094ecfd88 Allow user to set system properties to control http client in zuul
The SimpleHostRoutingFilter now accepts normal -Dhttps.proxy= and
-Dhttps.port= settings (and other things that generally work with
java.net).

Fixes gh-510
2016-09-20 12:30:49 +01:00
Marcin Grzejszczak 13268f7c63 Updating mvnw for all projects 2016-09-19 19:31:33 +02:00
Marcin Grzejszczak aa820ce347 Updating mvnw for all projects 2016-09-19 14:18:37 +02:00
Dave Syer 6310059531 Move unnecessary dependencies up a level 2016-09-19 12:02:34 +01:00
Marcin Grzejszczak 6f92859608 Updating mvnw for all projects 2016-09-19 12:46:58 +02:00
Spencer Gibb 758ff920fc Merge pull request #1351 from VanRoy/improve-formbodywrapperfilter-test
* improve-formbodywrapperfilter-test:
  Add test on FormBodyWrapperFilter to avoid regressions (#1171)
2016-09-16 14:42:48 -06:00
Julien Roy 7ba8063940 Add test on FormBodyWrapperFilter to avoid regressions (#1171) 2016-09-16 14:42:31 -06:00
Niklas Herder 61de118130 Use management.port for locating hystrix.stream (#1317)
Allow override of /hystrix.stream location via management.port metadata.
2016-09-16 15:15:46 -04:00
Matthew Jenkins 4bf64f7005 Use statusPage/healthCheckUrlPath w/ custom management.port (#1349)
Use statusPage/healthCheckUrlPath w/ custom management.port

Added RelaxedPropertyResolver to handle multiple valid formats for
eureka properties.  Added tests.

Fixes gh-1348
2016-09-15 21:20:35 -04:00
Spencer Gibb 85eab87dce formatting 2016-09-15 08:34:59 -06:00
rockinrimmer 5ba0cc5860 Check if object is already a ResponseEntity, if so return instead of … (#1343)
* Check if object is already a ResponseEntity, if so return instead of wrapping in another ResponseEnitiy. Which caused headers and status code from original ResponseEnitiy to be lost and for body to be output with whole ResponseEntity instead of just the body

* added test
2016-09-15 10:15:42 -04:00
Marcin Grzejszczak 08aae5be3b Updating mvnw for all projects 2016-09-15 16:13:07 +02:00
Ryan Baxter 071bad218a Document Eureka client zone config. Fixes #31327 2016-09-14 10:41:38 -04:00
Ryan Baxter 027e7fc5c6 Merging changes from #1338 2016-09-13 08:57:01 -04:00
Spencer Gibb 498e8a1486 Use default maxSemaphore property.
Rather than hard code the default maxSemaphores for zuul use the already defined `zuul.semaphore.maxSemaphores` property.

fixes gh-1332
2016-09-12 09:36:22 -06:00
Ryan Baxter 09c6bc1d12 Merge pull request #1325 from herder/fix_registry_failures_report_time_mismatch
Fix lastFetch status calculation.
2016-09-08 09:38:09 -04:00
Niklas Herder 62521f38e8 Fix lastFetch status calculation.
Was previously milliseconds/seconds when calculating whether to display the message about reporting failures.
2016-09-08 11:24:11 +02:00
Spencer Gibb a6785afa5a Exclude commons-logging from archaius starter
fixes gh-126
2016-09-07 11:16:51 -06:00
Marcin Grzejszczak 7ebb46a092 Removed adoc footer 2016-09-07 18:02:13 +02:00
Marcin Grzejszczak a9fcc0a002 Updating mvnw for all projects 2016-09-07 17:29:18 +02:00
Ryan Baxter 08ed3c7fc4 Revert "Updated versions for Camden.RC1 release"
This reverts commit 3c1a23e7b1.
2016-09-06 14:25:21 -04:00
Ryan Baxter 3c1a23e7b1 Updated versions for Camden.RC1 release 2016-09-06 14:16:23 -04:00
Spencer Gibb c7403361fd polish 2016-09-06 08:40:49 -06:00
Sébastien Nussbaumer d9efb0a84d Allow Content-Length header with values greater than 2 GB (#1320)
fixes gh-1319
2016-09-06 10:38:16 -04:00
Ryan Baxter 4f81255970 Merge pull request #1318 from jkschneider/no-commons-lang
Remove dep on commons-lang in DimensionalServoMetricNaming (#1268)
2016-09-06 07:45:24 -04:00
Jon Schneider e556ef84a4 Eliminate dependency on commons-lang in DimensionalServoMetricNaming (#1268) 2016-09-02 22:06:18 -07:00
Jon Schneider 9587003d44 Sanitize Servo metric tag key/value pairs before publishing to Atlas (#1315) 2016-09-01 17:32:30 -04:00
Jon Schneider 8f7ea41fe8 Log partial failure reasons for metrics batches published to Atlas (#1314) 2016-09-01 14:57:52 -04:00
Jon Schneider b4284d18d5 Escape regex path variables in the uri tag for Spectator (#1311) 2016-09-01 11:27:30 -04:00
Spencer Gibb 048d401309 Merge pull request #1310 from garciafl/master
* garciafl-master:
  Removes RibbonCommand suffix.
2016-09-01 09:24:39 -06:00
Garcia Florian 85a1f3ec20 Removes RibbonCommand suffix.
This is a regression that was originally fixed in 1.1.x

Fixes gh-1308
2016-09-01 09:23:24 -06:00
Spencer Gibb 959b007269 removed duplicate feign ApacheHttpClient configuration 2016-08-31 12:02:25 -06:00
Spencer Gibb 9b550f7293 Support delete with body in zuul where possible.
The apache http client and ok http client support delete with body, ribbon rest client does not.

fixes gh-949
2016-08-31 11:43:05 -06:00
Spencer Gibb dc26b1efa8 Merge pull request #1102 from lowzj/request-param-processor
* lowzj-request-param-processor:
  update RequestParamParameterProcessor to support map param
2016-08-31 11:05:05 -06:00
lowzj d356e57134 update RequestParamParameterProcessor to support map param
fixes gh-1097
2016-08-31 11:04:20 -06:00
Spencer Gibb c5b0ffe310 Document customizing the Ribbon Client using properties
fixes gh-1188
2016-08-30 10:17:04 -06:00
Spencer Gibb 1ffa7825ed Add {spring-cloud-version} 2016-08-30 09:58:21 -06:00
Spencer Gibb d95f3cd1c5 Mention starters to include for features.
fixes gh-1134
2016-08-30 09:44:18 -06:00
Spencer Gibb 6ba64d97c8 Upgrade feign to 9.3.1
fixes gh-1303
2016-08-30 09:22:40 -06:00
Spencer Gibb fa508a2c7e Add warning for eureka healthcheck.
fixes gh-1276
2016-08-30 09:14:32 -06:00
Spencer Gibb d04df564f0 Try and fix old static wonkiness in test. 2016-08-29 12:47:35 -06:00
Spencer Gibb 5f192dd6ce Fix NPE when instance has no status page url.
fixes gh-1285
2016-08-29 12:29:57 -06:00
Spencer Gibb 6819922d26 Fix MetricsTagProvider for non web apps.
Guard creating and creation of classes that use it with @ConditionalOnClass(name = "javax.servlet.http.HttpServletRequest")

fixes gh-1302
2016-08-29 10:43:17 -06:00
Ryan Baxter ec726e863c Merge pull request #1296 from ryanjbaxter/upgrade-eureka-1.4.11-1288
Upgrade Eureka to 1.4.11
2016-08-25 14:15:11 -04:00
Ryan Baxter 610754981b Upgrade Eureka to 1.4.11. Fixes #1288 2016-08-25 13:53:24 -04:00
Ryan Baxter 485034dec0 Merge pull request #1294 from ryanjbaxter/upgrade-hystrix-1.5.5-1289
Upgrade Hystrix to 1.5.5
2016-08-24 19:29:38 -04:00
Ryan Baxter 9316124733 Upgrade Hystrix to 1.5.5. Fixes #1289 2016-08-24 16:10:50 -04:00
Ryan Baxter 1b9d91dc1e Merge pull request #1293 from ryanjbaxter/upgrade-stream
Updated SC Stream to Brooklyn SNAPSHOT
2016-08-24 09:55:07 -04:00
Ryan Baxter 15550e1855 Updated SC Stream to Brooklyn SNAPSHOT. Fixes #1292. 2016-08-24 09:32:30 -04:00
Spencer Gibb 43adc84dfd Make moving to https urls consistent.
This fixes a case where the ribbon property is set `ribbon.IsSecure=false`, but because the eureka secure port was enabled, the uri created by ribbon was prefixed with https when it shouldn't have.

All places where isSecure is need have been consolidated into RibbonUtils.

fixes gh-1270
2016-08-22 17:16:13 -06:00
Spencer Gibb 8d6aeebb61 Feign URI tests updated to be more inclusive.
Previously with a `@FeignClient(name="http://bad_hostname")` would pass the start time test and fail later in runtime. The test now fails fast.

fixes gh-1257
2016-08-22 15:05:59 -06:00
Ryan Baxter 1c8c0cfbf0 Moved parent element in pom so milestone profile activation occurs correctly 2016-08-22 15:32:31 -04:00
Ryan Baxter 047e25f7f7 Revert "Camden.M1 release"
This reverts commit 258e53a402.
2016-08-22 15:31:32 -04:00
Ryan Baxter 258e53a402 Camden.M1 release 2016-08-22 15:01:16 -04:00
Marcin Grzejszczak c8c4dfba6e Updating ghpages for all projects 2016-08-22 13:32:23 +02:00
Ryan Baxter 0bed544188 Merge pull request #1221 from stephlag/zuul_hystrix_threadpool
Make Hystrix Thread Pool available while using Zuul
2016-08-19 12:31:03 -04:00
Ryan Baxter 3cc07d36a2 Merge pull request #1282 from ryanjbaxter/upgrade-feign-to-9.3.0
Upgrade Feign to 9.3.0
2016-08-19 12:07:28 -04:00
Ryan Baxter 78b53a5215 Upgrade Feign to 9.3.0. Fixes #1281. 2016-08-19 11:14:11 -04:00
Marcin Grzejszczak 886382f568 Updating ghpages for all projects 2016-08-19 11:46:36 +02:00
Ryan Baxter a9dd1b4568 Merge pull request #1278 from ryanjbaxter/upgrade-feign-to-9.2.0
Upgrade Feign to 9.2.0
2016-08-18 14:43:29 -04:00
Ryan Baxter 323243f1ec Upgrade Feign to 9.2.0. Fixes #1273. 2016-08-18 14:24:53 -04:00
Spencer Gibb 25366c2a37 Add not about zuul route ordering.
fixes gh-1266
2016-08-18 11:33:29 -06:00
Stéphane Lagraulet b98c9ebc1d Add tests to verify old constructors 2016-08-18 14:27:11 +02:00
Dave Syer cb44cd2e33 Add additional test to look for null hosts in Zuul
Conflicts:
	spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/RibbonClientConfigurationTests.java
2016-08-18 12:59:05 +01:00
Marcin Grzejszczak 1fefd410be Updating ghpages for all projects 2016-08-18 13:15:30 +02:00
Stéphane Lagraulet f5bb5ff9c1 Keep old constructors to maintain backwards compatibility with spring cloud sleuth 2016-08-18 11:24:15 +02:00
Ryan Baxter e2e7c490db Merge pull request #1247 from Coramo/master
fix 'RibbonRequest' cannot to encode issues
2016-08-17 13:48:36 -04:00
Dave Syer 68cf346025 Change repo URLs to https 2016-08-17 17:33:02 +01:00
Dave Syer 7927372b75 Polish 2016-08-17 17:33:02 +01:00
Stéphane Lagraulet ca2c9018c6 Merge branch 'master' of https://github.com/spring-cloud/spring-cloud-netflix into zuul_hystrix_threadpool 2016-08-17 18:11:52 +02:00
Spencer Gibb 9ed5621a78 Revert "Adds zuul property to customize Hystrix ExecutionIsolationStrategy"
This reverts commit 21df6e43a3.
2016-08-17 09:57:35 -06:00
Dave Syer 58cf528463 Remove extra (redundant) condition
A problem in Spring Boot means that the extra conditions are combined
with OR not AND, so it's a bug to have more than one until that
gets fixed (in an AnyNestedCondition).

See https://github.com/spring-projects/spring-boot/pull/6672
2016-08-17 14:04:45 +01:00
Marcin Grzejszczak 4602fc1105 Updating ghpages for all projects 2016-08-17 12:45:28 +02:00
Dave Syer b9e2a1b21e Fix test so it actually works if there is a server on localhost:80 2016-08-17 09:19:33 +01:00
Dave Syer f76f294f7f Rename test to conform to usual pattern 2016-08-17 09:04:37 +01:00
Spencer Gibb 64fff7edd2 Merge branch 'context-path-prefix-support' of https://github.com/kakawait/spring-cloud-netflix into kakawait-context-path-prefix-support 2016-08-16 12:59:10 -06:00
Spencer Gibb beb84dbe07 Merge branch 'molindo-1108-proxy-headers' 2016-08-16 12:57:10 -06:00
Stefan Fussenegger d9768b5378 Improved zuul proxy header support.
- add zuul.add-host-header property to add Host header
- add port to X-Forwarded-Host as defined in RFC 7239
- extract PreDecorationFilter.filterOrder() into a public constant

fixes gh-1108
2016-08-16 12:56:54 -06:00
Spencer Gibb 34befdf1d2 Merge branch 'stephlag-zuul_hystrix_threadpool' 2016-08-16 10:44:32 -06:00
Stéphane Lagraulet 21df6e43a3 Adds zuul property to customize Hystrix ExecutionIsolationStrategy
Add a check to current context as contentLength is already in the context
Get content length from Headers when RibbonCommandContext is built + add tests
Use request content length RibbonRoutingFilter
Add documentation for new zuul.ribbonIsolationStrategy property

fixes gh-339
2016-08-16 10:43:24 -06:00
Jin Zhang bc7b8367a9 add *.swp *.swo to .gitignore (#1181) 2016-08-16 12:01:04 -04:00
Marcin Grzejszczak c7a6720593 Updated e2e tests with new brewery parameters 2016-08-16 15:27:29 +02:00
Marcin Grzejszczak cf0c3bda92 Deploying documentation to proper folder
What we're missing ATM is different documentation versions for different application versions. What this change does is that it's:

- finding out what is the current branch (e.g. 1.0.x)
- finding out out what is the name of the main adoc file (e.g. spring-cloud-sleuth)
- pulling the changes from gh-pages after checkout
- finding out what is the list of comma separated whitelisted branches (via the `docs.whitelisted.branches` prop)
- in gh-pages creating a folder with name of the branch  (e.g. /1.0.x)
copying all the docs/target/generated-docs/ to that folder
- if the branch from which we're calling the script is NOT master then we're changing the ${main.adoc}.html to index.html so that it's easier to access the docs (e.g. http://cloud.spring.io/spring-cloud-sleuth/1.0.x/)
2016-08-16 14:57:22 +02:00
Coramo 2db2a033ab add 'RibbonRequest' test 2016-08-12 12:02:58 +08:00
Coramo cf72184883 Merge branch 'master' of https://github.com/spring-cloud/spring-cloud-netflix 2016-08-12 11:00:43 +08:00
Stéphane Lagraulet 62344dccda Merge branch 'master' into zuul_hystrix_threadpool 2016-08-11 09:42:03 +02:00
Stéphane Lagraulet 03caa1b8ce Remove deprecated and unused constructors for RibbonCommandContext and RestClientRibbonCommand 2016-08-11 09:41:15 +02:00
Coramo 97c8f4c026 fix 'RibbonRequest' cannot to encode issues 2016-08-11 11:05:14 +08:00
Spencer Gibb 674e45f473 Add Client to list of feign objects that can be customized. 2016-08-10 14:13:28 -06:00
Ryan Baxter 36fec07a17 Merge pull request #1093 from daniellavoie/hystrix-security
Expose security context to any Hystrix command.
2016-08-10 15:20:19 -04:00
Spencer Gibb 0c694a018c Merge pull request #1242 from mikexliu/master
* pull1242:
  Add @Qualifier customization for @FeignClient
2016-08-10 12:22:45 -06:00
Mike Liu f37b513f21 Add @Qualifier customization for @FeignClient
Changed test to use @Qualifier.
Add documentation to reference the new attribute.
2016-08-10 12:22:33 -06:00
Spencer Gibb 56c7466e64 Merge branch 'Egencia-master' 2016-08-10 12:01:27 -06:00
libetl 519be4db06 MetricsInterceptorConfiguration modifies potenially unmodifiable list.
fixes gh-1240
2016-08-10 12:00:49 -06:00
Spencer Gibb 4255c5578b Merge pull request #1244 from cah-oster/master
* pull1244:
  Fixed double-encoding issue in RibbonClientConfiguration
2016-08-10 11:25:10 -06:00
Scott Oster 5e698278a8 Fixed double-encoding issue in RibbonClientConfiguration
fixes gh-1241
2016-08-10 11:24:59 -06:00
Ryan Baxter b09b0bcdbd Added Codacy badge to README 2016-08-10 10:36:34 -04:00
Spencer Gibb 909a51000f Remove @Ignore
fixes gh-1157
2016-08-09 16:50:57 -06:00
Spencer Gibb 306b43624b update readme 2016-08-09 14:51:19 -06:00
Ryan Baxter ec22c23bc5 Added CircleCI and Codecov badges 2016-08-09 16:45:26 -04:00
Ryan Baxter a4ba11eabb Updated sonar profile configuration 2016-08-09 14:31:13 -04:00
Stéphane Lagraulet 58559aff16 Add documentation for new zuul.ribbonIsolationStrategy property 2016-08-09 18:32:36 +02:00
Ryan Baxter 3e3511ac44 merge 2016-08-09 11:46:03 -04:00
Ryan Baxter 36ae029c18 circleci updates 2016-08-09 11:44:01 -04:00
Stéphane Lagraulet 4dc016f3e5 Merge branch 'master' into zuul_hystrix_threadpool
Conflicts:
	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/route/support/AbstractRibbonCommand.java
2016-08-09 17:40:30 +02:00
Ryan Baxter d90e99216b Merge pull request #1225 from coveord/fix-content-length
Content-length not properly set when using the FormBodyWrapperFilter
2016-08-09 10:30:20 -04:00
Stéphane Lagraulet 67838807e8 Add zuulProperties as a method parameter 2016-08-09 09:36:30 +02:00
Jacques-Etienne Beaudet dc2cdd55c0 Merge branch 'master' into fix-content-length 2016-08-08 22:45:20 -04:00
Daniel Lavoie 5b0f6013e8 Expose security context to any Hystrix command.
Fix issue gh-1054
2016-08-08 23:05:10 +02:00
Ryan Baxter 52c956831e circleci updates 2016-08-08 15:03:00 -04:00
Ryan Baxter 4f93897b71 more circle ci configuration 2016-08-08 13:57:23 -04:00
Ryan Baxter 5676c8f753 added artifacts directory to circle config 2016-08-08 13:20:12 -04:00
Ryan Baxter eed72600c5 initial commit for circleci build 2016-08-08 11:47:29 -04:00
Stéphane Lagraulet 35ca9691d2 Merge branch 'master' into zuul_hystrix_threadpool
Conflicts:
	spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/okhttp/OkHttpRibbonCommandIntegrationTests.java
2016-08-08 17:29:10 +02:00
Stéphane Lagraulet 072f7760a4 Use request content length RibbonRoutingFilter 2016-08-08 17:07:35 +02:00
Ryan Baxter 3c1599a1f4 Merge pull request #1213 from mhartle/master
FormBodyWrapperFilter may add multiples of every multipart part to a request
2016-08-08 10:58:59 -04:00
Ryan Baxter 90808124f5 Merge pull request #1206 from daniellavoie/spring-boot-test-1.4
Migrate tests to Spring Boot Test 1.4
2016-08-08 10:53:17 -04:00
Stéphane Lagraulet 3c96fcc888 Get content length from Headers when RibbonCommandContext is built + add tests 2016-08-05 18:57:20 +02:00
Jacques-Etienne Beaudet d21a7ef8e2 Fix an issue where the FormBodyWrapperFilter would encode the form parameters differently than on the original request.
The FormBodyWrapperFilter handles the application/x-www-form-urlencoded. In the case of requests received by curl or javascript, the FormHttpMessageConverter will reencode the parameters differently (for example, '(' will be encoded while it's not with the javascript encodeURIComponent method).

While this doesn't create any problem, the content length was not properly set in AbstractRibbonCommand. This causes the form params being stripped or the backend server would wait a long time for additional bytes depending on if the content length header was bigger/smaller than the actual data.
2016-08-03 14:27:46 -04:00
Stéphane Lagraulet b1ec12af43 Add a check to current context as contentLength is already in the context 2016-08-03 15:32:08 +02:00
Stéphane Lagraulet 7929dfec0f Add a zuul property to customize Hystrix ExecutionIsolationStrategy 2016-08-02 13:39:04 +02:00
Michael Hartle 8bb223f6e3 Added a minimal test for FormBodyWrapperFilter handling multiple part names with multiple parts 2016-08-02 12:15:15 +02:00
Ryan Baxter 8b911e6074 Merge pull request #1217 from ryanjbaxter/move-to-open-feign
Changed version and group id to use latest OpenFeign release
2016-07-29 17:07:18 -04:00
Ryan Baxter 10a3d1df69 Changed version and group id to use latest OpenFeign release. Fixes #1189. 2016-07-29 14:21:21 -04:00
Dave Syer 8cf581d496 Correct description of cloud foundry instance id
Fixes gh-1214
2016-07-27 11:37:47 +01:00
Michael Hartle 0095ba8984 Fixed an issue where the pre FormBodyWrapperFilter adds multiples of every multipart part to a request 2016-07-26 13:37:46 +02:00
Daniel Lavoie 6f32aa95a7 Migrate tests to Spring Boot Test 1.4
Fixes gh-1205
2016-07-22 00:54:48 +02:00
Dave Syer afb43c5883 Actually fix the feign client validation issue
We need to still assert that the FeignClient is valid (no name and
value specified together for instance). Added missing tests.
2016-07-21 10:36:18 +01:00
Dave Syer 85ef54a9a1 Fix Feign validation for Spring 4.2 and 4.3
There is a utility method in Spring that we can use to merge all
the aliases. That way 4.2 and 4.3 behave the same way.

Fixes gh-1192
2016-07-21 08:28:33 +01:00
Dave Syer 2f581a1181 Use JUnit assertions 2016-07-21 08:28:31 +01:00
Dave Syer 110f872779 Fix generic type signature (otherwise breaks with Spring 4.3) 2016-07-21 08:28:27 +01:00
Spencer Gibb 54931afa8b Remove assertion that fails in spring 4.3.x
Need to make this class 4.2.x compatible.

see gh-1192
2016-07-16 10:36:27 -06:00
Ryan Baxter 2bdd2dab78 Merge pull request #1173 from denyska/master
Disable cookie management for RibbonLoadBalancingHttpClient Fixes gh-301
2016-07-14 12:55:32 -04:00
Spencer Gibb 2908323702 Add debug logging that code is setting spring.aop.proxyTargetClass=true
See gh-1105
2016-07-13 18:08:12 -06:00
Ryan Baxter 5d37bfe2fa Merge pull request #1183 from ryanjbaxter/master
Upgrade Eureka to 1.4.10.  Fixes #1180.
2016-07-13 10:26:41 -04:00
Ryan Baxter 0b0bdb17aa Upgrade Eureka to 1.4.10. Fixes #1180. 2016-07-13 09:19:38 -04:00
Spencer Gibb e5b2ae967b Remove phantom spring-cloud-netflix-zuul-server from dependencies pom
fixes gh-1175
2016-07-11 21:49:43 -06:00
Dave Syer c03ae0ab47 Update README with new CLA link 2016-07-11 14:35:10 +01:00
Denys Kurylenko 5d664cd00d Disable cookie management for RibbonLoadBalancingHttpClient Fixes gh-301 2016-07-08 18:48:47 -07:00
Ryan Baxter 00ed67f1b7 Upgrade Eureka to 1.4.9. Fixes #1167. 2016-07-08 10:31:34 -04:00
Spencer Gibb 277ded519d Merge pull request #1156 from brenuart/gh1155
remove Guava ImmutableMap in favour of Collections.unmodifiab…

fixes gh-1155
2016-07-01 16:41:37 -06:00
Spencer Gibb 7835c4047b temporarily comment out FormZuulProxyApplicationTests.postWithMultipartForm 2016-07-01 15:34:46 -06:00
Spencer Gibb ab0af4554c Update to s-c-build 1.2.0 2016-07-01 15:14:19 -06:00
Bertrand Renuart 926414a014 GH1155: remove Guava ImmutableMap in favour of Collections.unmodifiableMap()
Make sanitizeUrlTemplate() protected for easy sub-classing
2016-07-01 14:14:58 +02:00
Spencer Gibb 3991c8c5f7 Allow custom feign clients when not using ribbon.
fixes gh-1143
2016-06-29 12:39:58 -06:00
Spencer Gibb cb4d60ca8d fix typo 2016-06-29 11:39:04 -06:00
Thibaud Leprêtre 7ebe1977d8 Handle context-path on X-Forwarded-Prefix support
Since revision 7b270c4b46, Zuul add support of `X-Forwarded-Prefix` for route with `stripPrefix=true`.
However it supposes that Zuul context-path is equals to `/`. By using a custom context-path on Zuul we can expect that `zuul.add-proxy-headers=true` will compute a prefix regarding that context-path.

Indeed with following architecture:

- Zuul with context-path equals to `/foo`
- A random service (*bar-service*) without context-path

Zuul configurations:

```
zuul:
  add-proxy-headers: true
  routes:
    bar-service: /bar/**
```

We expect that *bar-service* when targeting `http://blabla.com/foo/bar/1`  will produce endpoint url equals to `http://blabla.com/foo/bar` and not only `http://blabla.com/bar` (that will not be resolvable).

Furthermore context-path influence not only `stripPrefix=true` routes because with following configuration

```
zuul:
  add-proxy-headers: true
  routes:
    bar-service:
      path: /bar/**
      strip-prefix: false
```

We expect that *bar-service* when targeting `http://blabla.com/foo/bar/1` will also prodcues endpoint url equals to `http://blabla.com/foo/bar`...

---

Moreover since *Spring 4.3* and new [`ForwardedHeaderFilter`](http://docs.spring.io/spring-framework/docs/4.3.0.BUILD-SNAPSHOT/javadoc-api/org/springframework/web/filter/ForwardedHeaderFilter.html) to handle `X-Forwarded-*` headers, when filter catches `X-Forwarded-Prefix` header it will override request context-path by `X-Forwarded-Prefix` header value and then **removes headers from request**. Thus the fact to support context-path will allow to use that filter with Zuul!

---

Attention there is only one edge case, when `X-Forwarded-Prefix` header is present as same as custom `context-path`! In that case context-path will be ignored in favor to `X-Forwarded-Prefix` as same does `ForwardedHeaderFilter`
2016-06-29 10:37:52 +02:00
Spencer Gibb 5e9c71e0e3 Merge pull request #1138 from orchit/master
* orchit-master:
  Adds ability to disable hostname validation.
2016-06-28 10:33:50 -06:00
Patrick Cornelißen 723287b305 Adds ability to disable hostname validation.
Adds property zuul.sslHostnameValidationEnabled to be able to disable the hostname validation in the simpleHostRoutingFilter

fixes gh-1057
2016-06-28 10:32:49 -06:00
Spencer Gibb 46b2e45fd5 Adds a RibbonRequestCustomizer.
This allows developers to customize the request builders for zuul requests to inject headers or modify the request in general.  Each zuul request type (RestClient, Apache HttpClient and OkHttp) is supported.

fixes gh-1141
2016-06-27 13:15:54 -06:00
Spencer Gibb 390999e042 Add default zuul.ribbon.httpclient.enabled=true 2016-06-24 16:17:33 -06:00
Spencer Gibb 8a7e165214 Split ProxyRequestHelper to function without Actuator.
Previously ProxyRequestHelper contained a TraceRepository field. This caused zuul apps to fail with a class not found exception if they excluded actuator. This splits TraceRepository functionality into a new TraceProxyRequestHelper that extends ProxyRequestHelper. Auto configuration creates the appropriate ProxyRequestHelper based on the existence or not of actuator classes.

fixes gh-1135
2016-06-24 16:08:23 -06:00
Spencer Gibb 5742f5e811 add .shelf to .gitignore 2016-06-24 09:58:30 -06:00
Spencer Gibb 52b6578fcf polish 2016-06-24 09:32:18 -06:00
Spencer Gibb 2f205f20c5 Skip tests that only fail in travis for now. 2016-06-24 09:20:19 -06:00
Spencer Gibb e1df7c3b4d Add back RestClientRibbonCommand api's. 2016-06-24 09:13:18 -06:00
Spencer Gibb 7c2f806745 Add hystrix.stream.queue.size to customize queue size.
Also added descriptions to properties.

fixes gh-1131
2016-06-24 08:41:45 -06:00
Spencer Gibb 6877f0898f Move RestClientRibbonCommand back to original place.
Made it public and undid other refactorings.
2016-06-24 08:15:12 -06:00
Marcin Grzejszczak 74ac6eae8f Made RestClientRibbonCommand public 2016-06-24 09:10:54 +02:00
Spencer Gibb 75610e92a7 added todo 2016-06-23 22:34:34 -06:00
Spencer Gibb 7dc8b86001 Load ribbon classes if defined via properties.
Allows ribbon class name properties to be used to define beans.

This seems like boilerplate, but works, though not easily extensible.

fixes gh-927
2016-06-23 20:20:34 -06:00
Will Tran dfbfcfecc7 Without explicit client config of IsSecure, lookup from registration
instead of defaulting to false.

Fixes gh-1126
2016-06-23 15:12:35 -06:00
Spencer Gibb 7ac81f8fd5 Adds zuul okhttp support & zuul refactor.
Adds a OkHttpRibbonCommand and accomanying classes. They should be
considered beta.

Refactors zuul ribbon command classes and tests.

fixes gh-1125
2016-06-23 12:10:59 -06:00
Spencer Gibb fd36a0cc72 Default to HttpClientRibbonCommandFactory 2016-06-22 21:08:34 -06:00
Spencer Gibb 398c5aa009 upgrade feign to v8.17.0
fixes gh-1081
2016-06-22 15:53:18 -06:00
Spencer Gibb 7a90c0cd88 Set entity contentLength to 0 for GET requests.
Zuul sets an empty entity for GET requests. The apache http client either sets transfer encoding to chunked or a content length header. This change sets the apache entity contentLength to 0 (not the header), to that in RequestContent the "content-length" header is set to 0 rathern than transfer encoding.

See gh-1042
2016-06-22 13:01:51 -06:00
Spencer Gibb cfcca5f881 Set entity contentLength for HttpClientRibbonCommand.
If the content length isn't set on the entity, when http client determines which header to set, it sets transfer-encoding to chunked rather than content-length.

This fixes a missing content-length issue when using `HttpClientRibbonCommandFactory`.

See gh-1042
2016-06-22 13:01:34 -06:00
Spencer Gibb ca67265c79 Merge pull request #1120 from jmirc/master
* pull1120:
  Fix hystrix dashboard TPS.
2016-06-21 15:23:05 -06:00
Jérôme Mirc b422fe297c Fix hystrix dashboard TPS.
fixes gh-1113

See https://github.com/Netflix/Hystrix/issues/1251
2016-06-21 15:21:10 -06:00
Spencer Gibb 856c47138a Don't use deprecated constructor.
Eliminates a legacy use of a static singleton. This will help allow multiple registrations.
2016-06-20 18:27:12 -06:00
Spencer Gibb 83cdf647c9 Angel eureka clients can use brixton eureka servers.
Updates so CloudJacksonJson extension is properly recognized by Eureka
Server as LegacyJacksonJson.

see gh-978
fixes gh-1111
2016-06-17 16:53:44 -06:00
Dave Syer ff46a7dc50 Merge branch '1.1.x'
Conflicts:
	spring-cloud-netflix-dependencies/pom.xml
2016-06-17 15:10:51 +01:00
Dave Syer 9e479481cc Exempt @RequestParams of type Collection from feign expander
It isn't very helpful to have a Collection converted to a String
anyway. We need to implement something new in Feign to apply
the converter (expander) to individual elements in the collection
but this change should get back to the old behaviour with
List<String> at least.

Fixes gh-1115
2016-06-17 14:55:35 +01:00
Spencer Gibb 532627fad2 Merge pull request #1106 from spring-cloud/zuul-122
Upgrade to zuul 1.2.2
2016-06-16 13:58:10 -06:00
Spencer Gibb aa23660d0c Upgrade to zuul 1.2.2
fixes gh-1091
closes gh-958
2016-06-16 13:50:33 -06:00
Spencer Gibb 20db868592 Don't send 4xx errors to /error
fixes gh-1110
2016-06-16 11:47:31 -06:00
Spencer Gibb 02948657a4 Don't send 4xx errors to /error
fixes gh-1110
2016-06-16 11:45:52 -06:00
Spencer Gibb 050c66250c quote var 2016-06-15 17:34:00 -06:00
Spencer Gibb 88ce4fe81b skip source generation 2016-06-15 17:33:50 -06:00
Spencer Gibb e819dd39ca Only install and skip javadoc generation 2016-06-15 17:33:38 -06:00
Spencer Gibb cfb13ac59f quote var 2016-06-15 17:17:52 -06:00
Spencer Gibb 00aee4be00 skip source generation 2016-06-15 17:16:12 -06:00
Spencer Gibb a669975fb0 Only install and skip javadoc generation 2016-06-15 17:09:14 -06:00
Spencer Gibb 161d719dba add *.log to .gitignore 2016-06-15 15:38:13 -06:00
Marcin Grzejszczak ccc75f2978 Bumped up version of cloud-stream to snapshot 2016-06-14 11:24:48 +02:00
Marcin Grzejszczak 8b0598abee Bumped up version of cloud-config to snapshot 2016-06-14 10:50:21 +02:00
Marcin Grzejszczak 31598b4329 Bumped up version of commons to snapshot 2016-06-14 10:37:04 +02:00
Spencer Gibb dd220458f8 polish 2016-06-13 09:46:32 -06:00
Spencer Gibb d4163dde8e Polish 2016-06-13 09:46:32 -06:00
Spencer Gibb 3bd563e495 remove h2 test dep 2016-06-13 09:46:32 -06:00
Dave Syer 525c5852fb Add JAVA_OPTS to travis 2016-06-13 08:40:36 +01:00
Dave Syer 69501bd110 Merge 1.1.x 2016-06-13 08:05:07 +01:00
Dave Syer 95e086a543 Revert change to sources plugin 2016-06-13 07:58:13 +01:00
Dave Syer f6cd2d279d Update README 2016-06-11 10:50:32 +01:00
Dave Syer 9cab69a968 Update readme script to handle local includes 2016-06-11 09:54:41 +01:00
Dave Syer 6906c7ba55 Update to 1.1.3 snapshots 2016-06-10 17:05:29 +01:00
Spencer Gibb 243c13b7ee Make turbine.combineHostPort=true the default.
fixes gh-1087
2016-06-09 16:28:48 -06:00
Spencer Gibb 09cc1f2db0 polish 2016-06-09 13:09:09 -06:00
Spencer Gibb 7d295bdc8b Update to SNAPSHOT 2016-06-09 11:30:39 -06:00
Spencer Gibb b6807fc264 Update SNAPSHOT to 1.1.2.RELEASE 2016-06-09 11:06:25 -06:00
Spencer Gibb b3ef770819 Merge pull request #1024 from jebeaudet/fix-query-string-in-class-requestmapping
* fix-query-string-in-class-requestmapping:
  Support path parms in Class @RequestMapping for feign
2016-06-09 10:45:05 -06:00
Jacques-Etienne Beaudet 726f355e9c Support path parms in Class @RequestMapping for feign
This commit adds the support to SpringMvcContract for path parameters
defined in the class' @RequestMapping Annotation that is applied to all
methods of a feign interface.

fixes gh-1023
2016-06-09 10:44:52 -06:00
Dave Syer ad7e341b78 Clarify turnine config some more 2016-06-09 16:48:03 +01:00
Dave Syer 53a3076e1c Add docs on turbine.combineHostPort 2016-06-09 16:22:20 +01:00
Dave Syer 02d935dbaa Add @ConditionalOnEnabledEndpoint to archaius endpoint
Fixes gh-936
2016-06-09 11:22:47 +01:00
Dave Syer 4507d1d46d Add listener for HeartbeatEvent to refresh zuul routes
Fixes gh-1084
2016-06-09 11:22:47 +01:00
Marcin Grzejszczak 2566707256 Zuul filters missing error status code (#1088)
* Added missing error code for SimpleHostRoutingFilter
* Added missing error code for RibbonRoutingFilter
2016-06-09 10:25:08 +02:00
Spencer Gibb 6b1113e355 Remove condition for eureka healthcheck.
fixes gh-1051
2016-06-08 17:50:58 -06:00
Spencer Gibb de45269ec3 update gradle tip. 2016-06-06 19:16:24 -06:00
Spencer Gibb 479a976459 remove unused property 2016-06-06 19:16:06 -06:00
Spencer Gibb 332b5605d6 Update to SNAPSHOT 2016-06-06 19:11:27 -06:00
Spencer Gibb c3d16ddb30 Update SNAPSHOT to 1.1.1.RELEASE 2016-06-06 18:54:25 -06:00
Dave Syer b6fa67c49f Use Servlet 3.0 Part instead of Spring MultipartFile
So that it can handle multi-part requests that do not have a
file name.

Fixes gh-1067
2016-06-06 14:32:43 +01:00
Dave Syer 1c7c96a245 Add local copies of hystrix images
Fixes gh-1076
2016-06-06 13:54:51 +01:00
Dave Syer 0da6f27aac Explicitly exclude form-body params that appear in query string
Fixes gh-1080
2016-06-06 13:43:18 +01:00
Dave Syer b5f8c73060 Update tp mvn 3.3.9 2016-06-04 09:14:45 +01:00
Spencer Gibb 5e2db65383 Upgrade Hystrix to v1.5.3
fixes gh-1074
2016-06-03 15:44:28 -06:00
Spencer Gibb fc08b55eac Merge pull request #1071 from jebeaudet/fix-hardcoded-path-encoding
* fix-hardcoded-path-encoding:
  Fixed the path encoding in ProxyRequestHelper when the character encoding was specifically set on HttpServletRequest.
2016-06-03 13:28:49 -06:00
Jacques-Etienne Beaudet 8229eb657e Fixed the path encoding in ProxyRequestHelper when the character encoding was specifically set on HttpServletRequest.
When the character encoding was set to UTF-8 for example, the path was correctly decoded in PreDecorationFilter but was reencoded in ProxyRequestHelper using the Servlet default ISO-8859-1. This commit uses the character encoding when set and fallback on default.
2016-06-03 13:24:29 -06:00
Spencer Gibb 1c532d9637 Merge pull request #979 from marcosbarbero/master
* pull979:
  Use request.characterEncoding prior to default encoding
2016-06-03 13:21:06 -06:00
Marcos Barbero c743ba893c Use request.characterEncoding prior to default encoding
fixes gh-647
2016-06-03 13:19:38 -06:00
Spencer Gibb a5eb3b6012 Merge pull request #1046 from venilnoronha/issue-1041-fix
* issue-1041-fix:
  Enables Hystrix metrics poll interval config.
2016-06-03 13:05:53 -06:00
Venil Noronha 2d6306644c Enables Hystrix metrics poll interval config.
Fixes gh-1041
2016-06-03 13:05:43 -06:00
Spencer Gibb 711f095ebc Merge pull request #1059 from acennan/patch-1
* patch-1:
  Support header placeholders in SpringMvcContract.
2016-06-03 12:56:29 -06:00
Damian Jackson 0705c9f540 Support header placeholders in SpringMvcContract.
When using property placeholders in the @RequestMapping annotation the ones placed in the headers attribute do not get replaced. This appears to be because the other attributes, such as the url, use the resolve() function to perform the substitution whereas the header is parsed as-is. This change adds a call to resolve for each side of the equals in the header string so that the properties are substituted correctly.
2016-06-03 12:56:21 -06:00
Spencer Gibb 1e52fe2749 Merge pull request #1061 from daniellavoie/ribbon-2.2.0
* ribbon-2.2.0:
  Upgrade ribbon to 2.2.0
2016-06-03 12:28:19 -06:00
Daniel Lavoie 65e7650b16 Upgrade ribbon to 2.2.0
fix gh-1045
2016-06-03 11:22:52 -06:00
Spencer Gibb cc16a7a741 Mark @HystrixConnectionFactory as @Deprecated. 2016-06-03 11:22:17 -06:00
Spencer Gibb 9d3f2d0cfd revert to old .travis.yml 2016-05-27 18:31:00 -06:00
Spencer Gibb 0cc3fe6ab4 reduce logging more 2016-05-27 18:15:36 -06:00
Spencer Gibb 9e03342690 travis logs filling up, switch to INFO 2016-05-27 18:13:04 -06:00
Spencer Gibb 8501969643 don't fork jar plugin so it gets Xmx setting. 2016-05-27 17:54:47 -06:00
Spencer Gibb 0f5d8ec2a6 revert 2016-05-27 17:40:38 -06:00
Spencer Gibb 7c084f855f I'm an idiot and should now stop coding. 2016-05-27 17:32:00 -06:00
Spencer Gibb af26f0f41e attempt to fix build 2016-05-27 17:28:08 -06:00
Spencer Gibb 1c0e44cc8e attempt to fix build 2016-05-27 17:26:30 -06:00
Spencer Gibb e0ae584ea7 attempt to fix build 2016-05-27 17:14:22 -06:00
Spencer Gibb ab056f3190 attempt to fix build 2016-05-27 17:06:43 -06:00
Spencer Gibb 16e827f3ba Merge branch 'daniellavoie-fix-unit-test' 2016-05-27 16:36:38 -06:00
Daniel Lavoie 4fd36592dc Fix RestTemplateRetryTest Unit test 2016-05-27 16:29:26 -06:00
Dave Syer 4a1e637b83 Fix content type when missing from incoming request
If there is no content type incoming, then it should be
absent in the outgoing request (not "null").

Fixes gh-1037
2016-05-24 09:02:48 +01:00
Spencer Gibb d19a6f2615 Use RouteLocator interface.
fixes gh-1030
2016-05-23 16:07:08 -06:00
Spencer Gibb c3f1210619 set MAVEN_OPTS = -Xms256m -Xmx1024m 2016-05-23 15:08:13 -06:00
Spencer Gibb 56fddcc5e2 remove trusty from travis 2016-05-23 14:42:15 -06:00
Spencer Gibb 2567e60834 Upgrade to eureka v1.4.8
fixes gh-1044
2016-05-23 14:15:42 -06:00
Spencer Gibb 315e3487a9 try to fix travis build 2016-05-23 12:50:43 -06:00
Spencer Gibb f040726478 try to fix travis build 2016-05-23 12:47:54 -06:00
Spencer Gibb 27bb2cf826 update to dist trusty to get new jdk version 2016-05-23 12:35:25 -06:00
Spencer Gibb 2ff2ce4de4 Only prepend hostname if it has text 2016-05-23 12:17:06 -06:00
Spencer Gibb 69fd8e7eed Merge pull request #1043 from ryanwmoore/master
Fix minor misspelling in docs
2016-05-23 11:22:31 -06:00
Ryan W. Moore 66387a15b7 Fix minor misspelling in docs 2016-05-23 09:55:58 -04:00
Dave Syer a0c1b4c05d Align instanceId calculation with the one done on the client
The Angel client has an idiosyncratic way of calculating an instance
id, and the Brixton client aligned with that already, but the
Brixton server did not. This change should make Brixton Eureka
Servers work with Angel clients.

See gh-978
2016-05-18 17:32:26 +02:00
Dave Syer d5252375e1 Add back versions for deprecated *-amqp jars 2016-05-17 17:41:13 +01:00
Dave Syer 880efd1843 Remove @AliasFor from @FeignClient.serviceId()
The way it was being used internally means that we didn't need the
annotation anyway. It would be nice to have it back if the Spring
issue gets resolved, because then we could actually use it as
intended.

Fixes gh-1025
2016-05-17 15:33:42 +01:00
Dave Syer 9823d07817 Revert "Add support in SpringMvcContract for query string in Class @RequestMapping"
This reverts commit 2c502e3997.
2016-05-17 15:26:34 +01:00
Dave Syer 2b58487ad7 Fix typo Sream->Stream 2016-05-17 12:10:18 +01:00
Jacques-Etienne Beaudet 2c502e3997 Add support in SpringMvcContract for query string in Class @RequestMapping
This commit adds the support for query string defined in the class'
@RequestMapping Annotation that is applied to all method of a
controller.

Fxies gh-1023, fixes gh-1024
2016-05-17 12:08:49 +01:00
Dave Syer 32d481df26 Be defensive about classpath in eureka auto config
Before this change we were seeing test failures in
spring-cloud-netflix-eureka-server (but only with Spring Boot 1.4)
caused by annotation processing explosion when
RefreshScopeAutoConfiguration is not on the classpath.
2016-05-16 12:46:03 +01:00
Dave Syer b084eb03ff Re-instate .settings.xml for Travis 2016-05-12 11:34:36 +01:00
Dave Syer 043a965db3 Update README and remove .settings.xml where appropriate 2016-05-12 10:47:36 +01:00
Marcin Grzejszczak 65b4b0310b Update runAcceptanceTests.sh 2016-05-11 14:30:32 +02:00
Dave Syer 5d50a773e7 Make test more robust by creating feign clients and validating them
This test should run with Spring Boot 1.4.0.M2 now.

See https://github.com/spring-projects/spring-boot/issues/5870
2016-05-11 10:22:57 +01:00
Dave Syer c399f1117b Revert to snapshots 2016-05-10 17:09:04 +01:00
Dave Syer d9327a02a2 Update for 1.1.0.RELEASE 2016-05-10 17:00:17 +01:00
Dave Syer 617ecf11ec Track customization of sensitive headers so route can be cleared
When the users explicitly sets the sensitive headers of a rroute to
empty, it means they should be empty, not the global defaults.

Fixes gh-1012
2016-05-09 11:47:41 +01:00
Spencer Gibb 83caebf384 Merge pull request #983 from venilnoronha/issue-966-fix
* issue-966-fix:
  Adds path parameter to @FeignClient.
2016-05-06 14:06:34 -06:00
Venil Noronha d3cba4d80e Adds path parameter to @FeignClient.
Fixes gh-966
2016-05-06 14:06:22 -06:00
Spencer Gibb 654ea7094c Merge pull request #1010 from shakuzen/patch-1
Typo fixes
2016-05-06 11:43:06 -06:00
Tommy Ludwig 52a3974a78 Typo fixes 2016-05-07 02:36:42 +09:00
Dave Syer cbd398d7f6 Add explicit release disabled flag for artifactory for plugins 2016-05-06 18:09:41 +01:00
Dave Syer 12f3edd4ab Add explicit release disabled flag for artifactory in dependencies 2016-05-06 17:59:37 +01:00
Spencer Gibb 76f292a6ba Merge pull request #1007 from shivangshah/master
* pull1007:
  Updating RxJava version to 1.1.5 This update on RxJava version is in regards to the PR that got merged [`here`](https://github.com/ReactiveX/RxJava/pull/3820) for making RxJavaPlugins' `reset` method to be public. We have to work this around in Spring Sleuth. Details on the implementation can be found [`here`] (https://github.com/spring-cloud/spring-cloud-sleuth/pull/243).
2016-05-06 10:58:59 -06:00
Shivang Shah 9ce9d670c9 Updating RxJava version to 1.1.5
This update on RxJava version is in regards to the PR that got merged [`here`](https://github.com/ReactiveX/RxJava/pull/3820) for making RxJavaPlugins' `reset` method to be public. We have to work this around in Spring Sleuth. Details on the implementation can be found [`here`] (https://github.com/spring-cloud/spring-cloud-sleuth/pull/243).

1.1.5
2016-05-06 10:55:03 -06:00
Spencer Gibb 4888299b28 polish 2016-05-06 10:54:29 -06:00
Dave Syer e4f3428344 Add explicit release disabled flag for artifactory 2016-05-06 17:47:14 +01:00
Dave Syer c4e879ea96 Switch parent of docs poms 2016-05-06 17:40:09 +01:00
Dave Syer 83235b13c1 Update parent to 1.1.0.RELEASE 2016-05-06 17:13:33 +01:00
Dave Syer 5de52b96f4 Some changes to help with Spring Boot 1.4 compatibility
The jackson version needs to be explicit (not in parent potentially)
and there is a weirdness with @RequestMapping in Spring 4.3
2016-05-05 16:55:09 +01:00
Spencer Gibb 2aedd9b27b Merge pull request #1004 from jebeaudet/fix-IgnoredHeadersCasingNotIgnored
* fix-IgnoredHeadersCasingNotIgnored:
  Sensitive headers set in PreDecorationFilter no longer override previously set ignored headers. Removed the case sensitiveness when the sensitive headers are set. Fixes https://github.com/spring-cloud/spring-cloud-netflix/issues/1003
  Test for default ribbon client configuration
  Tidy up more compiler warnings for generics
  Add note to clarify that zuul starter does not include discovery
2016-05-04 14:19:18 -06:00
Jacques-Etienne Beaudet ea1a4c5add Sensitive headers set in PreDecorationFilter no longer override previously set ignored headers.
Removed the case sensitiveness when the sensitive headers are set.
Fixes https://github.com/spring-cloud/spring-cloud-netflix/issues/1003
2016-05-04 13:40:21 -04:00
Dave Syer 88864153eb Test for default ribbon client configuration 2016-05-04 08:50:57 +01:00
Dave Syer 9ad3d21b75 Tidy up more compiler warnings for generics 2016-05-03 11:53:22 +01:00
Dave Syer 1c9d11de23 Add note to clarify that zuul starter does not include discovery
Fixes gh-992
2016-05-03 10:05:44 +01:00
Spencer Gibb 860d7b8446 Log warning if ServoMonitorCache size exceeds threshold.
Fixes gh-947
2016-05-02 12:27:33 -06:00
Sébastien PERALTA 5613e48141 Append to X-Forwarded-Prefix in case it already exists
Fixes gh-993
2016-04-28 13:22:38 +01:00
Dave Syer 3a251e2a38 Revert "Use the original query string when forwarding the request"
This reverts commit 8952cff24d.
2016-04-28 12:03:10 +01:00
Dave Syer c7c191c01e Ensure Servo metrics are exported the same as default metrics
Adds an `@ExportMetricReader` which was missing before and
led to people losing their metric exports when they had Servo
on the classpath.

Also allow servo metrics autoconfiguration to be disabled via
a flag netflix.metrics.servo.enabled=false (as an alternative to
excluding the class in `@EnableAutoConfiguration`).
2016-04-28 11:57:00 +01:00
Dave Syer e0bc9d11f1 Update docs for Turbine AMQP -> Stream 2016-04-27 14:21:05 +01:00
Dave Syer 6087bc755a Use eureka.instance zone data consistently determining client zone
The zone for a remote server comes from its
eureka.instance.metadataMap.zone, but we didn't (until this change)
apply the same logic to the client. If the client is registering
itslef with eureka then it will have a metadataMap itself and
we should be able to just reverse the logic.

Fixes gh-991
2016-04-27 09:10:42 +01:00
Nicolas Byl 8952cff24d Use the original query string when forwarding the request
to ensure compatibility with legacy apps

Fixes gh-989
2016-04-26 17:31:22 +01:00
Andrei Sfat 1c3de94c42 Add slash to eureka.client.service-url
Makes use of StringUtils.commaDelimitedListToStringArray

Fixes gh-980
2016-04-26 12:14:52 +01:00
Andrei Sfat 9bd3a66b16 #920 add slash when eureka.client.service-url.defaultZone does not contain one 2016-04-26 12:14:41 +01:00
Dave Syer 314d229ccf Add @ConditionalOnEnabledHealthIndicator("hystrix")
Users will have to switch from health.hystrix.enabled to
management.health.* for consistency with other health
indicators.

Fixes gh-985
2016-04-26 09:13:06 +01:00
Matt Reynolds 5c2937b05c filter basic auth credentials from Eureka replica data for display
so they don't appear on the dashboard

Fixes gh-974
2016-04-26 09:05:52 +01:00
Spencer Gibb d1a31a9a2b Upgrade feign to 8.16.2
fixes gh-987
2016-04-25 15:31:55 -06:00
Spencer Gibb 5acf4e1a2e Throw IOException in RibbonLoadBalancerClient.execute
Fixes proper RestTemplate behavior.

fixes gh-986
2016-04-25 13:48:00 -06:00
Pedro Alvarado 2b40952429 Add support for placeholders to Feign spring-mvc RequestMapping annotation.
Fixes gh-894
2016-04-25 11:01:26 +01:00
Dave Syer 8b306df132 Use @PropertySource instead of @Bean for http encoder properties
Protects us against changes in Spring Boot 1.4 where the naming
convention changes.
2016-04-20 14:34:44 +01:00
Dave Syer 8a4fb82b98 Remove reference to 'parent' poms in BOM 2016-04-20 14:20:29 +01:00
Spencer Gibb e0c67b30f8 Pass headers back to feign request.
Spring HttpMessageConverters can modify headers. This change passes the modified headersr back to the feign request, so the proper headers are sent on the request.

 fixes gh-977
2016-04-20 06:46:23 -06:00
Spencer Gibb 33efc60de7 remove spring-cloud-connectors version 2016-04-20 06:42:06 -06:00
Dave Syer 5fc76aaa72 Fix javadocs in @FeignClient
The descriptions of name/serviceId/value and url were out of date
(name is mandatory now and can be mixed with url).
2016-04-19 14:58:59 +01:00
Dave Syer 24579f67e2 Revert to snapshots 2016-04-18 14:07:42 +01:00
Dave Syer d99196aeb1 Update to RC2 2016-04-18 14:02:49 +01:00
Spencer Gibb 7c531eb411 Upgrade Hystrix to 1.5.2
fixes gh-968
2016-04-12 21:57:12 -06:00
Spencer Gibb df5303912f Add global zuul sensitiveHeaders option.
Route specific sensitiveHeaders override global.

fixes gh-944
2016-04-08 10:38:24 -06:00
Spencer Gibb 4479a2b2ee Merge pull request #945 from tkvangorder/master
* pull945:
  Ribbon retry works & fix Content-Length error.
2016-04-07 16:15:23 -06:00
Tyler Van Gorder 05351b7809 Ribbon retry works & fix Content-Length error.
This change requires setting `ribbon.http.client.enabled=true`.

This change addresses issue #648 Getting Retry Working In RestTemplate. There is also a fix in place that addresses the issue #357 RestTemplate Error.

fixes gh-648
2016-04-07 16:15:03 -06:00
Spencer Gibb a3ab3259e3 Make RibbonClientHttpRequestFactory disabled by default.
fixes gh-961
2016-04-07 15:10:39 -06:00
Spencer Gibb e87d9432c7 Merge pull request #883 from aivans/master
* pull883:
  Send 404 in zuul servlet when no route is found.
2016-04-07 13:44:40 -06:00
Adrian Ivan d0841f792e Send 404 in zuul servlet when no route is found.
Fixes false 200 in zuul when using zuul servlet rather than mvc servlet.

Fixes gh-865
2016-04-07 13:44:29 -06:00
Spencer Gibb cef3777313 Upgrade RxJava to v1.1.2
fixes gh-957
2016-04-05 17:16:44 -06:00
Spencer Gibb 0e2d8c1a11 Update feign to v8.16.0
fixes gh-956
2016-04-05 17:12:12 -06:00
Spencer Gibb c055bd5327 Update archaius to v0.7.4
fixes gh-955
2016-04-05 17:05:33 -06:00
Spencer Gibb 3f8c4834a3 Upgrade to ribbon 2.1.5
fixes gh-954
2016-04-05 17:00:42 -06:00
Tim te Beek 593549551a Set or append to X-Forwarded-For for downstream requests
Fixes gh-352
2016-04-05 15:42:56 +01:00
Spencer Gibb c0d767351a Remove need for http basic auth client filter.
https://github.com/Netflix/eureka/releases/tag/v1.4.5

restores http basic auth.
2016-04-04 12:13:24 -06:00
Spencer Gibb 0b9ea25d86 Use config client default service id constant. 2016-04-04 11:53:12 -06:00
Dave Syer fcd0feb61e Ensure whitespace is stripped from appConfig in turbine
Fixes gh-948
2016-04-04 16:59:44 +01:00
Spencer Gibb 1c4db22c28 Angel metadata.instanceId works with Brixton
Fixes gh-642
2016-04-01 13:02:43 -06:00
Spencer Gibb bdc5b915e8 Merge pull request #933 from tkvangorder/master
* pull933:
  Adding the ability to specify a custom retry handler in the ribbon client configuration.
2016-03-31 11:37:45 -06:00
Tyler Van Gorder 983221a710 Adding the ability to specify a custom retry handler in the ribbon client configuration.
fixes gh-931
2016-03-31 11:36:57 -06:00
Spencer Gibb 1cf7ac9260 Upgrade to eureka 1.4.6
fixes gh-932
2016-03-29 16:07:12 -06:00
Marcin Grzejszczak b3a8b1df38 Removed an import 2016-03-25 13:59:48 +01:00
Marcin Grzejszczak cd42566daf Added tests for HystrixStream 2016-03-25 13:57:52 +01:00
Dave Syer 5d2065b3e7 Add some javadocs to ZuulProperties 2016-03-24 12:31:51 +00:00
Dave Syer c57a758e91 Update to Eureka 1.4.5 2016-03-24 09:58:21 +00:00
Spencer Gibb 892eea752b Lazily look up MetricsClientHttpRequestInterceptor in BPP.
fixes gh-912
2016-03-23 12:00:06 -06:00
Marcin Grzejszczak 3f9e76b876 Revert to snapshots 2016-03-23 12:43:41 +01:00
Marcin Grzejszczak 29988b5f58 Bump for 1.1.0.RC1 2016-03-23 12:38:05 +01:00
Spencer Gibb 951758ef30 Update mvnw to determine profile on mac and linux 2016-03-22 12:37:15 -06:00
Spencer Gibb d8da9af29d try and fix LoadBalancerFeignClientOverrideTests 2016-03-21 18:40:39 -06:00
Spencer Gibb d774847d00 try and fix LoadBalancerFeignClientOverrideTests 2016-03-21 18:10:12 -06:00
Spencer Gibb 5e38ae1234 polish 2016-03-21 17:54:50 -06:00
Spencer Gibb 67b6eafbf0 Use ribbon configuration for ReadTimeout & ConnectTimeout.
Allows feign/ribbon users to use standard config files rather than creating a bean of Request.Options.

fixes gh-696
2016-03-21 17:23:21 -06:00
Spencer Gibb 08f7076f6e Mark @FeignClient beans as primary.
When fallback beans are created, there was no longer a unique bean of the feign interface which caused autowire problems.

fixes gh-899
2016-03-16 17:01:45 -06:00
Spencer Gibb b9a6876d00 Upgrade ribbon to 2.1.3
fixes gh-908
2016-03-16 14:36:52 -06:00
Spencer Gibb f76675a561 Upgrade ribbon to 2.1.1
fixes gh-907
2016-03-16 13:20:36 -06:00
Spencer Gibb cae1379440 Merge pull request #903 from marcpa00/patch-1
Typo in example code for `DiscoveryClient`
2016-03-14 14:54:57 -06:00
Marc Paquette a7e34d706d Typo in example code for DiscoveryClient
`DiscoveryClient` field declared with name `discoveryClient` but `serviceUrl()` method uses `client`.
2016-03-14 16:31:20 -04:00
Spencer Gibb 2bca3504cd Merge pull request #778 from jmnarloch/rxjava-stream
* rxjava-stream:
  Spring Mvc RxJava integration.
2016-03-14 14:14:53 -06:00
Jakub Narloch bca86191b3 Spring Mvc RxJava integration.
Support for Single via a ReturnValueHandler.
Support for Observable via SseEmitter.
2016-03-14 14:14:06 -06:00
Spencer Gibb 0f61521c2d Upgrade eureka to 1.4.4
fixes gh-902
2016-03-14 10:56:11 -06:00
Spencer Gibb 37357d4d80 Update jersey to 1.19.1
fixes gh-749
2016-03-14 10:48:11 -06:00
Spencer Gibb 38644689c5 Merge pull request #901 from mduesterhoeft/patch-1
typo fixed
2016-03-14 09:10:46 -06:00
Mathias Düsterhöft 615d860f82 typo fixed 2016-03-14 11:48:22 +01:00
Spencer Gibb 074b2e6ecb Merge pull request #841 from mbenson/feignExpanders
* feignExpanders:
  Where a given String conversion is supported, register Feign Param.Expanders backed by a Feign-specific FormattingConversionService.
2016-03-11 17:03:20 -07:00
Matt Benson a71e13ef07 Where a given String conversion is supported, register Feign Param.Expanders
backed by a Feign-specific FormattingConversionService.
2016-03-11 17:03:04 -07:00
Spencer Gibb b8f11e79c6 Atlas no longer requires a RestTemplate bean.
fixes gh-881
2016-03-10 18:13:20 -07:00
Spencer Gibb 4f31596e4f Fallback to server.port if management.port not set.
See gh-896
2016-03-10 17:30:46 -07:00
Spencer Gibb a1857556ed Put min/max constraints on sidecar.port 2016-03-10 12:54:33 -07:00
Spencer Gibb 802482fff3 Allow CommonsInstanceDiscovery to resolve multiple services on a single host.
fixes gh-897
2016-03-10 11:54:03 -07:00
Dave Syer 371edbf827 Prevent possible memory leak with archaius 2016-03-09 16:58:31 +00:00
Jean-Eric Cuendet f8df337893 Verify that the stream is more than ZERO bytes before un-gzipping
Fixes gh-891
2016-03-09 13:47:16 +00:00
Spencer Gibb 3c8a0d0edb Upgrade feign to 8.15.1 2016-03-08 20:39:10 -07:00
Spencer Gibb 7f9d453afe Merge pull request #884 from spring-cloud/issues_feign_broken_vnd_content_type
8.15 version of Feign breaks VND content types
2016-03-08 20:39:03 -07:00
Marcin Grzejszczak 69a705731b Added Sonar support 2016-03-08 22:10:26 +01:00
Spencer Gibb 4aa156773c Upgrade eureka to 1.4.3
fixes gh-886
2016-03-08 12:27:32 -07:00
Marcin Grzejszczak 61e9d0723c Test to prove the issue 2016-03-08 14:36:37 +01:00
Dave Syer 2670890845 Whitespace 2016-03-08 08:18:38 +00:00
Spencer Gibb 48c9d48789 Upgrade Hystrix to 1.5.1
fixes gh-882
2016-03-07 23:09:02 -07:00
Spencer Gibb a913369dd0 Upgrade feign version to 8.15.0
fixes gh-880
2016-03-07 14:31:44 -07:00
Spencer Gibb eed5a6f10b Test RestTemplate with ribbon when metrics are enabled. 2016-03-07 14:08:27 -07:00
Spencer Gibb 0634c4bc37 Disabling the metrics interceptor fixes the tests.
I'm not sure that is a good thing though.
2016-03-07 12:30:39 -07:00
Dave Syer 8375e3b444 Adapt to changes in commons that put onus on user with @LoadBalanced 2016-03-07 18:04:10 +00:00
Spencer Gibb 790ac76a48 Change type of loadBalancerClient back LoadBalancerClient. 2016-03-04 11:21:43 -07:00
Dave Syer 1d1ad75afb Allow double-encoded JSON (as sent by Angel clients) in turbine
Fixes gh-873
2016-03-04 17:42:33 +00:00
Dave Syer 5bd18e4567 Mostly whitespace 2016-03-04 14:30:11 +00:00
Dave Syer bda11adfd5 Ensure content type is application/json
For compatiblity with Angel streams we only need to set the content
type explicitly.

Fixes gh-873
2016-03-04 13:28:40 +00:00
Dave Syer 000fee96aa Use "=" as separator in @RequestMapping(headers=...)
Consistent with Spring MVC (and untested up to now apparently).

Fixes gh-874
2016-03-04 09:38:31 +00:00
Dave Syer 718cafcd04 Add X-Forwarded-Port explicitly for Tomcat (and other servers)
Fixes gh-872
2016-03-03 11:29:30 +00:00
Dave Syer 908dcc0ec8 Support for multivalued map of file uploads
i.e. user sends multiple files with the same parameter name.

Fixes gh-870
2016-03-03 09:33:07 +00:00
Spencer Gibb 4f6b2bceae Record load balancer stats in RibbonHttpRequest.
fixes gh-731
2016-03-02 21:38:51 -07:00
Spencer Gibb 472b9d1757 Don't run PreDecorationFilter if serviceId already set.
fixes gh-695
2016-03-02 18:25:52 -07:00
Spencer Gibb 8a2a608af0 Add zuul.removeSemicolonContent to enable matrix params.
fixes gh-542
2016-03-02 15:24:04 -07:00
Spencer Gibb 60f4a5bc13 Move o.s.c.util to o.s.c.commons.util 2016-03-02 11:04:21 -07:00
Dave Syer a5d839fe44 Fix mvnw script for milestones 2016-03-02 17:34:26 +00:00
Dave Syer 9ea64308cb Add Authorize to sensitive headers in zuul proxy 2016-03-02 16:17:01 +00:00
Spencer Gibb b8cbf4e637 Don't debug body if zuul servlet or if disabled.
fixes gh-857
2016-03-01 16:20:54 -07:00
Spencer Gibb 2808162037 Upgrade Hystrix to 1.4.24
Upgrade RxJava to 1.1.1

fixes gh-866
2016-03-01 15:29:01 -07:00
Spencer Gibb 9e0d8cae17 Support HttpEntity not just ResponseEntity
fixes gh-859
2016-02-29 10:55:04 -07:00
Spencer Gibb b6fef04761 Preserve upstream character encoding. Only default to UTF-8 if not set.
fixes gh-530
2016-02-26 14:43:12 -07:00
Spencer Gibb b1bcf483c9 polish 2016-02-25 17:31:35 -07:00
Dave Syer d2e004dc68 Add support for "sensitiveHeaders" in zuul.routes
By default we now discard all Set-Cookie and Cookie headers. User
can manipulate it per route via zuul.routes.*.sensitiveHeaders, or
globally via zuul.ignoredHeaders.
2016-02-25 16:51:22 +00:00
Dave Syer 40361f1b8e Add whitelist hosts and sensitive headers 2016-02-25 12:57:33 +00:00
Dave Syer 17eb2f8d91 Refer to correct config props object in docs 2016-02-25 11:53:38 +00:00
Spencer Gibb 727ea4d473 Upgrade eureka to 1.4.2
fixes gh-854
2016-02-24 17:20:17 -07:00
Spencer Gibb 46fa2110da Use default instanceid for sidecar
fixes gh-847
2016-02-24 13:48:14 -07:00
Dave Syer ca81f5671a Add HTTP basic back to Eureka client
Latest Eureka from Netflix uses a different HTTP client, and it
ignores the HTTP basic credentials in a service URL. This change
partially restores the old behaviour by providing an interceptor
(ClientFilter) that has a single, global username/password
taken from the first serviceUrl that contains credentials.

Fixes gh-849
2016-02-24 17:57:52 +00:00
Dave Syer bc0eef9ae2 Exclude jackson XML from eureka client by default
Any client that wants to can include it back again, but generally
it only causes problems (XML returned from apps instead of
JSON by Spring MVC for instance). In general it only causes problems
for services whose clients use "Accept: application/xml,*/*", for
instance (like a browser).

See gh-306
2016-02-24 09:34:12 +00:00
Dave Syer 093354e231 Check if client is in bootstrap and default to not register
Eureka now has the option (maybe always there) to not register
and that's a sensible default in the bootstrap phase (when we
might not know the port yet).
2016-02-24 09:14:29 +00:00
Dave Syer d5f6dbe118 Revert "Add Feign expanders based on Spring conversion service"
This reverts commit 3f34ccc8fb. We
need to discuss a bit more (that thread local is probably unavoidable
given the design of Feign, but I don't like it yet).

See gh-841
2016-02-23 17:21:45 +00:00
Dave Syer 41c364002f Encode query params in Zuul filter
Some slightly tricky manipulation involved here, but hopefully
UriTemplate to the rescue.

Fixes gh-682
2016-02-23 15:19:23 +00:00
Matt Benson 3f34ccc8fb Add Feign expanders based on Spring conversion service
Automatically registers Spring conversion-based Feign Expanders
when available

Fixes gh-841
2016-02-23 11:50:23 +00:00
Matt Benson 05305568ff Parameter name discovery using compiler parameters
Spring MVC Feign Contract did not support parameter name fallback
for the #value() attributes of known parameter annotations. Makes
this feature available when the interface has been compiled with
the Java 8 -parameters compiler arg

Fixes gh-835
2016-02-23 11:42:40 +00:00
Matt Benson c3766720fa Parameter name discovery for Feign clients
Supports Spring REST parameter annotations considered
only #value() members without respecting @AliasFor meta-annotations.
Address by passing a Spring-synthesized annotation to individual
AnnotatedParameterProcessors. This approach has the benefit of impacting
present as well as any future implementations alike.

Fixes gh-828
2016-02-23 11:39:49 +00:00
Dave Syer c3efcbabb8 Fix links to client code 2016-02-23 10:28:51 +00:00
Dave Syer 79b7480f4f Move servlet detection filter to ZuulConfiguration
It seems like a generic feature to me (not specific to the proxy),
so logically it should live in the base class.

Fixes gh-844
2016-02-23 10:02:54 +00:00
Dave Syer 1a96e594f0 Do not override register() method in instance registry
The super class deals with syncing to peers, so we need that
call. It still delegates to the other register method and seems
to work just fine without the override.

Fixes gh-838
2016-02-23 09:49:16 +00:00
Dave Syer 32b3ca4159 Set registration retries to non-zero by default if peered 2016-02-23 09:49:16 +00:00
Spencer Gibb aa2d0eb442 Merge pull request #797 from AndreasKl/simplefilter-connection-settings-config
* simplefilter-connection-settings-config:
  Add the ability to configure the max connections and max per route on PoolingHttpClientConnectionManager.
2016-02-22 17:41:18 -07:00
Andreas Kluth 65bf3bb6ee Add the ability to configure the max connections and max per route on PoolingHttpClientConnectionManager. 2016-02-22 17:39:31 -07:00
Spencer Gibb bfd4efcd94 Ignore EurekaHealthIndicator (boot) in EurekaHealthCheckHandler (eureka).
See corresponding change in s-c-commons https://github.com/spring-cloud/spring-cloud-commons/commit/539a537abba58ed2261c4485d7f9426d2aa57453

fixes gh-643
2016-02-22 17:01:57 -07:00
Spencer Gibb c1704235b4 polish 2016-02-22 15:23:24 -07:00
Spencer Gibb 572220ae1f Default secureVirtualHostName to spring.application.name.
See gh-826
2016-02-22 14:04:53 -07:00
Dave Syer 48913cbb64 Add zuul.ignoredHeaders configuration hook
User can exclude headers (generally in responses is most useful)
by configuring them, or calling a setter in ZuulProperties.

If Spring Security is on the classpath we add a few headers
automatically, corresponding to the ones that would be added
by Spring Security in the remote backend anyway (so they are not
added twice). Nothing is actually removed, so if the remote
service doesn't add those headers, we don't change anything.

The X-Application-Context header is also added to the hard coded
list of ignored headers, because it isn't relevant in the
gateway (and leaks information about the remote service).

Fixes gh-819
2016-02-22 13:23:24 +00:00
Spencer Gibb 86ac0127a5 Upgrade eureka to 1.4.1
Plus polish

fixes gh-836
2016-02-19 17:01:40 -07:00
Dave Syer 104361608c Whitespace tidy up 2016-02-18 10:43:28 +00:00
Dave Syer c291358858 Add additional null check for uri
Fixes gh-803 (again)
2016-02-18 10:42:45 +00:00
Dave Syer 86d515282e Import the autoconfig for server properties
Otherwise there can be duplicate beans with the same type and different
names, becasue the autoconfig does not (for some reason) use
@EnableConfigurationProperties to create the ServerProperties bean.

It isn't an issue until someone writes some autoconfig that itself
imports the ZuulConfiguration (i.e. regular concious users of
@EnableZuulServer do not see any problems and hence no tests fail
here or in integration projects).

Fixes gh-821
2016-02-15 15:58:50 +00:00
Nicolas Byl 67258446f9 Improved query string handling to present empty keys correctly
I.e. show empty "foo" as foo (not foo=)

Fixes gh-825
2016-02-15 10:35:41 +00:00
Dave Syer 5c2919074f Set -Pmilestone automatically based on pom version 2016-02-12 17:45:17 +00:00
Dave Syer 68682ce48a Make grep quiet when setting env vars 2016-02-12 15:48:42 +00:00
Dave Syer 81dd95457f Fix logic with MVN_GOAL 2016-02-12 15:06:20 +00:00
Dave Syer 90e7fd8d74 Align travis build with tools in spring-cloud/build 2016-02-12 13:23:19 +00:00
Dave Syer d66cae9c49 Fix spelling 2016-02-11 22:13:22 +00:00
Dave Syer 2323512304 Clarification regardinff shared interfaces in server and client 2016-02-11 22:09:54 +00:00
Spencer Gibb 213df388f3 Upgrade feign to 8.14.4
fixes gh-822
2016-02-11 08:53:22 -07:00
Spencer Gibb 47747f3256 Polish and extensibility 2016-02-09 16:28:57 -07:00
Spencer Gibb 834dfe22dd Handle ClientException.SERVER_THROTTLED as 503
fixes gh-406
2016-02-09 16:02:18 -07:00
Spencer Gibb 1b190a32bd refactored zuul proxy tests 2016-02-09 15:02:31 -07:00
Spencer Gibb 57ebc6344c Upgrade eureka to 1.3.8
fixes gh-813
2016-02-05 12:52:04 -07:00
Dave Syer 443406f75f Revert to snapshots 2016-02-05 07:24:05 +00:00
Dave Syer 61ef6dd511 Update to 1.1.0.M5 2016-02-05 07:23:28 +00:00
Dave Syer e660cbd6ee Put repository declarations back 2016-02-05 06:47:14 +00:00
Dave Syer 8fa249bab8 Remove duplicate distribution mgmt from pom 2016-02-05 06:41:36 +00:00
Spencer Gibb 3524f414ff Upgrade servo to 0.10.1
fixes gh-809
2016-02-04 14:21:55 -07:00
Marcin Grzejszczak ad7921e32c Merge pull request #811 from spring-cloud/feign_upgrade
Upgrading feign
2016-02-04 19:07:03 +01:00
Marcin Grzejszczak 90d0725fe0 Upgrading feign 2016-02-04 11:26:34 +01:00
Dave Syer c784ff1bc3 Add bin dir to ignores 2016-02-03 16:01:42 +00:00
Dave Syer d5277925bc More Zuul context resets 2016-02-03 10:24:12 +00:00
Dave Syer 5b86b57771 Rename a test so it gets run in CI
Also does not rename another one because it fails (see gh-804). The
bug can be fixed in feign (https://github.com/Netflix/feign/pull/324),
and if that gets merged and released we can revert some of the recent
changes to the apache load balancer here.
2016-02-03 10:23:05 +00:00
Spencer Gibb c2483cbe4e Upgrade feign to 8.14.2
fixes gh-807
2016-02-02 12:55:30 -07:00
Spencer Gibb 9c3010074d Update readme for code of conduct.
See https://github.com/spring-cloud/spring-cloud-build/issues/26
2016-02-01 19:59:30 -07:00
Spencer Gibb 199c740c17 Merge pull request #802 from herder/patch-1
Fix typo: zule-core -> zuul-core.
2016-02-01 15:22:13 -07:00
Spencer Gibb 63896485b0 Fix broken zuul tests. 2016-02-01 15:01:28 -07:00
Spencer Gibb 01fc27cb49 Temporarily ignore failing test so snapshots can build. 2016-02-01 12:51:35 -07:00
Spencer Gibb 3611edd1a0 Merge pull request #800 from brharrington/spectator-issue-264
* spectator-issue-264:
  fix registration bug in SpectatorMetricServices
2016-02-01 12:33:23 -07:00
Brian Harrington 63b0c8c67d fix registration bug in SpectatorMetricServices
The primary change is to fix a memory leak reported in
Netflix/spectator#264. Each time a gauge was updated it
was creating a new registration and because the map holds
a strong reference these would never get collected.
Further, the aggregate value created by the multiple
registrations was not correct.

In addition I added some test cases around the various
inputs and checked that the results were reflected as
expected in the registry. I noticed the timer values
had a unit of milliseconds, but it isn't immediately
clear if the reported value can ever less than 1.0. The
conversion to long is now delayed until after converting
to nanoseconds so duration values less than 1.0 will now
work instead of just recording 0.

For the histogram I changed to just using a cast to `long`
to avoid boxing to a `Double`. As an FYI for the future,
there is a DoubleDistributionSummary we have experimented
with in spectator-ext-sandbox that might be more appropriate
for this use-case.
2016-02-01 12:20:01 -07:00
Dave Syer 32c0f90999 Remove regex mapper properties from ZuulProperties
It is up to the user to configure a mapper if needed (one is no
longer provided automatically), so it doesn't need to take up
space in ZuulProperties
2016-01-31 16:19:51 +00:00
Dave Syer 82d8a11021 Defensive coding to avoid potential NPE
Fixes gh-803
2016-01-31 16:19:16 +00:00
Dave Syer 2e9ff4c7d7 Make eureka application manager @Lazy
So that it isn't instantated eagerly on startup by the RefreshScope.

Fixes gh-789
2016-01-29 13:13:30 +00:00
Niklas Herder c95e2f450d Fix typo: zule-core -> zuul-core. 2016-01-29 13:27:33 +01:00
Dave Syer cb13b9dd77 Reset Zuul state some more
Tests are very sensitive to the Zuul RequestContext which is
thread bound.
2016-01-28 17:48:42 +00:00
Marcin Grzejszczak 7747674b5c Updated e2e script 2016-01-28 13:39:02 +01:00
Dave Syer 29e691a4da Fix some zuul tests (clear request context before test) 2016-01-27 13:53:22 +00:00
Dave Syer 22b08f1a7f Fix Feign Ribbon with Apache HTTP client
The Apcahe client does not allow empty body for PATCH, nor does it
allow a request to be pre-populated with a Content-Length. Spring
Cloud tests were trying to do the former, and Feign allows the latter.
2016-01-27 13:38:48 +00:00
Dave Syer 65ec773066 Fix FeignHttpClientTests 2016-01-27 13:06:02 +00:00
Adrian Ivan 2f905b81ed Detect Zuul vs DispatcherServlet execution
Change SimpleRouteLocator to work with both Zuul and DispatcherServlet

Fixes gh-794
2016-01-27 10:51:56 +00:00
Dave Syer 1534ca41f7 Add dependency management for netty
Fixes gh-710
2016-01-26 16:02:26 +00:00
Dave Syer 7bdab0f23b Relay eureka.environment to Archaius if it is set
Apparently we already support eureka.datacenter as an alias for
archaius.deployment.datacenter and it looks like when that code
was written we intended to support eureka.environment in a similar way.
But it was never finished off, so this change adds the necessary one
line of code.

Fixes gh-791
2016-01-26 14:05:54 +00:00
Dave Syer 82991a7fc2 Make feign client bean id unique (use full classname)
Fixes gh-790
2016-01-26 10:49:21 +00:00
Dave Syer 3c5126c740 Consolidate tests and bootstrap config for config server 2016-01-25 11:43:11 +00:00
Dave Syer dbb6059558 Simplify config server discovery with DiscoverClient metadata
Since DiscoverClient now supports metadata natively, we can use that and not rely
on Eureka interafces at all.

Fixes gh-787. Also fixes https://github.com/spring-cloud/spring-cloud-config/issues/302
2016-01-25 10:17:57 +00:00
Dave Syer 92a35ba77f Add explicit docs for eureka.hostname in secure app registration
Eureka supports native placeholders, but Spring can also be used.
Added some docs to show how more explicitly.

See gh-761
2016-01-24 08:29:55 +00:00
Spencer Gibb ddd7979a25 Don't refresh the ipAddress if set by user config.
fixes gh-573
2016-01-20 13:52:58 -07:00
Spencer Gibb 3fb26f69e5 Add ability to disable hystrix metrics
fixes gh-781
2016-01-20 13:06:13 -07:00
Spencer Gibb 0b9fc290d2 Upgrade eureka to 1.3.7
fixes gh-779
2016-01-19 17:18:50 -07:00
Spencer Gibb e2f6bd0e2e Upgrade Hystrix to v1.4.23
fixes gh-777
2016-01-19 15:28:50 -07:00
Dave Syer a6e47a0b47 Ensure management.port defaults to server.port for eureka registration
Otherwise apps register the wrong health and status URLs by default. If
there is no explicit management.port we just need a default that is
the same as server.port.
2016-01-19 07:04:38 +00:00
Dave Syer be0f030ccf Move shared package under eureka 2016-01-19 07:02:37 +00:00
Dave Syer b46dab3099 Put @Bean EurekaServerConfig in nested class to avoid cycle
A new integration test ill be added in spring-cloud-samples/tests.

Fixes gh-759
2016-01-18 17:35:17 +00:00
Dave Syer c97f69517d Fix format in javadoc 2016-01-18 17:03:05 +00:00
Dave Syer 053296de93 Ensure request body is not buffered when direct to ZuulServlet
A change in Zuul in NetflixOSS means that it buffers all requests unless
you switch it off at the level of the servlet. And even when you do that
you need to ensure that Spring Cloud doesn't re-introduce a buffer through
the Servlet30RequestWrapper.

This change restores the feature in Spring Cloud Angel that multipart files
posted to /zuul/* go straight through the servlet and are not buffered in
memory.

Fixes gh-773
2016-01-18 16:51:35 +00:00
Dave Syer 249f524ad9 Fix typo in docs 2016-01-16 09:46:46 +00:00
Spencer Gibb 62d340bcfe Support @AliasFor annotation elements in Feign.
fixes gh-766
2016-01-15 17:30:08 -07:00
Dave Syer 9287e66cfc Add ServerProperties in case not a web app (for tests) 2016-01-15 15:34:42 +00:00
Dave Syer 98e1ac7375 Add fullPath as convenience property on Route
More often than not what Route.path was used it had to be concatenated
with the prefix. This change just encapsulates that concern in the
Route itself.
2016-01-15 15:34:42 +00:00
Dave Syer f9fc8ba8aa Change signature of RouteLocator.getRoutes()
If it returns Routes instead of Strings it's a lot more obvious
what it's supposed.
2016-01-15 15:34:42 +00:00
Dave Syer 2585798ab5 Consolidate RouteLocator features in base class 2016-01-15 15:34:42 +00:00
Marcin Grzejszczak 1d85260ccd Fixed wrong branch of the script for e2e 2016-01-15 12:36:54 +01:00
Marcin Grzejszczak e4f81fb62e Updated e2e scripts 2016-01-15 12:36:03 +01:00
Marcin Grzejszczak 1e582dea0a Added killing of apps after e2e tests 2016-01-15 10:40:14 +01:00
Spencer Gibb f00f761996 Support feign hystrix fallbacks.
Added @FeignClient(fallback).

Renamed FeignClientFactory to FeignContext.

fixes gh-762
2016-01-14 16:19:59 -07:00
Spencer Gibb 390f0016e6 Upgrade to Feign 8.14.1
fixes gh-727
2016-01-14 16:19:59 -07:00
Dave Syer 3ecd9cb0cf Move discovery related route locator stuff into a new package 2016-01-14 17:15:30 +00:00
Dave Syer 9161c54c43 Factor out common interface from ProxyRouteLocator
The RouteLocator interface wasn't very useful to anyone in its
1.0.x form. If ProxyRouteLocator features are consolidated into
the RouteLocator interface then users can supply their own
strategies more easily.

Also added RefreshableRouteLocator for implementations that need
to recompute routes when something changes. SimpleRouteLocator
doesn't need to do that because all the routes are in the configuration.
2016-01-14 17:15:30 +00:00
Spencer Gibb b4cf375044 ignore ipr 2016-01-12 15:53:24 -07:00
Spencer Gibb b894f8dbb3 Upgrade archaius to v 0.7.3
Added spring-cloud-starter-archaius so downstream projects
like consul and zookeeper don't need to maintain the list of
archaius depenencies.

fixes gh-765
2016-01-12 11:19:16 -07:00
Spencer Gibb af88007cc3 Merge pull request #745 from jkschneider/metrics-deconflict-services
Servo and Spectator metrics defer to other Counter/GaugeServices
2016-01-12 10:42:47 -07:00
Spencer Gibb c1e567afc7 Move eureka-client code to separate module.
This move should be transparant to users of spring-cloud-starter-eureka.

fixes gh-579
2016-01-11 16:45:30 -07:00
Marcin Grzejszczak 1ee1a924ba Reverting changes before adding acceptance tests 2016-01-08 22:16:38 +01:00
Dave Syer 704fa7a1be Ensure we are using dependencies poms from other projects 2016-01-08 16:40:06 +00:00
Dave Syer 682b71565d Add profile for repos 2016-01-08 13:24:31 +00:00
Dave Syer 3f742d9675 Add spring-cloud-netflix-dependencies module as a BOM
The new module is a BOM that doesn't have any parent or direct
dependency management in spring-boot-*. So users can include it
in their dependency management without polluting the spring boot
dependency versions.

Luckily it can also be used in the main spring-cloud-netflix pom,
which should no longer be used as a BOM.
2016-01-07 13:45:46 +00:00
Dave Syer 0e8ce13c07 Copy javadocs from interfaces to config property fields 2015-12-30 17:55:05 +00:00
Dave Syer e4a1b50edb Change name of mispelled class 2015-12-30 17:54:03 +00:00
Dave Syer 832bd41f5d Add some docs for config properties 2015-12-30 15:06:30 +00:00
Jon Schneider af5c2360ea Servo and Spectator metrics defer to other Counter/GaugeService implementations 2015-12-28 14:31:10 -06:00
Marcin Grzejszczak 86e16f58b9 Analysing the stalling test issue 2015-12-28 18:34:37 +01:00
Marcin Grzejszczak 13aa5be9b9 Changing maven logging level 2015-12-28 17:40:03 +01:00
Marcin Grzejszczak 1e13740bda Trying to fix the hanging build 2015-12-28 17:10:52 +01:00
Marcin Grzejszczak 7e738dedc5 Temporarilly adding more logging to maven 2015-12-28 16:43:50 +01:00
Spencer Gibb d809ac9999 fix eureka-first test 2015-12-23 17:34:30 -07:00
Marcin Grzejszczak 952be93124 Removed unnecessary sudo: false 2015-12-23 18:56:16 +01:00
Marcin Grzejszczak 096f452cfa Trying to make the build pass 2015-12-23 16:28:08 +01:00
Marcin Grzejszczak 7b8a02ede8 Added running of acceptance-tests 2015-12-23 10:43:45 +01:00
Spencer Gibb 94c73da943 Use new InetUtils bean to determin nic.
Allows for more fine-grained configuration of what to ignore.
2015-12-22 18:10:56 -07:00
Spencer Gibb 03f6d12e50 Implement ServiceInstance.getMetadata.
Introduce ServerIntrospector.getMetadata(Server).

fixes gh-419
2015-12-22 15:04:57 -07:00
Spencer Gibb 8938aa4621 Revert "Update SNAPSHOT to MILESTONE 1.1.0.M4"
This reverts commit 721fdc5918.
2015-12-22 11:25:47 -07:00
Spencer Gibb 721fdc5918 Update SNAPSHOT to MILESTONE 1.1.0.M4 2015-12-22 11:21:20 -07:00
Marcin Grzejszczak ad2716c361 Removed increased polling interval 2015-12-21 14:59:53 +01:00
Marcin Grzejszczak fae2c5d1b5 Increasing polling interval for e2e tests even more 2015-12-21 13:39:30 +01:00
Marcin Grzejszczak de1021e20c Increased polling interval for e2e tests 2015-12-21 13:05:27 +01:00
Marcin Grzejszczak e5a58ef7c1 Removed version param to use default BOM Brixton Snapshot version 2015-12-18 23:12:44 +01:00
Spencer Gibb d36fff1772 remove outdated RUNNING.md 2015-12-18 13:46:41 -07:00
Spencer Gibb 8d259b9d8f Merge pull request #669 from zanella/invalid_hostname
* invalid_hostname:
  Added check for invalid hostname
2015-12-18 13:11:53 -07:00
Rafael Zanella 7c7513ee25 Added check for invalid hostname
The exception class has to be "fixed"

You may register a serviceId with invalid URI characters (e.g.: '_'), but the URI::getHost() fails when such chars are found.
2015-12-18 13:11:22 -07:00
Spencer Gibb 4ffeff200e Merge pull request #734 from hscholz/master
* pull734:
  fixes gh-716 adds option to decode 404s
2015-12-18 12:47:55 -07:00
hscholz 66c047e6d5 fixes gh-716 adds option to decode 404s 2015-12-18 12:12:29 -07:00
Spencer Gibb a00fd2c348 Merge pull request #663 from jettro/master
* pull663:
  Case insensitive Content-Encoding check
2015-12-18 11:22:07 -07:00
Jettro Coenradie f707e5f053 Case insensitive Content-Encoding check
Fixes a problem with a header in the response containing
content-encoding in lowercase letters. Uses HttpHeaders for case
insensitve check.

Also fixes an issue checking if a request is made for gzip content.
If headers has more than gzip (ie gzip,deflate,sdch), checks if
contains gzip instead of equals to.

Fixes gh-662
2015-12-18 11:21:18 -07:00
Spencer Gibb a61c18c69c polish 2015-12-18 10:50:31 -07:00
Spencer Gibb 7234a99756 Merge pull request #735 from jkschneider/metrics-gauge-deconflict
* jkschneider-metrics-gauge-deconflict:
  Deconflict GaugeService provided by Servo/Spectator integration
2015-12-18 10:50:10 -07:00
Jon Schneider 33d651847d Deconflict GaugeService provided by Servo/Spectator integration 2015-12-18 09:07:41 -08:00
Dave Syer 2bb6befbca Add vanilla integration tests 2015-12-18 11:48:47 +00:00
Dave Syer 2f0d425b66 Allow URL to be host only (per javadocs) 2015-12-18 11:33:34 +00:00
Spencer Gibb bad20d3fcc Migrate SpringClientFactory and FeignClientFactory
Now uses spring-cloud-context NamedContextFactory.

see https://github.com/spring-cloud/spring-cloud-commons/issues/69
2015-12-17 14:33:11 -07:00
Dave Syer 493caec5df Fix ribbon client factory to search context hierarchy
We need to use BeanFactoryUtils to search the context hierarchy
for custom instances.

Fixes gh-733
2015-12-17 17:07:14 +00:00
Spencer Gibb 7d78a3c347 Merge pull request #724 from jkschneider/metric-poller
Add Servo metric poller and @EnableAtlas test
2015-12-16 12:21:54 -07:00
Spencer Gibb 3f45391d29 Merge pull request #723 from jkschneider/atlas-docs
Update docs to indicate the need for spring-cloud-starter-atlas
2015-12-16 12:20:29 -07:00
Spencer Gibb 502f955091 Merge pull request #722 from jkschneider/atlas-metric-observer
Minor improvements to error messages for netflix.atlas.uri problems
2015-12-16 12:19:38 -07:00
Spencer Gibb 4720b78db5 Merge pull request #699 from stephaneLeroy/master
* pull699:
  Add Zuul Proxy regex serviceId to route mapping
2015-12-16 12:10:56 -07:00
Stéphane Leroy 4a52a7f889 Add Zuul Proxy regex serviceId to route mapping
fixes gh-693
2015-12-16 12:10:22 -07:00
Marcin Grzejszczak 9f9948707a Added scripts to run e2e tests 2015-12-16 18:23:09 +01:00
Jon Schneider 1cd363f33f Add Servo metric poller and @EnableAtlas test 2015-12-15 23:20:07 -08:00
Jon Schneider 4325b7e363 Update docs to indicate the need for spring-cloud-starter-atlas for Atlas 2015-12-15 22:17:13 -08:00
Jon Schneider e994971bec Minor improvements to error messages for netflix.atlas.uri problems 2015-12-15 21:29:20 -08:00
Spencer Gibb 0ddfb42d4d Merge pull request #694 from snussbaumer/gh-691
* gh-691:
  Enable configuration of the way HttpClient handles redirects
2015-12-15 15:52:06 -07:00
Sébastien Nussbaumer 15f940054d Enable configuration of the way HttpClient handles redirects
RibbonLoadBalancingHttpClient being IClientConfigAware, it is now
initialized within initWithNiwsConfig. The values of the config keys
FollowRedirects, ConnectTimeout and ReadTimeout are now respected.

Fixes gh-691
2015-12-15 15:43:21 -07:00
Spencer Gibb b108de33ed Merge pull request #713 from kakawait/gh-583
* gh-583:
  Removing multiple successive slashes
2015-12-15 14:38:12 -07:00
kakawait 982288ec04 Removing multiple successive slashes
Eliminates zuul URISyntaxException if route has trailing slash.

fixes gh-583
2015-12-15 14:37:52 -07:00
Spencer Gibb 804abb6d6d Move test to same package as class testing 2015-12-15 14:00:21 -07:00
Spencer Gibb 8f6cd86e56 Merge pull request #704 from hscholz/master
* pull704:
  Explicitly set target to feign client name.
2015-12-14 15:15:48 -07:00
hscholz abd32fbfd0 Explicitly set target to feign client name.
fixes gh-703
2015-12-14 15:15:27 -07:00
Spencer Gibb 2acd353c7d Allow Feign Hystrix support to be disabled.
fixes gh-717
2015-12-14 14:39:35 -07:00
Spencer Gibb 456f2c0a99 Merge pull request #670 from jkschneider/metrics-docs
Servo, Spectator, and Atlas docs
2015-12-12 11:22:58 -07:00
Jon Schneider ad6e61dd47 Servo, Spectator, and Atlas docs 2015-12-11 20:17:46 -08:00
Spencer Gibb 810b17ae06 Guard for null entity.
redefine isSuccess to 2xx status code series.

fixes gh-687
2015-12-03 11:00:11 -07:00
Dave Syer a43d9d86df Add null check in annotation processing for Feign
Allows POST with a @RequestBody

Fixes gh-689
2015-12-03 17:14:54 +00:00
Spencer Gibb 57206c639d Upgrade to Hystrix 1.4.21
fixes gh-685
2015-12-02 14:07:31 -07:00
Spencer Gibb 1ede1458b9 Get RequestInterceptors from feign context.
Rather than pulling them from the generic context.

fixes gh-683
2015-12-02 11:36:48 -07:00
Spencer Gibb f38e43a4b6 polish 2015-12-02 10:35:53 -07:00
Spencer Gibb cb8b9363f6 Merge pull request #671 from alexVengrovsk/update-debug
Add isDebugEnabled() for logging operations
2015-11-30 13:22:50 -07:00
alexVengrovsk 8957a40328 Update InstanceRegistry.java 2015-11-30 16:23:24 +02:00
Dave Syer 1129872061 Default status page and health URLs if possible and where needed
If the management.port is explicitly set to something other than the
server.port, we can use it to set the status page and health URL
default values. (They can still be overridden by config properties.)

If management.port=0 there's not much we can do because we don't know
the port number yet when the instance config is created.

Fixes gh-425
2015-11-30 09:29:09 +00:00
Dave Syer f2fee74880 Excludes aspectjrt from javanica
The aspectjweaver jar includes all of aspectjrt, and the former is
used at runtime in a number of places (tests fail if you remove
it). Both are not needed so we have picked one (the other one than
recommended in gh-666).

Fixes gh-666
2015-11-26 15:33:09 +00:00
Spencer Gibb 1090f2817a Upgrade zuul to v1.1.0
fixes gh-591
2015-11-24 16:37:25 -07:00
Spencer Gibb d23a57d13b Don't extend EurekaBootStrap.
EurekaBootStrap implements ServletContextListener which causes problems because of early instantiation.

fixes gh-664
2015-11-23 16:32:31 -07:00
Spencer Gibb c93a19c0d1 Merge pull request #625 from liebowitz/master
* pull625:
  Refactor SimpleHostRoutingFilter
2015-11-23 14:34:24 -07:00
Greg Liebowitz 940921ac15 Refactor SimpleHostRoutingFilter
Removed deprecated HttpClient APIs, exposed method to override client, fixed ignoredHeaders
2015-11-23 14:33:39 -07:00
Spencer Gibb 452f494c21 Merge pull request #661 from micheal-swiggs/multiple_monitoring
* multiple_monitoring:
  Enables hystrix monitoring of multiple services on a single server.
2015-11-23 12:30:15 -07:00
Micheal Swiggs 03a005033d Enables hystrix monitoring of multiple services on a single server. 2015-11-22 08:47:43 +00:00
Spencer Gibb f46e8e8e1f Merge pull request #543 from ChristianLohmann/create-httpclient-ribbon-command
* create-httpclient-ribbon-command:
  an Apache http client zuul ribbon command
2015-11-20 16:37:42 -07:00
Christian Lohmann 18dff8527d an Apache http client zuul ribbon command
This is an implementation of a RibbonCommand and a factory which makes
use of a loadbalancing http client based on apache's http-components
http-client.
With this command/factory it is possible to route PATCH http requests
via zuul/ribbon as well.

fixes gh-412
2015-11-20 16:37:18 -07:00
Spencer Gibb 81b430dbb4 polish 2015-11-20 15:34:39 -07:00
Spencer Gibb 3994a3e439 Merge pull request #655 from Oreste-Luci/master
* pull655:
  Add support for placeholders in @FeignClient definitions
2015-11-20 15:26:47 -07:00
Oreste Luci 94d4bdfcc3 Add support for placeholders in @FeignClient definitions
Includes name and url attributes.

fixes gh-414
2015-11-20 14:25:38 -07:00
Spencer Gibb 4721bee8f2 allow EurekaServerConfig to be overridden.
fixes gh-657
2015-11-20 10:48:51 -07:00
Spencer Gibb 415cd1d83c Remove unneeded hardcoded initializers. 2015-11-19 08:33:39 -07:00
Spencer Gibb bd12fa47d7 Upgrade to rxjava 1.0.14
fixes gh-651
2015-11-18 14:19:45 -07:00
Spencer Gibb a7d425deba Upgrade to feign 8.12.1
fixes gh-623
2015-11-17 17:03:26 -07:00
Spencer Gibb 06a4e0996b added ribbon.http.client.enabled conditional 2015-11-17 09:22:01 -07:00
Dave Syer 06b50c9fe0 Revert to snapshots 2015-11-17 12:27:43 +00:00
Dave Syer 05f75e70da Update to 1.1.0.M3 2015-11-17 12:27:01 +00:00
Dave Syer db2e87f1b6 Switch log to debug from info
Logging each request in the proxy is too verbose and inconsistent
with other Spring MVC logging.
2015-11-13 11:51:32 +00:00
Dave Syer db4c82c39c Add @deprecated Javadocs 2015-11-13 11:51:32 +00:00
Spencer Gibb 713e6b8461 Merge pull request #639 from jkschneider/metrics-aop-fix
* metrics-aop-fix:
  RestTemplate metrics collection join point now returns a value
2015-11-12 10:41:23 -07:00
Jon Schneider be14074817 RestTemplate metrics collection join point now returns a value 2015-11-12 10:34:07 -07:00
Dave Syer 024d9946dc Whitespace 2015-11-12 16:23:26 +00:00
Dave Syer 36e4c7cf93 Make metrics aspect conditional on Spring AOP
Also changes pointcut to use the interface so you don't need
proxyTargetClass=true.

Fixes gh-636
2015-11-12 13:53:50 +00:00
Spencer Gibb ef5785bfb7 Upgrade to Hystrix v1.4.20
fixes gh-635
2015-11-11 15:55:03 -07:00
Spencer Gibb dc1f28a74e Merge pull request #613 from jmnarloch/feign-no-content-test
* feign-no-content-test:
  Feign handling unparameterized ResponseEntity
2015-11-11 14:00:17 -07:00
Jakub Narloch cff20c5a6d Feign handling unparameterized ResponseEntity
fixes gh-612
2015-11-11 14:00:04 -07:00
Dave Syer b001fea325 Re-order configs and add refresh scope for lazy loading
so that Eureka InstanceInfo (which is designed to be immutable)
can effectively be mutated (by using a different instance) after the
dynamic port is available.
2015-11-11 11:09:28 +00:00
Spencer Gibb 3dfb8b5dc1 fix support for registering random ports with eureka.
fixes gh-570 ... again
2015-11-11 11:09:28 +00:00
Ben Klein 31e82a7597 Update spring-cloud-netflix.adoc
Reword to avoid broken AsciiDoc formatting.
2015-11-10 17:03:41 -08:00
Spencer Gibb 38055b586d Allow flexibility with Turbine http.
Allows non-eureka based InstanceDiscovery.
Allows custom InstanceDiscovery.

fixes gh-566
2015-11-10 17:17:09 -07:00
Spencer Gibb 1e716ff2c2 Upgrade eureka to v1.3.4
fixes gh-589
2015-11-10 12:25:05 -07:00
Spencer Gibb 5566749742 Merge pull request #633 from jkschneider/metrics-test-fixes
* metrics-test-fixes:
  Fix flaky Servo tests by avoiding DefaultMonitorRegistry
2015-11-10 09:20:58 -07:00
Jon Schneider 7bf6a85bd3 Fix flaky Servo tests by avoiding DefaultMonitorRegistry 2015-11-10 09:20:37 -07:00
Spencer Gibb 679e659cbc remove findbugs 2015-11-10 09:03:41 -07:00
Spencer Gibb 4d7f40f6e8 ignore failing test for now. 2015-11-09 15:01:58 -07:00
Spencer Gibb dfec99780a fix failing test on travis. 2015-11-09 14:54:05 -07:00
Spencer Gibb b117030a47 Merge pull request #615 from jkschneider/metrics
* metrics:
  Expanded metrics support to include Servo, Spectator, and Atlas
2015-11-09 14:11:35 -07:00
Jon Schneider c61a48735d Expanded metrics support to include Servo, Spectator, and Atlas
* For Java 8 users, Spectator is the recommended metrics library as Servo is now deprecated in favor of Spectator
* Servo support now needs to be specifically enabled via @EnableServo, even if servo-core is included on the classpath
* Added starter modules for both Spectator and Atlas support
* ServoMetricReader defines a convention for mapping tag-based metrics to hiearchical names for rendering by the Actuator /metrics endpoint
2015-11-09 14:10:44 -07:00
Spencer Gibb e4a4448497 Only deploy snapshots on master not in PR
fixes gh-630
2015-11-09 12:38:25 -07:00
Dave Syer 98d76dfe8c Correct path to magnfiying glass
It still isn't actually used (and would only be used on a link to
a non-existent JSP page), but at least it can render now.

See gh-628
2015-11-09 14:56:38 +00:00
Dave Syer 88cbeb015a Use better icon image for magnifying glass
Fixes gh-628
2015-11-09 14:15:38 +00:00
Spencer Gibb 2cf4a38398 Exclude commons-logging from eureka-client
fixes gh-525
2015-11-04 16:49:49 -07:00
Spencer Gibb 7eb5855815 fix resource filtering so it works with boot 1.3.x
get's eureka branding back.

fixes gh-627
2015-11-04 16:39:04 -07:00
Spencer Gibb d954a5c525 Merge pull request #621 from ametiste-oss/health-check-without-circuit-fails-fixed
Health check fails on commands without circuit breaker.
2015-11-04 15:26:01 -07:00
Spencer Gibb 509c8e9f13 polish 2015-11-04 14:54:51 -07:00
Spencer Gibb 4fdb85e678 Merge pull request #619 from jmnarloch/feign-parameter-processors
* feign-parameter-processors:
  Feign annotated parameter processors
2015-11-04 14:25:43 -07:00
Jakub Narloch 31d2f65528 Feign annotated parameter processors 2015-11-04 14:12:12 -07:00
Spencer Gibb 50efa8536d add optional DiscoveryClientOptionalArgs
For extensibility by connectors
2015-11-04 13:49:52 -07:00
Konstantin A. Zolotukhin 5d3a0da50e null check for command bound circuit breaker 2015-10-31 13:36:17 +02:00
Jakub Narloch 966e03ba64 Feign OkHttp client configuration 2015-10-22 12:04:09 -06:00
Dave Syer 22f4b82efa Revert profile and add comment 2015-10-20 09:34:47 -04:00
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
Spencer Gibb 6d5591020d Upgrade feign to 8.11.0
Adds support for feign-hystrix

fixes gh-606
2015-10-19 10:17:10 -06:00
Spencer Gibb 9e4cad750a Upgrade hystrix to 1.4.18
fixes gh-600
2015-10-19 09:27:33 -06:00
Spencer Gibb 248732e6ff Force isCircuitBreakerOpen to String (if it's a Boolean for example)
see https://github.com/Netflix/Hystrix/pull/927
2015-10-19 09:27:33 -06: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
Spencer Gibb fa75ddf452 polish 2015-10-14 11:33:57 -06:00
Spencer Gibb ce4076621a Merge pull request #588 from alexVengrovsk/master
* pull588:
  Add isDebugEnabled() check
2015-10-13 11:07:37 -06:00
alexVengrovsk 914fee9ae4 Add isDebugEnabled() check
It is good thing to make this checks because of expensive concatenation of String objects (debug messages).
2015-10-13 10:43:43 -06:00
Spencer Gibb a3a7c60925 exclude commons-logging from ribbon
fixes gh-596
2015-10-13 09:57:38 -06:00
Spencer Gibb 8103bdbff8 revert zuul 1.1.0-rc.2 as it isn't published to maven central. 2015-10-12 12:43:26 -06:00
Spencer Gibb fc20cc7135 Upgrade zuul to v1.1.0-rc.2
fixes gh-591
2015-10-12 12:32:44 -06:00
Spencer Gibb 7fcc559edb Remove blitz4j
fixes gh-527
2015-10-12 12:08:34 -06:00
Spencer Gibb f878cfcf67 Polish 2015-10-12 11:25:27 -06:00
Spencer Gibb 3e0e47612c Do not require eurekaConfig.
Helps when eureka is on the classpath, but is explicitly disabled.

fixes gh-521
2015-10-12 11:16:08 -06:00
Spencer Gibb a96666b902 Move DiscoveryClient creation so it is guarded.
Move it back to EurekaDiscoveryClientConfiguration.

fixes gh-578
2015-10-12 10:26:09 -06:00
Spencer Gibb 5b3a9f8f31 Align feign logging.
Since all feign clients now have access to the type, logging can apply a type regardless.

Fixes gh-431
2015-10-09 17:07:01 -06:00
Spencer Gibb ef67fa328c Add local service to zuul ignoredServices by default.
fixes gh-447
2015-10-09 16:14:34 -06:00
Spencer Gibb 8058ced90d Remove dependency on governator.
Eureka now only directly depends on java.inject.

Fixes gh-529
2015-10-09 14:42:17 -06:00
Spencer Gibb 5f41de87d2 Polish 2015-10-09 14:00:24 -06:00
Spencer Gibb c051cb83d2 Merge pull request #585 from mbenson/master
* pull585:
  Fix feign scanning that fails if clients attr is not use
2015-10-09 12:21:40 -06:00
Matt Benson 568bc47b3e Fix feign scanning that fails if clients attr is not use
fixes gh-584
2015-10-09 12:21:17 -06:00
Spencer Gibb fe989530e3 remove reflection to set InstanceInfo.port 2015-10-09 12:00:40 -06:00
Spencer Gibb 51ea8afb24 Set port on InstanceInfo to support random server.port.
fixes gh-570
2015-10-09 11:47:56 -06:00
Spencer Gibb 5065e47565 Upgrade Hystrix to v1.4.17
fixes gh-576
2015-10-09 10:52:21 -06:00
Spencer Gibb 0cbfc20293 updated README 2015-10-08 17:08:00 -06:00
Spencer Gibb 2d595e86f3 remove extra punctuation 2015-10-08 16:21:52 -06:00
Spencer Gibb 82b21f34f5 Merge pull request #581 from jmnarloch/feign-compression-docs
* feign-compression-docs:
  Feign compression documentation
2015-10-08 16:12:24 -06:00
Jakub Narloch 68fa6afa17 Feign compression documentation 2015-10-08 16:12:05 -06:00
Spencer Gibb c5950df6e4 polish 2015-10-08 15:41:09 -06:00
Spencer Gibb d433096779 Merge pull request #577 from alexVengrovsk/master
* pull577:
  Use instanceof for better readability
2015-10-08 14:50:50 -06:00
alexVengrovsk e4b63a5b51 Use instanceof for better readability 2015-10-08 12:01:44 +03:00
Spencer Gibb 8147b7de51 Merge pull request #575 from alexVengrovsk/master
* pull575:
  Use "<>" and use isInfoEnabled
2015-10-07 13:01:38 -06:00
alexVengrovsk 4510f657b9 Use "<>" and use isInfoEnabled 2015-10-07 12:54:23 -06:00
Spencer Gibb 810502c1f3 Allow overriding default feign beans.
Similar to @RibbonClient

fixes gh-288
2015-10-05 14:57:27 -06:00
Spencer Gibb 0df6f0c0ae fix(title-xss): escaping text acquired from parameters to avoid any xss attacks
https://github.com/Netflix/Hystrix/pull/921
2015-10-05 09:29:12 -06: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
Spencer Gibb 0c2c564be5 Merge pull request #490 from jmnarloch/feign-content-encoding-snapshot
* feign-content-encoding-snapshot:
  Feign request/response gzip compression
2015-09-30 12:17:41 -06:00
Jakub Narloch 8bdfaf2c3d Feign request/response gzip compression 2015-09-30 12:13:41 -06: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
Spencer Gibb 65bf36ecf9 Upgrade hystrix to 1.4.16
fixes gh-561
2015-09-29 20:09:30 -06:00
Spencer Gibb 187af71535 move refs to EurekaInstanceConfigBean to interface.
Specifically CloudEurekaInstanceConfig where needed.

see gh-302
2015-09-29 11:32:04 -06: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
Spencer Gibb 0141a13c92 Merge pull request #557 from boostrack-cloud/boostrack-patch-1
DRY
2015-09-28 15:58:59 -06:00
Spencer Gibb aa8626739e Introduce Ribbon ServerIntrospector.
Allows ribbon load balancer implementations to answer questions like isSecure(Server).
2015-09-28 15:10:38 -06:00
Spencer Gibb 3ed982d235 Introduce Ribbon ServerIntrospector.
Allows ribbon load balancer implementations to answer questions like isSecure(Server).
2015-09-28 12:51:39 -06: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
boostrack 9c144220b1 DRY 2015-09-28 09:19:30 +02:00
Spencer Gibb b10bf9c305 Use eureka securePort if enabled for turbine http aggregation.
fixes gh-417
2015-09-25 17:08:15 -06:00
Spencer Gibb 7cf0fa4824 add support for HasFeatures 2015-09-25 16:08:37 -06:00
Spencer Gibb 0a2d1703f7 Update to new stream ChannelBindingServiceProperties 2015-09-25 16:07:51 -06:00
Spencer Gibb befcada46d formatting 2015-09-25 14:33:50 -06:00
Spencer Gibb d29839ea3f Merge pull request #555 from sfat/patch-1
Clicking running instances in eureka admin page
2015-09-25 10:04:52 -06:00
Andrei Sfat 60b437e2c5 Update eureka admin page
When click one of the up and running instances this should open the actual instance in separate tab
2015-09-25 15:42:18 +03: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
Spencer Gibb 0204978b36 Upgrade eureka to 1.2.5.
Change EurekaInstanceConfig.getSID to getInstanceId

fixes gh-554
2015-09-24 22:23:17 -06:00
Spencer Gibb da04c53726 use new commons code to provide hostInfo.
Set the default sid from common properties.
2015-09-24 17:20:31 -06:00
Jon Schneider 8f9acab3bd Update Eureka to 1.2.5-rc.1
Remove Servo from EurekaHealthIndicator.
Remove custom DataCenterInfo.
EurekaInstanceConfig.SID is now used as eureka id.
EurekaInstanceConfigBean.getSID falls back to metadataMap.instanceId for
backwards compatibility.
2015-09-24 15:34:17 -06: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
Spencer Gibb 581e9bbd58 Upgrade Hystrix to 1.4.15
fixes gh-534
2015-09-23 15:40:13 -06: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
Spencer Gibb 0d92cb0803 allow defaults for spring-cloud-stream bindings 2015-09-22 16:15:54 -06:00
Spencer Gibb 639a87bfa1 Port *-amqp to spring-cloud-stream.
Move turbine/hystrix amqp specific implementations to spring-cloud-stream based implementations and let the user decide which broker to use.

fixes gh-545
2015-09-22 09:42:45 -06:00
Spencer Gibb 9e817a7dce Downgrade hystrix to 1.4.14
1.4.15 isn't in maven central yet
2015-09-14 13:07:25 -06:00
Spencer Gibb 1888a4496a Upgrade hystrix to 1.4.15
fixes gh-534
2015-09-14 12:58:45 -06:00
Spencer Gibb 741908155a Upgrade feign to 8.10.0
fixes gh-540
2015-09-14 12:55:13 -06:00
Spencer Gibb c15fb33fc2 add ResponseEntity<Void> feign test
see gh-539
2015-09-14 12:48:36 -06:00
Spencer Gibb 4037f4ca80 Add initialization of JsonXStream back.
fixes gh-535
2015-09-10 12:59:24 -06:00
Spencer Gibb d72c9f0dc4 make use of 'metadataMap.instanceId' consistent 2015-09-10 12:18:31 -06:00
Spencer Gibb bea48c5150 Merge pull request #515 from CPGFinanceSystems-master
* CPGFinanceSystems-master:
  Add X-Forwarded-Proto HTTP header to zuul proxy requests
2015-09-08 12:34:08 -06:00
Forstner Michael cbc7aa37f4 Add X-Forwarded-Proto HTTP header to zuul proxy requests
If the zuul reverse proxy and the destination services are using a different scheme
(for example HTTPS on proxy side and HTTP on service side) an additional HTTP
header is required according to RFC7239 [http://tools.ietf.org/html/rfc7239]
2015-09-08 12:20:16 -06:00
Spencer Gibb 46860e5c2c Merge pull request #519 from spring-cloud/adrian.feign-bump
Bumps to Feign 8.8.1
2015-09-08 11:48:15 -06: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
Adrian Cole c25e950914 Bumps to Feign 8.8.1 2015-09-08 17:29:33 +02:00
Adrian Cole 12b8e52f70 Merge pull request #513 from spring-cloud/feign-eager-instantiation-problem
Change from @Autowired to context.getBean
2015-09-08 14:23:47 +02:00
Spencer Gibb f60cc6fb42 Change from @Autowired to context.getBean.
Solves problems where FeignClientFactoryBean is run before auto-configuration.

fixed gh-441
2015-09-04 15:22:48 -06:00
Spencer Gibb 67f0035885 update README from sources 2015-09-04 09:40:38 -06:00
Spencer Gibb a92307b060 Merge pull request #512 from geoand/doc-fix
Replaced incorrect @PathParameter with @PathVariable
2015-09-04 09:37:44 -06:00
Spencer Gibb b55832e5ef removed unused README 2015-09-03 17:41:34 -06:00
Spencer Gibb 304e836980 Merge pull request #509 from jmnarloch/eureka-healthcheck
* eureka-healthcheck:
  Eureka health check
2015-09-03 17:40:01 -06:00
Jakub Narloch c9008ea277 Eureka health check 2015-09-03 17:39:22 -06:00
gandrianakis 654ccf2dea Replaced incorrect @PathParameter with @PathVariable 2015-09-03 12:15:56 +03:00
Dave Syer 72c89c51e6 Fix autoconfig ordering so that health indicators always work 2015-09-02 13:27:49 +01:00
Spencer Gibb e31f41c2a9 Created StaticServerList and updated tests to use it. 2015-08-31 12:45:30 -06:00
Spencer Gibb aef6d2a326 Use localhost if non-loopback lookup fails 2015-08-31 12:11:42 -06:00
Spencer Gibb 62129c72c2 fix condition for selfPreservationMode 2015-08-25 16:32:02 -06: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
Spencer Gibb e8b0e613fc Merge pull request #501 from ghillert/master
Replace XD logo with a Eureka logo
2015-08-24 12:52:18 -06:00
Gunnar Hillert b1dffe00e7 Replace XD logo with a Eureka logo
* Fixes gh-310
2015-08-24 14:41:32 -04:00
Spencer Gibb b494e1d2cc refactor RibbonCommand to an interface and factory
lays the groundworkd to implement an httpclient ribbon command

fixes gh-412
2015-08-21 11:36:24 -06:00
Spencer Gibb ec22bf21eb Added LICENSE.txt 2015-08-20 16:11:18 -06:00
Roy Clarkson 56d0570674 Fix whitespace and formatting 2015-08-20 14:32:38 -05:00
Spencer Gibb 913091a716 added test for lists of request parameters 2015-08-19 10:52:01 -06:00
Adrian Cole b943a94b33 Merge pull request #494 from spring-cloud/adrian.5percent-more-ribbon
Updates to Ribbon 2.10
2015-08-19 08:27:45 -07:00
Adrian Cole 691771a13d Updates to Ribbon 2.10
Synchronizes on the version in use by Feign.

Closes #4920
2015-08-18 21:46:28 -07:00
Spencer Gibb a82a1734ce Merge pull request #493 from spring-cloud/adrian.may-the-poms-be-with-you
Consolidates references to parent pom
2015-08-18 19:10:14 -06:00
Adrian Cole 54607135b6 Consolidates references to parent pom
Some projects were failing on `./mvnw install` due to a non-existent
local path. This makes all poms use the same approach.
2015-08-18 17:49:07 -07: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
Spencer Gibb d64cfa5cad polish 2015-08-13 16:40:50 -06:00
Spencer Gibb b7bcdddacd add DiscoveryClientOptionalArgs constructor param to CloudEurekaClient 2015-08-13 15:41:53 -06:00
Spencer Gibb d24bff02f3 Merge pull request #486 from steve-oakey/gh-337
* gh-337:
  Detect https from Ribbon Client Config
2015-08-12 15:36:04 -06:00
Stephen Oakey c883495f8a Detect https from Ribbon Client Config
RibbonLoadBalancer and RibbonLoadBalancer use IClientConfig IsSecure
property for service ID to determine if the service is secure. Replaces
scheme of URI of request with https if the request is secure.

fixes gh-337
2015-08-12 15:35:39 -06:00
Spencer Gibb ddb09c499b Merge pull request #485 from jghiloni/master
* pull485:
  Make `isSecure()` match `getPort()` in secure vs non-secure resolution
2015-08-11 18:18:53 -06:00
Josh Ghiloni 539ca47bab Make isSecure() match getPort() in secure vs non-secure resolution 2015-08-11 15:14:04 -06:00
Spencer Gibb 9e40714e3c Use the first non-loopback address for host/ip addr
fixes gh-468
2015-08-07 18:17:59 -06:00
Spencer Gibb 512d687615 Update feign to 8.7.1
fixes gh-479
2015-08-07 15:18:02 -06:00
Spencer Gibb b9d1d5e697 Merge pull request #478 from jkschneider/early-eureka-client
* early-eureka-client:
  make EurekaClient available before smart lifecycle phase 0
2015-08-07 14:15:27 -06:00
Jon Schneider 191a1ccc35 make EurekaClient available before smart lifecycle phase 0 2015-08-07 14:14:54 -06:00
Spencer Gibb c39efb96bd Merge pull request #460 from jmnarloch/eureka-docs
Corrected docs for the 'context-path' property reference.
2015-08-06 09:27:55 -06:00
Spencer Gibb 246830c9d3 Upgrade to Eureka 1.2.0
Implements forwarding of eureka CacheRefreshedEvent as HeartbeatEvent,
rather thank serialization hack.  Uses new Eureka DI functionality
(mostly there, some issues). Updates EurekaJacksonCodec to be
"DataCenterAware". Reference EurekaClient interface rather than
DiscoveryClient class.

fixes gh-349
2015-08-05 13:37:36 -06:00
Spencer Gibb e7a767e042 Make RxJavaAutoConfiguration ConditionalOnClass AsyncHandlerMethodReturnValueHandler
so non-web apps don't break

fixes gh-475
2015-08-05 10:39:08 -06:00
Spencer Gibb 5fb3040a80 Merge pull request #456 from jmnarloch/feign-inheritance
* feign-inheritance:
  Updated documentation for Feign hierarchical clients
2015-08-04 11:16:28 -06:00
Jakub Narloch 69c3723aac Updated documentation for Feign hierarchical clients 2015-08-04 11:16:04 -06:00
Spencer Gibb 5ac5f198aa Support returning Observable from Spring MVC Controllers.
Via spring 4.2 new AsyncHandlerMethodReturnValueHandler

fixes gh-231
2015-07-30 14:05:46 -06:00
Spencer Gibb a2270dc27a Upgrade to Hystrix 1.4.13
Also brings in patches to the hystrix dashboard.

fixes gh-465
2015-07-27 16:52:04 -06:00
Spencer Gibb e5e677c0ad remove https port 8443 registration.
It overwrote the port 443 registration.

fixes gh-461
2015-07-27 15:00:49 -06:00
Spencer Gibb 79f939bec5 Merge pull request #455 from jmnarloch/service-path
* service-path:
  Specifing only the serviceId causes NPE
2015-07-27 14:08:27 -06:00
Jakub Narloch 798a19e468 Specifing only the serviceId causes NPE 2015-07-27 14:08:00 -06:00
Spencer Gibb 371f8b3bf2 feign polishing 2015-07-27 12:05:11 -06: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
Spencer Gibb cb732763b5 Merge pull request #464 from andreasevers/zuul-ignored-patterns
* zuul-ignored-patterns:
  If more fine-grained ignoring is needed, you can specify specific patterns to ignore. These patterns are being evaluated at the end of the route location process, which means prefixes should be included in the pattern to warrant a match. Ignored patterns span all services and supersede any other route specification.
2015-07-27 10:43:40 -06:00
andreasevers 42f6e4d1f0 If more fine-grained ignoring is needed, you can specify specific patterns to ignore. These patterns are being evaluated at the end of the route location process, which means prefixes should be included in the pattern to warrant a match. Ignored patterns span all services and supersede any other route specification.
zuul:
  ignoredPatterns: */admin/**
  routes:
    users: /myusers/**

This means that all calls such as "/myusers/101" will be forwarded to "/101" on the "users" service. But calls including "/admin/" will not resolve.
2015-07-27 10:27:43 -06:00
Jakub Narloch 59534a2447 Corrected docs for the 'context-path' property reference. 2015-07-26 18:53:10 +02:00
Spencer Gibb 558c78353c Merge pull request #448 from Sounie/master
Corrected typo in spelling of registration.
2015-07-24 13:14:02 -07:00
Stephen Souness 2cf2de3465 Corrected typo in spelling of registration. 2015-07-21 09:38:51 +01:00
Dave Syer 5bb778811f Merge branch '1.0.x' 2015-07-18 10:37:09 +01:00
Biju Kunjummen 2c688062e7 Clarified the way to add a custom EurekaInstanceConfigBean for AWS deployment 2015-07-18 10:36:51 +01:00
Spencer Gibb a6b94a38fe Add support for using Apache HttpClient with Feign
fixes gh-415
2015-07-15 17:23:41 -06:00
Spencer Gibb 22ed881805 Merge pull request #434 from qbast/master
* pull434:
  Build query string from context instead of original request
2015-07-14 09:44:24 -06:00
Jakub Stachowski dd1c5bb495 Build query string from context instead of original request
Recreate query string from either getCurrentContext().getRequestQueryParams()
or original request as fallback. This allows to override query string
params in pre filters.

fixes gh-426
2015-07-14 09:43:52 -06:00
Spencer Gibb 335481563f Merge pull request #437 from jmnarloch/feign-8.6.0
* feign-8.6.0:
  Updated feign version to 8.6.0
2015-07-13 13:18:08 -06:00
Jakub Narloch 0a34ad88f5 Updated feign version to 8.6.0 2015-07-13 20:49:18 +02:00
Spencer Gibb 9149319bd7 implement getHostName where refresh==true 2015-07-10 13:27:42 -06:00
Spencer Gibb aa63b072ae Merge pull request #427 from ericbottard/patch-2
Remove unfinished sentence
2015-07-10 10:18:12 -06:00
Spencer Gibb ffa2f27878 Merge pull request #428 from ericbottard/patch-3
Fix escaping
2015-07-10 10:17:43 -06:00
Spencer Gibb 69543470fa Merge pull request #429 from ericbottard/patch-4
Fix minor typo in doc
2015-07-10 09:40:52 -06:00
Ryan J Baxter 3a22a5e702 Fixes #314.
Should be approximateZoneFromHostname instead of approximateZoneFromDomain.
2015-07-10 09:33:02 -06:00
Eric Bottard 06bb00172e Fix minor typo in doc 2015-07-10 15:12:37 +02:00
Eric Bottard 8c2b186b67 Fix escaping 2015-07-10 14:29:17 +02:00
Eric Bottard e90824bfab Removed unfinished sentence 2015-07-10 14:08:13 +02:00
Dave Syer f682c42001 Merge branch '1.0.x' 2015-07-10 11:48:36 +01:00
Ryan J Baxter f4a69e43eb Sets the zone based on the hostname of the service if approximateZoneFromHostname is true.
The flag has always been there, it just isn't carried through to the ribbon client configuration
without this change if I understand this change correctly.

Fixes gh-315, fixes gh-423.
2015-07-10 11:47:35 +01:00
Spencer Gibb 206a5a029d Merge pull request #424 from ericbottard/patch-1
Fix grammar issue in doc
2015-07-09 14:03:14 -06:00
Eric Bottard 57cefb2591 Fix grammar issue in doc 2015-07-09 14:36:53 +02:00
Spencer Gibb ee97ef626f push versioning of turbine down to modules.
fixes https://github.com/spring-cloud-samples/turbine/issues/3
2015-07-08 14:17:40 -06:00
Spencer Gibb 5c18b02cb8 Merge pull request #420 from jmnarloch/docs
Fixed typo in ignoredServices
2015-07-07 17:31:33 -06:00
Jakub Narloch d0a82c1421 Fixed typo in ignoredServices 2015-07-06 21:13:27 +02: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
Spencer Gibb 06d4d1e158 add optional spring-security-rsa 2015-06-24 11:42:46 -06: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
Spencer Gibb bab74edf89 Merge pull request #340 from kaczynskid/master
Corrected example of providing Turbine cluster name via instance metadata map
2015-06-23 15:06:45 -04:00
Dave Syer 652e4b96b3 Nail explicit dependencies for s-c-context 2015-06-23 17:58:59 +01:00
Spencer Gibb 34eb36323a Merge pull request #390 from heyjustin/master
Mark an instance as DOWN when the application context is stopped.
2015-06-23 12:00:30 -04:00
Spencer Gibb 12bee7772f Merge pull request #408 from brandon-atkinson/zuul-unescaped-paths
* zuul-unescaped-paths:
  Fix unescaped paths in SimpleHostRoutingFilter.
2015-06-23 09:57:26 -06:00
Brandon Atkinson 283c0f7600 Fix unescaped paths in SimpleHostRoutingFilter.
Move common code so RibbonRoutingFilter can use the same code.

Fixes gh-407
2015-06-23 09:56:46 -06:00
Spencer Gibb 0b925e5afa Merge pull request #409 from brandon-atkinson/issue-394-remove-deflate
* issue-394-remove-deflate:
  Removed deflate accept-encoding from outbound requests
2015-06-23 09:51:01 -06:00
Brandon Atkinson 80206e6b38 Removed deflate accept-encoding from outbound requests 2015-06-23 09:50:14 -06:00
Bertrand Renuart 58284a4508 Change Jersey init to avoid classpath scanning issues
Scan classpath for Jersey resources with Spring and initialize the
Jersey filter with a jaxrs Application instead. (Fixes gh-399,
fixes gh-400)
2015-06-23 13:00:38 +01:00
Bertrand Renuart 2ba5c4b9ec gh327: explicitly close the HttpResponse in case of timeout 2015-06-11 13:14:50 -06:00
Justin Walsh 69eaa27ccc Mark an instance as DOWN when the application context is stopped.
Fixes gh-377
2015-06-10 10:37:53 +02:00
Spencer Gibb 440779bcf0 Revert "attempt ordering of RibbonClients.defaultConfiguration's"
This reverts commit 0d468b3930.
2015-06-08 14:56:23 -06:00
Spencer Gibb 0d468b3930 attempt ordering of RibbonClients.defaultConfiguration's
ref gh-383
2015-06-08 14:55:22 -06:00
Spencer Gibb 0f2fbf8e1c fixed test broken during rebase 2015-06-08 14:02:17 -06:00
Spencer Gibb b746ad5504 Fix name of default ribbon config if config is not in an eclosing class
fixes gh-374
2015-06-08 13:44:07 -06:00
Dave Syer a63b825690 Add call to Lifecycle.stop()
See gh-377
2015-06-08 06:33:45 +01:00
Spencer Gibb ce96c83401 updated README from sources 2015-06-05 11:16:33 -06:00
Spencer Gibb aa002b56c4 fixed canceled leases template var referencec
fixes gh-375
2015-06-05 09:00:54 -06:00
Spencer Gibb fa84108ebf fix swapped default values
fixes gh-372
2015-06-02 13:21:29 -06:00
Spencer Gibb a23131f094 upgrade hystrix to 1.4.10
fixes gh-370
2015-06-02 08:33:33 -06:00
Spencer Gibb a0d72b3cbc removed test with encoded slashes 2015-06-02 08:33:32 -06: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
Spencer Gibb 899a577980 add test for zuul with encoded path parameter 2015-06-01 14:44:54 -06:00
Spencer Gibb 682ceec402 Merge branch 'brenuart-gh354b' 2015-05-28 09:02:07 -06:00
Spencer Gibb 68c731d668 added test for metrics with period in name 2015-05-28 09:01:53 -06:00
Spencer Gibb 1a6602149d Merge branch 'gh354b' of https://github.com/brenuart/spring-cloud-netflix into brenuart-gh354b 2015-05-28 08:43:23 -06:00
Spencer Gibb dbef27ac6b more RibbonClient tests 2015-05-28 08:32:01 -06:00
Bertrand Renuart 28f890989d Allow for periods in metric name (see gh354) 2015-05-28 09:48:28 +02:00
Dave Syer bd808a76fa Add health.config for documentation purposes only 2015-05-27 10:27:02 +01:00
Spencer Gibb 2559b76747 fixed typo 2015-05-26 10:56:57 -06:00
Spencer Gibb 4255179354 use io.reactivex:rxjava
fixes gh-353
2015-05-20 12:35:49 -06:00
Spencer Gibb bd5d00c082 encode uri if needed
fixes gh-347
2015-05-18 21:51:58 -06:00
Spencer Gibb 8bb578ad97 update ServerMetricCollector to include instance and statistic tags if present.
fixes gh-348
2015-05-18 20:53:55 -06:00
Spencer Gibb 3bb1562b7f fix RibbonClientHttpRequestFactory to add headers and accept a body
fixes gh-350
2015-05-15 12:26:32 -06:00
Spencer Gibb 68b0c91fa7 document disabling of zuul filters
fixes gh-341
2015-05-11 10:08:06 -06:00
Darek Kaczyński 8fa9b71579 Corrected example of providing Turbine cluster name via instance metadata map. 2015-05-07 00:02:03 +02:00
Spencer Gibb 532cfd9bda Merge pull request #336 from marcingrzejszczak/patch-2
Fixed a typo in the doc
2015-05-06 15:20:16 -04:00
Marcin Grzejszczak 94081f82ce Fixed a typo 2015-05-05 23:49:49 +02:00
Spencer Gibb ed692c3836 document that build requires jdk8
fixes gh-328
2015-05-05 11:42:09 -06:00
Spencer Gibb e3b42e79b6 fix misspelling 2015-05-05 10:54:59 -06:00
Spencer Gibb 688b577d63 Merge pull request #334 from marcingrzejszczak/patch-1
Reason why Eureka instance is not found, is not visible
2015-05-05 11:43:32 -04:00
Spencer Gibb 85b7ccf618 Merge pull request #316 from brenuart/issue-312
Make creation of the RestClient LAZY as it is no always required (issue #312)
2015-05-04 16:26:17 -04:00
Marcin Grzejszczak eed9b996fb Reason why Eureka instance is not found is not visible
With the following configuration at `bootstrap.yaml`

```yaml

spring:
  application.name: spring-cloud-hystrix-dashboard
  profiles.active: prod
  cloud:
    config:
      discovery:
        enabled: true
        serviceId: spring-cloud-server-config-with-eureka
server.port: 9003

turbine:
  appConfig: some-service
  clusterNameExpression: 'default'
```

I wasn't able to see why Turbine can't find the instance. The reason was related to SPEL:

```
org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'default' cannot be found on object of type 'com.netflix.appinfo.InstanceInfo' - maybe not public?
```

Anyways there was nothing there in the logs so maybe it should not be silenced like right now?
2015-05-04 16:55:11 +02: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
Spencer Gibb c3f5678854 only invoke RestClient.initWithNiwsConfig once
fixes gh-324
2015-04-30 12:56:38 -06:00
Spencer Gibb 5166994f7c add documentation for ribbon.eureka.enabled
fixes gh-325
2015-04-30 09:42:28 -06:00
Spencer Gibb ce6d286d70 Don't execute load balancer twice
fixes gh-323
2015-04-29 22:20:10 -06:00
Bertrand Renuart df8c637a57 add short explanation in javadoc 2015-04-28 11:26:50 +02:00
Bertrand Renuart e2fa45f960 Make creation of the RestClient LAZY as it is no always required (see
https://github.com/spring-cloud/spring-cloud-netflix/issues/312)
2015-04-24 09:32:26 +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
Spencer Gibb 3e98c78c12 add PATCH to SimpleHostRoutingFilter
fixes gh-307
2015-04-17 11:49:51 -06:00
Spencer Gibb 6dce075e99 upgrade to feign 8.1.1 which includes a fixes bad urls
fixes 305
2015-04-17 10:08:21 -06:00
Spencer Gibb 3d9e998a01 fix missing jersey apache4client 2015-04-16 14:49:12 -06:00
Spencer Gibb 55a8195a67 throw more descriptive error if no ServiceInstance is found 2015-04-16 14:48:38 -06: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
Spencer Gibb 1799809562 Merge branch 'hystrix-144' 2015-04-14 13:28:03 -06:00
Chad Jaros 38e25f390f Support for @RequestMapping on class and ResponseEntity return types 2015-04-14 09:54:43 -06:00
Spencer Gibb a765839771 upgrade hystrix to 1.4.4 and integrate dashboard changes
fixes gh-300
2015-04-14 08:58:18 -06:00
Spencer Gibb 20da63c238 Merge pull request #299 from royclarkson/dashboard-cf-fix
Ignore 'Connection: close' header from stream response
2015-04-13 16:48:16 -04:00
Roy Clarkson 408910e893 Ignore 'Connection: close' header from stream response
This commit resolves an issue where some versions of Cloud Foundry are
setting the 'Connection: close' HTTP header in the Hystrix stream
response, which causes the dashboard to not display the stream data.

See https://github.com/cloudfoundry/gorouter/issues/71
2015-04-13 15:19:16 -05:00
Spencer Gibb 45449cfb84 polish 2015-04-13 12:50:45 -06:00
Alexandru Burghelea 611c0b5c1c Added posibility to append archaius configuration to existing installed configurations 2015-04-13 12:50:45 -06:00
Spencer Gibb 9699664e09 Merge pull request #294 from joshiste/master
Docs: Example of static, loadbalanced Zuul configuration
2015-04-13 10:40:59 -04:00
Spencer Gibb 3279ae601f Merge pull request #298 from joshiste/exlude-mockito-all
Exlude mockito all
2015-04-13 10:40:53 -04:00
Roy Clarkson e1b6ddf563 Format whitespace 2015-04-13 08:40:15 -05:00
Johannes Stelzer 242419726d Exclude mockito-all from zuul-core and turbine-core
However turbine and zuul are depending on mockito-all in compile-scope. Not only I want to get rid of these (usually) test-dependencies, but also mockito-all contains some hamcrest-classes (in older versions) getting in conflict with the classes from spring-test
2015-04-11 16:59:19 +02:00
Spencer Gibb 3794213aaf add a note about the Spring Cloud DiscoveryClient.
fixes gh-276
2015-04-06 15:12:38 -06:00
Johannes Stelzer 6a0737dacf Example of static, loadbalanced Zuul configuration
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.
2015-04-02 20:33:05 +02: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
Spencer Gibb 814f7e9283 added warn logging to hystrix dashboard proxy servlet 2015-03-27 10:57:03 -06:00
Spencer Gibb 20bb1af655 added debug logging to hystrix dashboard proxy servlet 2015-03-27 10:11:53 -06:00
Roy Clarkson 370ce804e3 Update docs to use @EnableCircuitBreaker 2015-03-27 10:44:06 -05:00
Spencer Gibb 2d18706219 updated to use RestTemplateCustomizer 2015-03-26 11:45:37 -06:00
Spencer Gibb 8bfef044d2 fixed bad class name 2015-03-26 11:45:37 -06:00
Spencer Gibb 28db47c72a move RibbonClientHttpRequestFactory to configuration conditional on netflix httpclient classes 2015-03-26 11:45:37 -06:00
Spencer Gibb 55d46eb6c7 add support for ribbon http client in RestTemplate.
fixes gh-280
2015-03-26 11:45:37 -06: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
Spencer Gibb f5b6c58f30 upgrade hystrix to 1.4.1
fixes gh-279
2015-03-24 13:44:29 -06:00
Spencer Gibb f0d8c86b51 Only call shutdown() if DiscoveryClient is not null.
fixes spring-cloud-samples/tests/issues/2
2015-03-24 13:21:46 -06:00
unknown 76d0c018ee Ensure ZuulProperties.servletPath is applied to routes
Fixes gh-271, fixes gh-272
2015-03-24 13:17:43 +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
boostrack 9dc2821bc9 Small fixes to typos in docs
Fixes gh-274
2015-03-21 12:43:07 +00:00
Spencer Gibb 924363ca1c Sidecar reports true non-jvm app status to eureka.
Added a LocalApplicationHealthCheckHandler that checks the local app and sends the appropriate status to eureka.

fixes gh-251
2015-03-20 13:25:58 -06:00
Spencer Gibb 3515112cb2 move RestTemplate docs to s-c-commons 2015-03-20 13:00:19 -06: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
Spencer Gibb 869e3ec92f upgrade to feign 8.1.0
removes ugly dagger dependency

fixes gh-183
2015-03-19 12:13:11 -06:00
Spencer Gibb edbb0acc7c Merge pull request #266 from warmuuh/patch-1
updated documentation of HystrixHealthIndicator
2015-03-19 11:20:47 -04:00
Peter 98ac81bda2 updated documentation of HystrixHealthIndicator
documentation was not conform to specified behavior as in #24
2015-03-19 14:43:12 +01: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
Spencer Gibb f3ced9e0ed allow zuul to have multiple values for each named header
fixes gh-260
2015-03-16 15:19:07 -06: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 9fe69cc80a Merge pull request #258 from sampengilly/master
Added additional Gradle tip to Eureka Server documentation.
2015-03-16 13:31:45 +00:00
sampengilly a2b0b70b55 Added additional Gradle tip to Eureka Server documentation. Tip covers the usage of the spring dependency management plugin in order to prevent fatal crashes during application startup. 2015-03-16 21:05:52 +10: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
Spencer Gibb e2583f5380 upgrade Ribbon to version 2.0.0.
From 2.0.RC13

fixes gh-216
2015-03-06 12:47:27 -07:00
Spencer Gibb df7abd1bc9 added test ReadTimeout parameter 2015-03-06 12:20:02 -07:00
Dave Syer 164c9f8755 Add bintray properties 2015-03-06 10:48:29 +00:00
Spencer Gibb 384fad6c40 wrap SpringLBClientFactory in a CachingLBClientFactory so LBClients are reused.
fixes gh-240
2015-03-05 12:39:22 -07:00
Spencer Gibb 4bd7c3bdcf upgrade feign to 7.3.0
fixes gh-243
2015-03-05 11:42:09 -07:00
Spencer Gibb 4e795ea783 upgrade hystrix to 1.4.0
fixes gh-242
2015-03-03 17:23:26 -07:00
Dave Syer e3a20d5d6b Update to next snapshot 2015-03-03 14:56:26 +00:00
Spencer Gibb 7b6f14805d return null for choose() rather than throw an illegal argument exception.
fixes gh-236
2015-03-02 09:44:11 -07: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
Spencer Gibb dafb5ecf09 only set EurekaInstanceConfigBean.nonSecurePort in EurekaClientAutoConfiguration
fixes gh-225
2015-02-23 11:57:32 -07: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
Spencer Gibb 9623c83885 added docs on exposing /hystrix.stream 2015-02-19 10:26:50 -07:00
Roy Clarkson b6faa0e087 Fix spelling of 'broker' 2015-02-18 14:58:49 -08: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
Spencer Gibb 3c8568942d added a little to s-c-n-turbine-amqp
fixes spring-cloud/spring-cloud-bus/issues/7
2015-02-14 13:24:57 -07:00
Spencer Gibb 4754a1e160 an attempt at some sidecar documentation
fixes gh-201
2015-02-13 14:45:30 -07:00
Spencer Gibb fc7cc4916e remove netflix bintray maven repo as blitz4j 1.36.0 is in maven central 2015-02-13 14:10:25 -07:00
Spencer Gibb 572f97e135 remove getAllInstances 2015-02-13 13:30:25 -07:00
Spencer Gibb f49d99ef5b Pass LB IClientConfig to executeWithLoadBalancer
fixes 208
2015-02-13 12:33:01 -07:00
Spencer Gibb 149cc7d760 Implement ServiceInstance.{getUri,isSecure}
fixes gh-210
2015-02-13 11:29:59 -07: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
Spencer Gibb 2d8085cc24 fix the base href of the hystrix dashboard pages
fixes gh-204
2015-02-10 11:31:16 -07:00
Spencer Gibb 24a06ca630 only update route location if location is empty. Fixes bug introduced in 18b346def1 2015-02-09 21:08:21 -07:00
Spencer Gibb 18b346def1 update the serviceId and location for statically configured routes that are also part of serviceDiscovery.
fixes gh-199
2015-02-09 17:30:23 -07: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
Spencer Gibb 06d0bbe779 add netflixoss bintray 2015-02-05 14:19:02 -07:00
Spencer Gibb 94b0b7b692 add additional /hystrix.stream endpoint integration test 2015-02-05 14:18:44 -07:00
Spencer Gibb 27c418825d Revert "move /hystrix.stream from an endpoint to a servlet"
This reverts commit 29bee28db5.
2015-02-05 13:08:32 -07: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
Dave Syer b8cf89fb45 Use an HttpMessageConverter for form body
Instead of building a String, if we use an existing
HttpMessageConverter from Spring web, we can support multipart
form data.

Fixes gh-197 (hopefully)
2015-02-05 16:32:33 +01:00
Dave Syer 069afb2a73 Use logback by default in Eureka server
Now that blitz4j 1.36.0 is out, with a bit of hackery we can prevent
it from barfing on startup. Seems worth it (and certainly makes
it easier to embed Eureka server).

Fixes gh-3
2015-02-05 12:01:12 +01:00
Dave Syer be0c2287ae Documentation for status page and health URL paths
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
2015-02-04 15:57:45 +01:00
Dave Syer 00a951c1f1 Clarify status of @EnableEurekaClient
Fixes gh-194
2015-02-04 15:50:18 +01:00
Julien Roy 00b689f58a Add retryable property on Zuul route configuration
The ProxyRouteLocator now has a retryable property (default
null which means Ribbon will choose the default - usually false).

Fixes gh-115, fixes gh-124
2015-02-04 15:02:49 +01:00
Dave Syer 9fb833e4a9 Fix paths in /hystrix HTML pages
When running from /hystrix or from / (with a forward) the
webjars and the monitor endpoint need to be resolvable, so
we need to use the FTL macros again.

Fixes gh-193
2015-02-04 11:54:08 +01:00
Dave Syer 4c5179130e Add metadataMap option for Server.zone
Adds a metadataMap for the Server.zone so that user can
provide the data through external configuration if needed.
2015-02-03 12:13:21 +01:00
Dave Syer 4afc44acaf Catch exception and log instead of failing
Some singleton clashes are inevitable if running multiple
apps i nteh same JVM, but we can at least try and not fall off
a cliff when they happen.
2015-02-03 10:38:57 +01:00
Dave Syer 4f39b64f26 Make test Eureka run on port 8761 2015-02-03 10:38:39 +01:00
Dave Syer 63e6c813a3 Remove guava usages (fixes gh-154) 2015-01-30 14:10:38 +00:00
Spencer Gibb 29bee28db5 move /hystrix.stream from an endpoint to a servlet
fixes gh-187
2015-01-29 13:28:33 -07:00
Spencer Gibb 42422bef5c prepend http:// to feign url if not there 2015-01-29 11:53:14 -07:00
Dave Syer 8410b8938a Fix autconfig class name in renamed package 2015-01-29 17:59:02 +00:00
Dave Syer 6dc0bd5f5e Refactor @FeignClient to use name= or url= but not both
Replaces the boolean flag (loadbalance) for switching between service
resolution (by name) or straight URL bashing.
2015-01-29 17:40:56 +00:00
Dave Syer 9aa979cd31 @FeignClientScan -> @EnableFeignClients
By analogy with @EnableJpaRepositories, so it's obvious that
the same thing will happen (interfaces are turned into concrete
@Beans).
2015-01-29 17:39:59 +00:00
Dave Syer fe08762f50 Rename package that was missing 'cloud' 2015-01-29 17:39:59 +00:00
Dave Syer e100207e8a Clarify and document some Feign stuff 2015-01-29 17:39:59 +00:00
Spencer Gibb a739884207 added preferIpAddress section to eureka and updated ribbon docs to show what beans are created by default and how to override them. 2015-01-29 09:55:17 -07:00
Spencer Gibb 39eb9815b6 Merge branch 'loadbalancer-builder' 2015-01-29 08:27:11 -07:00
Dave Syer 91e3bee54b Update some dependencies 2015-01-29 11:24:20 +00:00
Spencer Gibb af0b24d1a2 use LoadBalancerBuilder so all parts of the LoadBalancer can be injected via Spring.
This includes support for: ServerList, ServerListFilter, IRule, IPing and IClientConfig.
 Eliminates custom wrapping of ServerList.

 fixes gh-185
2015-01-28 12:33:32 -07:00
Dave Syer b5bd371d8c Be defiensive about errors getting remote status 2015-01-27 07:29:27 +00:00
Spencer Gibb 01c5b44a18 propagate EnvironmentChangeEvents to archaius dynamic property listenters
fixes gh-144
2015-01-26 22:16:09 -07:00
Spencer Gibb 614ec44c04 update sidecare enabled property, make eureka portion of config conditional on eureka on classpath so other DiscoveryClient impls can use it. 2015-01-26 22:01:21 -07:00
Spencer Gibb d78982973e add support for feign RequestInterceptors
fixes gh-159
2015-01-26 21:45:18 -07:00
Spencer Gibb 6435b73f40 remove EurekaHeartbeatEvent 2015-01-26 21:16:14 -07:00
Spencer Gibb 81bc83312c removed TODOs that are out of date 2015-01-26 20:48:39 -07:00
Spencer Gibb 01abd6d123 removed in favor of github issues 2015-01-26 20:45:06 -07:00
Spencer Gibb 5c84080d62 Upgrade netflix archaius to 0.6.5
fixes gh-179
2015-01-26 15:44:41 -07:00
Spencer Gibb 32a9033661 upgrade to netflix eureka to 1.1.147
fixes gh-180
2015-01-26 15:30:06 -07:00
Spencer Gibb 49b81607a3 upgrade to netflix hystrix to 1.4.0-RC6
fixes gh-182
2015-01-26 15:04:28 -07:00
Spencer Gibb e265a5e3c8 upgrade to netflix feign 7.1.0.
Add feign-slf4j support.

fixes gh-178
2015-01-26 14:54:01 -07:00
Dave Syer b2301434d2 Align with API changes from config client 2015-01-25 11:49:13 +00:00
Spencer Gibb cdf34fddb1 Auto configure EurekaClientAutoConfiguration after NoopDiscoveryClientAutoConfiguration 2015-01-23 10:55:37 -07:00
Dave Syer d04800597c De-tangle zuul packages
The main problem here was the ZuulProperties being used everywhere. I also
took the opportunity to thin out the top level zuul package and keep the
web and route locator pieces in sub-packages for readability.

Fixes gh-172
2015-01-23 09:10:37 +00:00
Dave Syer 6b01e61dec Untangle ribbon/eureka
A cleaner separation of ribbon and the eureka-dependent ribbon
configuration is achieved by adding a BeanPostProcessor to do the
ServerList wrapping, instead of doing it for every single ribbon
client.

See gh-172
2015-01-23 08:57:58 +00:00
Spencer Gibb ea4ea4a54d proxy DiscoveryHeartbeatEvent's from parent to child be publishing a EurekaHeartbeatEvent and having zuul listen for EurekaHeartbeatEvent as well.
fixes gh-171
2015-01-22 16:08:05 -07:00
Dave Syer f18aeab873 Replace some of the log/printStackTraces with ignores
Fixes gh-153
2015-01-22 07:08:55 +00:00
Spencer Gibb a45c0ccec8 change printStackTrace to commons log statements
fixes gh-153
2015-01-21 19:26:54 -07:00
Dave Syer c31f700bae Use serviceId as prefix for RibbonCommand hystrix command key
Fixes gh-160
2015-01-19 16:13:13 +00:00
Spencer Gibb a0b73fe7c7 migrate from slf4j to commons logging
fixes gh-147
2015-01-15 14:31:20 -07:00
Spencer Gibb e7331098fa change protected and package scope fields to private
fixes gh-149
2015-01-15 12:02:19 -07:00
Spencer Gibb 84554725db Merge branch 'philwebb-polish' 2015-01-15 11:05:24 -07:00
Spencer Gibb f1bd9bdfaa Merge branch 'polish' of https://github.com/philwebb/spring-cloud-netflix into philwebb-polish
Conflicts:
	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClient.java
	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientScan.java
	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/route/RibbonRoutingFilter.java
	spring-cloud-netflix-turbine-amqp/src/test/java/org/springframework/cloud/netflix/turbine/amqp/AggregatorTest.java
2015-01-15 11:04:47 -07:00
Dave Syer 5847175344 Rename Turbine port listener class and add tests 2015-01-15 16:07:06 +00:00
Dave Syer e2e09c4616 Default turbine.amqp.port to server.port and allow Actuator endpoints
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
2015-01-15 15:34:58 +00:00
Dave Syer 0e4eb9ef1f Use @ConditionalOnProperty where possible 2015-01-15 14:07:52 +00:00
Dave Syer 90d7e5df7a Correct Javadocs in *FeignClient
Fixes gh-151
2015-01-15 13:52:37 +00:00
Dave Syer 89ca05bf3e Remove printStackTrace() in test app 2015-01-15 13:46:49 +00:00
Dave Syer 17484fad3a Use Enum.valueOf() instead of case switch
Fixes gh-156
2015-01-15 13:35:15 +00:00
Phillip Webb 8b6307e703 Use BDD Mockito 2015-01-14 14:57:26 -08:00
Phillip Webb 3ea0f8d283 Polish 2015-01-14 14:49:23 -08:00
Phillip Webb 9d823513c3 Add copyright headers 2015-01-14 13:24:18 -08:00
Phillip Webb 6a7676a93f Apply eclipse formatting and cleanup 2015-01-14 13:10:41 -08:00
Phillip Webb 911627c09d Add eclipse formatting and cleanup configuration 2015-01-14 13:09:14 -08:00
Phillip Webb be436279cf Polish POM files 2015-01-14 13:04:26 -08:00
Spencer Gibb 6e078a88e8 make messageConverters lazy in SpringDecoder and SpringEncoder
fixes gh-129
2015-01-14 09:36:27 -07:00
Spencer Gibb 8fb85f26ea add a test to make sure that proxy paths with /another/level/** works 2015-01-13 21:51:09 -07:00
Spencer Gibb 3d91dae0c4 only forward if response is not committed. 2015-01-08 14:52:27 -07:00
Spencer Gibb 95541e0102 only run SendErrorFilter once (fixes recursive forwarding if /error fails) 2015-01-08 12:13:27 -07:00
Spencer Gibb 64e5a2e0ba protect against a null RequestDispatcher 2015-01-07 11:54:27 -07:00
Spencer Gibb 758d86e793 integration tests for s-c-n-hystrix-amqp and s-c-n-turbine-amqp 2015-01-06 20:47:26 -07:00
Spencer Gibb a57c358702 prefix hystrix metric same with context id and add ability to disable.
fixes gh-135

created hystrix.stream.amqp.send-id to allow disabling of sending the context id as the metric id.  Turbine AMQP then defaults to serviceId:host:port

fixes gh-131
2015-01-06 16:35:36 -07:00
Spencer Gibb c992066ac0 only create the /routes endpoint if actuator is on the classpath 2015-01-06 09:59:21 -07:00
Dave Syer da6da6d76c Re-organise headers in the /trace of Zuul requests
Now they match better what the vanilla /trace data does in terms of
object and field names.
2015-01-06 16:41:03 +00:00
Dave Syer 242886916f Fix test in build server VM 2015-01-04 09:01:45 +00:00
Dave Syer a5d2d2abe5 Add configuration properties for Eureka dashboard
Not used by the app itself, but will show up in metadata reports
and in tooling, so useful for documentation purposes.

See gh-125
2015-01-03 16:30:38 +00:00
Dave Syer e6c7422c00 Use <@spring.url/> for all relative paths in FTL
Fixes gh-125
2015-01-02 16:06:48 +00:00
Julien Roy 11201762a7 Eureka dashboard controller path mapping can be configured or disabled 2015-01-02 15:49:37 +00:00
Dave Syer 8f8e738ffd Use JSON for AMQP Hystrix data
Fixes gh-126
2015-01-02 15:20:50 +00:00
Dave Syer a9213f2416 Allow @RibbonClient("foo") as a short cut 2015-01-02 09:47:46 +00:00
Dave Syer ec2d732bb4 Add back EnableHystrix as a courtesy 2015-01-02 09:09:42 +00:00
Dave Syer 52c9310bb0 Add back EnableEurekaClient as a courtesy
It's nice to have an annotation to say "I want Eureka discovery".
At the moment it is a pass thru for @EnableDiscoveryClient, but
in principle it could be used to select Eureka over another provider
even if both were on the classpath.
2015-01-02 09:06:37 +00:00
Julien Roy 9266785134 Fix Zuul proxy POST on content-type with charset
Fixes gh-113
2015-01-01 09:00:05 +00:00
Dave Syer 9c416bf627 Use getHostname() instead of field in DatacenterInfo
Fixes gh-122
2015-01-01 08:54:45 +00:00
Dave Syer 3bbe4ae249 Ensure SpringClientFactory gets used for Feign clients
If the ClientFactory from netflix is used directly it bypasses
all the goodness in SpringClientFactory, so clients created
in Feign before this change were getting the default native
configuration instead of that provided by
RibbonClientConfiguration.

There are no remaining references to the raw ClientFactory in
Spring Cloud, so we probably have seen the last of this.

Fixes gh-118
2014-12-26 16:20:41 +00:00
Dave Syer 33b05a5018 Add docs for Ribbon and Feign 2014-12-26 14:55:13 +00:00
Dave Syer 34785b6bdd Make actuator dependency optional in netflix-core
Fixes gh-117
2014-12-26 14:03:12 +00:00
Dave Syer 4a77b86d08 Minify Javascript so it isn't needed in jars at runtime 2014-12-26 09:39:22 +00:00
Spencer Gibb 7b0824fb78 add some hystrix tests, specifically check there is no discovery health indicator if it is not turned on
fixes gh-112
2014-12-19 14:49:55 -07:00
Spencer Gibb f2c112f9ad updated turbine docs to show the need to uppercase turbine.aggregator.clusterConfig
fixes gh-84
2014-12-19 14:48:38 -07:00
Dave Syer fa7286ebdb Fix badge in README 2014-12-19 13:11:43 +00:00
Dave Syer 9939e0ecd9 Convert form-encoded request to byte[] for proxy
With just a bit more hackery on the Zuul request wrapper we can mask
off the input stream and content lengths, and fix them so they contain
the expected content. Doesn't work (yet) for multipart content.

Fixes gh-109
2014-12-19 12:52:54 +00:00
Spencer Gibb e7956e199e updated feign docs to use new @FeignClient*
fixes gh-111
2014-12-18 12:04:27 -07:00
Spencer Gibb 9ba39c990a add *-amqp projects to dep mgmt 2014-12-17 14:40:58 -07:00
Spencer Gibb 85a3e82da6 remove references to bus 2014-12-17 13:50:04 -07:00
Spencer Gibb 4dc7972fa5 moved spring-cloud-bus-{hystrix,turbine} to spring-cloud-netflix-{hystrix,turbine}-amqp
fixes gh-108
2014-12-17 13:26:21 -07:00
Spencer Gibb 71d0a474f7 cleanup threads in DiscoveryClient.jerseyClient and ServoMetricCollector 2014-12-16 16:13:04 -07:00
Spencer Gibb d4d1fe7f63 cleanup timer thread in zuul filter 2014-12-16 15:38:27 -07:00
Spencer Gibb 5287d5be0c Merge branch 'royclarkson-freemarker-config' 2014-12-16 15:09:35 -07:00
Roy Clarkson 2c451ad73e Fix issue where the Hystrix dashboard will not load
Overrides Spring Boot's FreeMarkerAutoConfiguration to prefer using a
SpringTemplateLoader instead of the file system. This corrects an issue
where Spring Boot may use an empty 'templates' file resource to resolve
templates instead of the packaged Hystrix classpath templates.

When creating a new project with Spring initializer, an empty
'templates' resource directory is automatically added to the new
project, causing a scenario where this issue may occur.
2014-12-16 15:43:13 -06:00
Roy Clarkson 75ff9540bb Fix typos in README 2014-12-16 12:28:38 -06:00
Dave Syer e623ad1061 Fix ordering problem in tests
The Zuul filter registry has to be cleareed (including a cache in
a private field in FilterLoader, yuck).
2014-12-16 10:49:54 +00:00
Dave Syer 311d87885c Re-instate @EnableZuulServer and simplifiy configuration a bit
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
2014-12-16 09:00:28 +00:00
Spencer Gibb 789cf6d752 change the default route from / to /**
fixes gh-105
2014-12-15 17:15:49 -07:00
Spencer Gibb 4d9281c2af reset zuul routes when eureka sends catalog delta.
fixes gh-76
2014-12-15 16:23:28 -07:00
Spencer Gibb 7423decc54 updated EurekaHealthIndicator to implement the new DiscoveryHealthIndicator
fixes gh-98
2014-12-15 13:19:01 -07:00
Dave Syer 70648b0ec0 Tidy compiler warnings 2014-12-15 17:10:29 +00:00
Dave Syer 238c1329c4 Remove dependency on jersey for ProxyRequestHelper 2014-12-15 13:11:13 +00:00
Dave Syer 2a8db73d9b Extract header manipulation into a helper and add test
Ribbon and simple host reverse proxy now share quite a lot of
code (everything to do with headers).

Fixes gh-103
2014-12-15 11:25:16 +00:00
Dave Syer 73e7adbe5b Extract base class with params and headers for proxy filters
Fixes gh-103
2014-12-15 07:33:00 +00:00
Spencer Gibb 096a8fa736 ignore breaking test for a moment 2014-12-12 14:07:32 -07:00
Spencer Gibb 4a6d8a30f0 removed circular dependency between EurekaClientAutoConfiguration and EurekaDiscoveryClientConfiguration that caused DiscoveryClientConfigServiceBootstrapConfiguration to fail.
fixes gh-99
2014-12-12 12:29:32 -07:00
Dave Syer f468160693 Add auth.route.* for controlling OAuth2 token relay
If user adds auth.route.<service>.scheme: passthru then instead
of adding the bearer token the filter will not do anything
(and the normal authorization header will be passed through
to the backend)

See gh-19
2014-12-12 11:34:15 +00:00
Dave Syer 16c25a2875 Clarify that path to dashboard doesn't require "index.html"
See gh-51
2014-12-12 11:34:15 +00:00
Spencer Gibb 7765c721ca basePath should always be /contextPath/servletPath/ (the last slash being the location of the eureka dashboard)
fixes gh-101
2014-12-11 16:52:17 -07:00
Spencer Gibb ba6a414d1d fix double slashes in eureka server
fixes gh-100
2014-12-11 16:10:55 -07:00
Dave Syer a2fade98a5 Change docs path in README 2014-12-11 15:41:36 +00:00
Dave Syer 7ba9998646 Add optional/runtime to lombok 2014-12-11 15:32:48 +00:00
Dave Syer 27da0bc12e Simplify implementation of servo metrics 2014-12-11 12:25:13 +00:00
Roy Clarkson 64c447f0cb Fix Travis CI image and link in README 2014-12-10 13:50:26 -06:00
Dave Syer 6d20c63445 Ensure servo metrics contribute to health indicator
Without this change the health status is always UNKNOWN because it
never finds the servo metrics for the health indicator. It's also
a general spruce up of the servo and eureka metrics and health
infrastructure which was looking a little more complicated than
it needed to be (no need for a separate MetricReader).
2014-12-09 17:38:15 +00:00
Dave Syer 29eea6d9b6 Call postInit() aggressively on InstanceRegistry
To avoid possible NPE when the registry is used before it is initialized.

Fixes gh-97
2014-12-09 15:11:27 +00:00
Dave Syer 67878cfebd Rename @EnableRibbonClient to just @RibbonClients 2014-12-09 13:37:59 +00:00
Dave Syer e155601c40 Add log at info when Eureka starts 2014-12-09 10:55:45 +00:00
Spencer Gibb 56f1a365fc add /hosts/appName and renamed misspelled bootstrapyml 2014-12-08 23:16:35 -07:00
Spencer Gibb 2545a0151b Only approximate zone if ribbon.eureka.approximateZoneFromHostname = true 2014-12-08 23:13:27 -07:00
Spencer Gibb f92e0103bb Merge branch 'master' into feignclient
Conflicts:
	spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/SpringDecoderTests.java
2014-12-08 11:30:44 -07:00
Spencer Gibb c1e6832dee add @DirtiesContext to tests 2014-12-08 10:32:08 -07:00
Dave Syer 6417923523 Extract ribbon client factory into ApplicationContext
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.
2014-12-08 15:54:38 +00:00
Dave Syer bfb6ca6d8d Ditch SpringFilter in favour of proper dependency injection 2014-12-06 09:15:01 +00:00
Spencer Gibb 92a3454237 Polish 2014-12-05 15:40:40 -07:00
Spencer Gibb 05e8777fc3 add missing feign objects as not required values.
Document FeignClient
2014-12-05 15:31:40 -07:00
Spencer Gibb 7f9642ff38 new @FeignClient annotation 2014-12-05 15:24:00 -07:00
Spencer Gibb b7db65863f rename FeignConfigurer to FeignConfiguration
fixes gh-91
2014-12-05 12:23:02 -07:00
Spencer Gibb 3b7cc53c27 Merge branch 'jlouns-master' 2014-12-04 17:06:54 -07:00
Spencer Gibb 45e9a6208b Merge branch 'master' of github.com:jlouns/spring-cloud-netflix into jlouns-master 2014-12-04 16:32:04 -07:00
Jonathan Lounsbury 51f7dbd724 Simplifying readdition of route 2014-12-04 14:26:08 -05:00
Jonathan Lounsbury d999b802bc Fixing issue with default routes 2014-12-04 14:05:38 -05:00
Spencer Gibb 5964d160a1 remove deprecated @EnableEurekaClient and replace with @EnableDiscoveryClient
fixes gh-85
2014-12-04 11:51:18 -07:00
Spencer Gibb 3333cbeb99 remove deprecated @EnableHystrix
fixes gh-87
2014-12-04 11:50:31 -07:00
Spencer Gibb 88a8201693 Polish 2014-12-04 11:49:39 -07:00
Dave Syer fc0aac3b01 Add paragraph in docs about eureka instance id
Fixes gh-63
2014-12-04 18:00:54 +00:00
Dave Syer 0f281bc9e1 Initialize log4j to prevent blitz4j from freaking out 2014-12-04 18:00:38 +00:00
Dave Syer 4e2148d634 Add default value (and log warning) if applicationId is null
Fixes gh-86
2014-12-04 15:59:30 +00:00
Dave Syer aed4369502 Add ignored test to show that blitz4j is not responding
Blitz4j is definitely preventing the log levels from being changed at runtime
through the normal Spring boot channels.

Fixes gh-48
2014-12-04 15:23:10 +00:00
Dave Syer a1ae9673bf Add ignored test to show that blitz4j is not responding
Blitz4j is definitely preventing the log levels from being changed at runtime
through the normal Spring boot channels.

Fixes gh-48
2014-12-04 15:15:48 +00:00
Dave Syer 4a6193e790 Ensure app without Actuator can start 2014-12-04 15:15:38 +00:00
Dave Syer dfae445499 Strip prefixes from zuul routes by default
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
2014-12-04 11:55:57 +00:00
Dave Syer 7b270c4b46 Add support for X-Forwarded-Prefix to Zuul proxy
Fixes gh-43
2014-12-04 09:57:34 +00:00
Spencer Gibb 9c6474fba1 Make ZuulHandlerMapping @RefreshScope.
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)
2014-12-03 11:50:19 -07:00
Dave Syer 5246b93295 Remove reflection hack 2014-12-03 15:06:24 +00:00
Dave Syer aca1897f85 Compiler warnings 2014-12-03 12:51:27 +00:00
Dave Syer 2cdcd767ac Move some of the routing logic into the route locator
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
2014-12-03 10:51:17 +00:00
Dave Syer 34f277b816 Add ZuulRoute as values object in zuul.routes
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
2014-12-03 10:31:09 +00:00
Dave Syer 7e91b9ea21 Rename some Zuul config keys
zuul.route -> zuul.routes
zuul.mapping -> zuul.prefix
2014-12-03 10:31:09 +00:00
Spencer Gibb e272f8d660 change caches to ConcurrentHashMap 2014-12-02 16:41:18 -07:00
Spencer Gibb acfecc38ff renamed Hystrix and Eureka configurations 2014-12-02 15:32:53 -07:00
Spencer Gibb 3a06632301 added @EnableCircuitBreaker deprecated @EnableHystrix.
removed classes now in spring-cloud-commons
2014-12-02 15:28:45 -07:00
Spencer Gibb 61ea784300 added @EnableDiscoveryClient, deprecated @EnableEurekaClient 2014-12-02 13:47:55 -07:00
Spencer Gibb 79ceebb1d0 Merge branch 'vanroy-feign-ribbon' 2014-12-01 13:15:48 -07:00
Spencer Gibb a7c6c88ff0 renamed RibbonLoadBalancerClient to FeignRibbonClient 2014-12-01 13:14:14 -07:00
Spencer Gibb 3d7cc70757 Merge branch 'feign-ribbon' of github.com:VanRoy/spring-cloud-netflix into vanroy-feign-ribbon 2014-12-01 11:52:33 -07:00
Julien Roy 943d1b9bbe Connect Feign to resilient Ribbon client 2014-12-01 14:31:51 +01:00
Dave Syer 70c3d9e784 Ensure user-suppplied ZuulFilters are added properly
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
2014-11-29 09:29:24 +00:00
Spencer Gibb 9add6f1edf don't send an entity on DELETE's through RibbonRoutingFilter
fixes gh-73
2014-11-26 13:38:26 -07:00
Spencer Gibb c28b3252fb added a get to the same path as a delete 2014-11-26 11:38:51 -07:00
Spencer Gibb f79166cb8e fixed test broken by change in functionality in ZuulHandlerMapping.reset 2014-11-26 11:28:00 -07:00
Spencer Gibb c0903c5a22 add pkg protected resetRoutes so new mappings can be created via post to /routes 2014-11-26 11:00:55 -07:00
Dave Syer 8e16789ee3 /route -> /routes 2014-11-26 17:42:28 +00:00
Dave Syer ddf7edebf9 /proxy/routes -> /routes 2014-11-26 17:17:12 +00:00
Dave Syer de4822e801 Add test for DELETE on zuul proxy route
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
2014-11-26 13:50:27 +00:00
Dave Syer 9c6566bc9b Explicitly allow all HTTP methods in ZuulController 2014-11-26 13:14:40 +00:00
Dave Syer 45420b9618 Remove debug logging (use /trace instead) 2014-11-26 13:14:10 +00:00
Dave Syer 065d91fdbe Allow user to map physical routes in zuul.route
E.g.

zuul:
  route:
    testclient: /testing123/**         # service mapping
    http://localhost:8081: /stores/**  # physical mapping
2014-11-26 11:58:06 +00:00
Dave Syer ce1fcb1552 Remove ugly depednency on Environment
You can bind to a Map<String,String> with application.yml, so there's
no need to work so hard to extract the zuul routes.
2014-11-26 11:05:49 +00:00
Dave Syer 243e163de4 Add JMX and MVC endpoints to ZuulHandlerMapping
User can now list routes with /zuul/routes and reset with a
POST.

Fixes gh-75
2014-11-26 10:50:23 +00:00
Dave Syer 05fe175223 Move field injection into @Configuration 2014-11-26 09:58:05 +00:00
Dave Syer cee619d4ff Fix travis build script 2014-11-26 09:26:26 +00:00
Spencer Gibb 9bc8a5039d Fire InstanceRegisterEvent after eureka registration, then components can listen for that event and safely access DiscoveryClient. 2014-11-25 17:19:02 -07:00
Spencer Gibb a3ce593bf6 ignore test till fixed 2014-11-25 17:02:43 -07:00
Spencer Gibb 760429b64f ignore test till fixed 2014-11-25 16:56:22 -07:00
Spencer Gibb 98f37d36d8 added simple python http server as a test non-jvm app 2014-11-25 16:46:10 -07:00
Spencer Gibb 198cb5997b updated sidecar so the health and info urls go to sidecar, but homepage and non-secure-port go to local app 2014-11-25 16:44:28 -07:00
Spencer Gibb dc12c23596 Merge branch 'sidecar'
Conflicts:
	pom.xml
	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/client/discovery/DiscoveryClient.java
	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClient.java
2014-11-25 15:51:51 -07:00
Spencer Gibb 75addf04d3 change zuul implementation to be controller/handler mapping based.
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
2014-11-25 15:48:30 -07:00
Dave Syer 7c4e3100ca Fix pull request builds 2014-11-25 09:48:32 +00:00
Spencer Gibb f14297ceb2 initial sidecar implementation 2014-11-25 01:06:47 -07:00
Spencer Gibb c8c8b6d0f6 Merge pull request #71 from spring-cloud/netflix-versions
update versions of netflix libs
2014-11-24 23:50:52 -07:00
Spencer Gibb dfaad78ddb update versions of netflix libs 2014-11-24 23:42:59 -07:00
Spencer Gibb e51f0cae37 add zuul-server to dep mgmt 2014-11-24 23:26:29 -07:00
Spencer Gibb 79db27226f added documentation for zuul options.
fixes gh-68
2014-11-24 11:26:37 -07:00
Dave Syer 230efab8d9 Exclude groovy-all from zuul 2014-11-24 11:51:07 +00:00
Dave Syer d2cfcb0c2d Fix formatting 2014-11-22 17:01:21 +00:00
Spencer Gibb 162eb1a2e2 allow ipAddress to be used based on ribbon.UseIPAddrForServer.
fixes gh-67
2014-11-21 15:24:38 -07:00
Spencer Gibb b6426e1bb4 Merge pull request #66 from scottfrederick/docs
Fixed formatting in docs.
2014-11-21 11:10:13 -07:00
Dave Syer dde3055b6c Exclude event-bus (optional dependency) 2014-11-21 11:56:11 +00:00
Dave Syer 7b325044c1 Update wro4j to run in Eclipse 2014-11-21 09:32:12 +00:00
Scott Frederick 151ae8e6e1 Fixed formatting in docs. 2014-11-20 12:56:25 -06:00
Spencer Gibb acaf2d2047 Only set ribbon properties if they are not already set.
fixes gh-45
2014-11-19 13:10:00 -07:00
Dave Syer d2988b2179 Add metadata to Eureka entry for config server
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
2014-11-17 14:46:56 +00:00
Dave Syer ed053e9b9b Add contributing section to README 2014-11-17 10:29:14 +00:00
Spencer Gibb eba0cc0b7a Use Ribbon LoadBalancerContext to record statistics of an execution.
Added LoadBalancerClient.reconstructURI to take an URI with the service as hostname and inject a real host and port.
Added tests for RibbonInterceptor and RibbonLoadBalancerClient.

fixes gh-37
2014-11-13 18:11:17 -07:00
Dave Syer 5cd88deb38 Use custom DataCenterInfo to make instance ID unique
The problem manifests itself as errors in the Eureka server
log (gh-47), but originates in the client because it is sending
requests to /eureka/apps/{NAME}/{ID} with the wrong ID. The
InstanceInfo has an ID that is derived (for preference) from
the EurekaInstanceConfig.dataCenterInfo, so that's the best
way to fix it.

See gh-63, Fixes gh-47
2014-11-13 10:22:56 +00:00
Dave Syer dc1aab94eb Use interfaces for Eureka config 2014-11-11 15:19:59 +00:00
Dave Syer 88db9976c6 Move hystrix templates to /hystrix/* 2014-11-10 13:55:11 +00:00
Spencer Gibb 8c8844f34d Use spring ReflectionUtils to find zuul HttpServletRequestWrapper field 2014-11-06 11:58:53 -07:00
Spencer Gibb 8b2254a338 Register a HealthCheckHandler on DiscoveryClient if there is a HealthCheckHandler bean registered.
fixes gh-50
2014-11-05 19:11:35 -07:00
Spencer Gibb c752cc31db fix logging of initial eureka status 2014-11-05 18:54:14 -07:00
Spencer Gibb de9af2b4df Added eureka.instance.initial-status to customize the starting status.
fixes gh-53
2014-11-05 18:42:20 -07:00
Spencer Gibb 0f573dfe94 Added notes about how to configure @HystrixCommand and where to go to find out more information.
fixes gh-58
2014-11-05 18:18:04 -07:00
Spencer Gibb 1cd06e657e Don't swallow execeptions with zuul by reusing the spring boot error facilities.
fixes gh-40
2014-11-05 18:08:23 -07:00
Spencer Gibb f215c52f3c updated docs to reflect that feign will now handle Generics 2014-11-05 13:37:19 -07:00
Spencer Gibb 8756a88878 allow feign to decode parameterized types. Added SpringDecoderTests.
fixes gh-57
2014-11-05 13:28:15 -07:00
Dave Syer bebcf66041 Add some documentation on DiscoveryClient
and how to use it. In particular you can't use it before the
ApplicationContext is past phase=0 of lifecycle startup.

Fixes gh-48
2014-11-05 17:25:34 +00:00
Dave Syer d944145ce3 Make hystrix dashboard work with a context path
I didn't see a way to do this without dynamic rendering, so
now we have a freemarker dependency (not huge I guess).

Fixes gh-51
2014-11-05 16:59:09 +00:00
Dave Syer 5ef304a4e8 Make sure /hystrix.stream has the correct path
Fixes gh-52
2014-11-05 15:23:14 +00:00
Dave Syer af1278a472 Ensure static resources load from relative paths
Most browsers support <base href="..."> these days and there
was one already in statut.ftl (but not in navbar). Added a test
that asserts the css is loadable as well.

Fixes gh-55
2014-11-05 14:47:24 +00:00
Spencer Gibb e2e193eaa7 added support for standalone zuul server with @EnableZuulServer.
Removed old zuul module.

fixes gh-14
2014-11-04 15:17:35 -07:00
Spencer Gibb eba7f0dac3 move SpringClientFactory bean creation to RibbonAutoConfiguration where it should have been in the first place.
fixes gh-35
2014-11-03 12:41:00 -07:00
Dave Syer 9768a76bf5 Update README 2014-10-31 16:17:30 +00:00
Dave Syer c67caa2b2f Update README with building section 2014-10-31 15:59:33 +00:00
Spencer Gibb 7a7dffad6a make FeignAutoConfiguration conditional on class Feign.class 2014-10-30 19:53:17 -06:00
Spencer Gibb ce5b1bbbfb allow customization of turbine clusterName via SPEL expression in applcation.properties.
Fixes gh-49
2014-10-30 19:41:53 -06:00
Spencer Gibb 766ac6b852 add a bit of turbine documentation 2014-10-30 18:38:27 -06:00
Spencer Gibb 33aec89b58 remove unneeded deps 2014-10-30 18:13:24 -06:00
Spencer Gibb d189369015 polish 2014-10-30 18:13:00 -06:00
Christian Dupuis f143c78212 Re-added lost import (what happened Eclipse?) 2014-10-30 13:20:19 +01:00
Christian Dupuis 1ddda3ea78 Polish 2014-10-30 13:15:57 +01:00
Christian Dupuis 4390b79501 Retrieve servo metrics directly instead of grabbing them from JMX
fixes #16
2014-10-30 13:14:34 +01:00
Dave Syer c4a53a5233 Use injected ConfigClientProperties to set defaults 2014-10-30 11:44:03 +00:00
Dave Syer 1f2beba00d Add some @Conditionals to enable non-netflix apps to start 2014-10-30 07:29:00 +00:00
Christian Dupuis d715ec570f Add paragraph to documentation about Hystrix /health endpoint 2014-10-28 13:10:16 +01:00
Christian Dupuis 77b6641ac1 Introduced a new status for open circuits in the /health endpoint 2014-10-28 12:57:56 +01:00
Christian Dupuis cbec02092f Add Hystrix HealthIndicator 2014-10-28 11:09:35 +01:00
Dave Syer b533ad3bb2 Switch to spring.cloud.config.bootstrap.enabled=true
To enable EUreka-first bootstrap.

See gh-42
2014-10-26 15:35:11 +00:00
Dave Syer 46e6d24aa8 Add basic authentication for config server
Fixes gh-42
2014-10-26 14:41:20 +00:00
Dave Syer 8ff3462ad8 Add bootstrap configuration for eureka-first
See gh-42
2014-10-26 14:40:48 +00:00
Dave Syer dd967120aa Add eureka peer awareness docs
It works quite well locally actually. I tested with hostnames
127.0.0.1 and 127.0.1.1 and 2 servers running on localhost.

See gh-28
2014-10-24 16:29:57 +01:00
Dave Syer 7c67fe28bc Remove references to starters in spring-cloud-netflix
Fixes gh-46
2014-10-23 12:48:43 -07:00
Dave Syer 83ed396939 Add back trace filter 2014-10-23 11:57:41 -07:00
Dave Syer 35d02f75ae Switch eureka endpoint to /eureka
All static content is excluded in the Jersey config, so we can use
/eureka for the prefix to the Eureka API (i.e. /apps etc.)

Fixes gh-44
2014-10-23 11:16:39 -07:00
Dave Syer cce52424af Add ArchaiusEndpoint (/archaius) to inspect native Netflix config
Unfortunately only properties that have been set show up (unlike
/configprops), but possibly better than nothing. You can see some
in the Eureka server or in the customers sample (once it has
tries to contact the stores service and Ribbon is up and running).

Fixes gh-38
2014-10-23 10:39:15 -07:00
Dave Syer f99b9935fb Remove unecessary Boot 1.1.5 artifacts
See gh-39
2014-10-23 07:36:28 -07:00
Dave Syer df0d44d153 Update docs and tests for /eureka path 2014-10-23 06:56:53 -07:00
Dave Syer 5055b46e24 Change default eureka path
/v2/* -> /eureka/api/*

The prefix can't be /eureka because we use that for static
resources. Note that the "api" prefix gets passed to the
Jersey resources as a "version" (and defaults to "v2" when
it can't be parsed).

Fixes gh-41
2014-10-23 06:47:08 -07:00
Dave Syer 9e142bf73b InstanceInfo unmarshalling has to be at a lower level 2014-10-22 10:22:40 -07:00
Dave Syer 8db14f042d Extract ID from instance info 2014-10-22 08:18:14 -07:00
Dave Syer 8d8f6937e5 Use instanceId for server id if available 2014-10-21 19:13:41 -07:00
Dave Syer fa4d970015 Tweaks 2014-10-21 03:53:50 -07:00
Dave Syer cf6152821e Move @Autowired into @Configuration
I prefer to keep the actual components free of autowiring, so they
are easier to navigate in an IDE (i.e. you can see how they are
constructed)
2014-10-20 17:16:20 -07:00
Dave Syer 66b4d4c6b5 Tidy up generics a bit 2014-10-20 17:16:20 -07:00
Spencer Gibb 1e12b7456e Add Feign support for Spring MVC parameter and header annotations.
Specifically RequestParam, PathVariable and RequestHeader

 fixes gh-36
2014-10-20 18:07:56 -06:00
Spencer Gibb 31732b2100 Merge branch 'ribbon2' 2014-10-20 14:41:32 -06:00
Spencer Gibb 33b3b52170 added travis build status to readme 2014-10-20 14:41:15 -06:00
Spencer Gibb 8a5e45c466 Merge branch 'routing-nostrip' 2014-10-17 22:07:44 -06:00
Spencer Gibb 166ab38882 make stripMapping default to true to not change the current functionality 2014-10-17 18:29:21 -06:00
Spencer Gibb 658808a3e2 Update .travis.yml
gem install asciidoctor
2014-10-17 17:19:41 -07:00
Spencer Gibb e0a7d9e033 add asciidoctor installation 2014-10-17 18:12:33 -06:00
Spencer Gibb f38ccc352b updated to ribbon 2.0-RC9 2014-10-17 17:54:47 -06:00
Spencer Gibb 948b176cb0 Add loadBalancerRequest so that LoadBalancerStats().incrementNumRequests can be called after 2014-10-17 16:32:27 -06:00
Spencer Gibb 07a66fe8b9 updated test to match class 2014-10-17 15:26:40 -06:00
Spencer Gibb 50b1c48283 renamed ServerListInitializer to RibbonClientPreprocessor as it is a bit more descriptive 2014-10-17 15:23:16 -06:00
Spencer Gibb 6654d32056 create SpringClientFactory for ribbon to not fail on client creation if LoadBalancer is already created. SpringClientFactory is not a static factory, but an instance factory.
Remove unused hystrix configuration classes.
2014-10-17 14:53:16 -06:00
Dave Syer f934b88a76 Ensure eureka client has a default zone with a serviceUrl 2014-10-17 18:05:46 +01:00
Dave Syer 859c96d31b Switch to using EurekaClientConfig to determine client zone
This makes perfect sense since there is already support in the API.
Unfortunately Eureka also uses that information to set the Server
zones by default (duh?!) - see DiscoveryClient.getZone(InstanceInfo),
so unless you aggressively update them, the zones will all be the same
in all servers.

I fixed that problem by unconditionally applying the "domain as zone"
guess algorithm, which is fine unless you actually want to use
the Amazon metadata. So that's an outstanding problem

See gh-30
2014-10-17 09:54:18 +01:00
Dave Syer 997f531094 Make load balancer prefer the current zone if there is one
A EurekaInstanceConfig can declare a "zone" in its metadataMap, and then
it will be matched by the RibbonLoadBalancerClient. The zone of a server
is derived from the hostname - it is the whole host name or the host name
excluding the least significant subdomain (period separated identifier).

Fixes gh-29
2014-10-16 16:29:07 +01:00
Spencer Gibb c9dc8f5122 use boots HttpMessageConverters class rather than copied list of converters 2014-10-14 12:41:41 -06:00
Dave Syer e52949e592 Move eureka events to server project 2014-10-14 17:49:11 +01:00
Dave Syer 826d5ff383 Tidy (mostly pom warnings) 2014-10-14 17:34:28 +01:00
Dave Syer 5bded8aa85 Make Eureka into a CF service broker 2014-10-14 17:03:46 +01:00
Dave Syer 49db709de9 Simplify README generator 2014-10-14 13:05:01 +01:00
Spencer Gibb 46cf840e25 added ipAddress to ServiceInstance 2014-10-08 16:54:40 -06:00
Christian Dupuis 3f96f3ae61 Some polishing 2014-10-08 14:32:18 +02:00
Christian Dupuis 5bd32c01b8 Add shutdown hook for Hystrix to reset internal state and thread pool.
Additionally added some license headers and @author tags.

fixes #17
2014-10-08 14:24:03 +02:00
Spencer Gibb 2505b437ef only set the eureka port from the container if server.port is 0 (originally implemented from gh-15) 2014-10-07 16:54:24 -06:00
Spencer Gibb 714741b1cd added serviceId to ServiceInstance;
added beginnings of a generic DiscoveryClient interface;
2014-10-07 16:51:04 -06:00
Dave Syer 66e0c6436d Add scm element to POM 2014-10-07 11:18:04 +01:00
Dave Syer 8eae5fb52a Add docs for Eureka server as executable JAR 2014-10-07 10:50:04 +01:00
Dave Syer 3dd15621dc Move docs to submodule for multi-module projects 2014-10-06 15:02:28 +01:00
Dave Syer 862f19beba Extract repositories to .settings.xml 2014-10-06 13:02:33 +01:00
Dave Syer 5ce8cb547e Add CI creds to secure travis vars 2014-10-06 12:09:51 +01:00
Dave Syer 5c73e41675 Add snapshot repos (yawn) 2014-10-06 11:45:39 +01:00
Dave Syer 89a571258f Automate docs build with shared parent pom 2014-10-06 11:22:20 +01:00
Dave Syer 3668e2ad2b Update travis build for docs sync 2014-10-06 09:15:55 +01:00
Dave Syer 094abc6f41 Update gitignore 2014-10-03 16:03:28 +01:00
Dave Syer c52dea33f0 Add stuff from article to docs 2014-10-03 11:09:45 +01:00
Dave Syer 6bfa468ace Tweak UI a bit 2014-10-02 11:57:39 +01:00
Spencer Gibb 99d43ba3a7 fix EurekaRibbonAutoConfiguration 2014-10-02 01:18:32 -06:00
Spencer Gibb 03e6308335 remove the list of serviceIds and add ServiceListInitializer 2014-10-02 00:42:40 -06:00
Spencer Gibb 2daeed6c00 added some examples to docs 2014-10-01 22:26:56 -06:00
Spencer Gibb 23b8c96b11 Create a LoadBalancerClient abstraction and a Ribbon implementation 2014-10-01 20:08:15 -06:00
Dave Syer 31bc482a90 Fix Guardfile 2014-10-01 15:00:37 +01:00
Dave Syer 74828ab89f Fix Guardfile 2014-10-01 14:56:30 +01:00
Dave Syer e157eb6fba Add _site/ to .gitignore 2014-09-30 11:08:33 +01:00
Spencer Gibb bf43f7dad4 Eureka server is itself a eureka client when discovering eureka peers (it gets DiscoverClient from DiscoveryManager). Make sure DiscoveryManager is initialzed regardless of if the client or server config is invoked first.
fixes gh-18
2014-09-29 19:39:53 -06:00
Spencer Gibb 45143bed73 Add support for Ribbon loadbalancing in RestTemplate via an HttpRequestInterceptor that when supplied a uri such as http://myservice/my/endpoint (where myservice is a service as defined in a service registry, such as Eureka), it replaces 'myservice' with the actual host and port as returned from the configured ribbon loadbalancer.
closes gh-12
2014-09-29 17:32:58 -06:00
Dave Syer 39356928a1 Add maven processor for docs 2014-09-29 18:09:44 +01:00
Dave Syer 0d68f7429c Extract Eureka*Config beans into auto configuration
Without extracting to autoconfig the @ConditionalOnMissingBean won't
always work because it is dependent on the order of the configuration
classes being processed (and autoconfig always somes last).
2014-09-29 17:32:52 +01:00
Dave Syer 9f8b56d3d5 Make readme generator more flexible 2014-09-29 16:44:15 +01:00
Dave Syer 1cea38f312 Fix comment pre-amble in README 2014-09-29 14:46:59 +01:00
Dave Syer 344c7b2c75 Finish moving README to adoc 2014-09-29 14:30:10 +01:00
Dave Syer 563df2a975 Move README to src/main/asciidoc 2014-09-29 14:12:56 +01:00
Dave Syer edc8fffe5e Move adoc to asciidoc 2014-09-29 12:09:19 +01:00
Dave Syer 21eb52fa27 Ensure server port is registered late enough with Eureka server
Because we were using Lifecycle to kick off the eureka registration the
local server port wasn't available yet. The change is to use an
ApplicationListener and listen for the event that contains the container
with its port instead.

Fixes gh-15
2014-09-29 10:52:37 +01:00
Spencer Gibb 277ada8b88 don't strip proxy prefix by default (for spring data rest) 2014-09-25 15:21:41 -06:00
Dave Syer f41edfd483 Add conditional config guard for MBeanServer 2014-09-24 15:18:58 +01:00
Dave Syer b935027637 Ensure commons-logging is on compile classpath 2014-09-17 16:18:20 +01:00
Dave Syer 5eaa2db1a7 Update to gh-6 (cleaner implementation, but not much) 2014-09-17 10:26:09 +01:00
Dave Syer 191bad05ec Ensure Eureka server gets iniialized with non-zero count
The problem is pretty deep here so I hope I did something sane. Basically if
PeerAwareInstanceRegistry.openForTraffic(int) ever gets called with a 0 argument
it resets the threshold for numberOfRenewsPerMinThreshold to 0 from which
it only ever recovers if the same method is called again with a non-zero argument.
For a standalone server this means that it will never automatically expire
any leases (only when it chats to its neighbours and finds out they have
registered services will it ever switch the threshold back on).

Another problem (unsolved) is that the reset mechanism will kick back in
occasionally (resetting to 1 with this change, but that's probably also
a bad thing). And when there *are* actually peers to talk to unless they are
in AWS they will never communicate correctly about the actual number of local
services (the criteria for that are deeply connected with AWS and EIP).

Fixes gh-6
2014-09-16 18:12:03 +01:00
Dave Syer 91c9ab1d5f Fix ftl templates a bit (fixes gh-7) 2014-09-16 18:11:11 +01:00
Dave Syer 9c2679d4e5 Add metrics from Eureka client discovery 2014-09-08 06:00:10 -05:00
Dave Syer fcf2811e4c Add Hystrix data to /metrics 2014-09-07 10:36:42 +01:00
Dave Syer 6425862477 Make @EnableZuulProxy switch on Hystrix 2014-09-05 12:39:57 +01:00
Spencer Gibb 8005712be2 add s-c-n-turbine to dependency management 2014-09-03 14:42:00 -06:00
Spencer Gibb 7fd83dc842 add @EnableTurbine to allow boot apps to embed the turbine server 2014-09-03 12:37:56 -06:00
Dave Syer 630aeb0547 Add missing templates 2014-09-03 18:05:24 +01:00
Dave Syer f9692daf36 Add missing wro files 2014-09-03 17:18:50 +01:00
Dave Syer ba5ed3c409 Move wro resources to src/main/wro 2014-09-03 17:03:28 +01:00
Dave Syer 6550308b6e Remove unnecessary plugin 2014-09-03 16:50:08 +01:00
Dave Syer 98548ba34b Fix generated resources for IDE 2014-09-03 16:37:52 +01:00
Dave Syer 9ec59899d3 Make wro4j work in reactor build 2014-09-03 16:30:16 +01:00
Dave Syer 0afd572141 Make Eureka server embeddable 2014-09-03 10:10:21 +01:00
Dave Syer 3c280403d7 Make hystrix dashboard embeddable finally 2014-09-02 19:38:05 +01:00
Dave Syer 34cbf7a64b Make Hystrix dash embeddable 2014-09-02 12:32:08 +01:00
Dave Syer 4ca9d5f772 Break up hystrix dashboard 2014-09-02 10:11:12 +01:00
Dave Syer cf96d6ddb8 Update packages 2014-08-29 13:53:20 +01:00
Dave Syer 8106314a6a Update package names 2014-08-29 13:34:37 +01:00
Dave Syer d23149a493 Rename platform->cloud 2014-08-29 12:52:52 +01:00
Dave Syer b0a44dba06 Add support for OAuth relay in zuul proxy 2014-08-27 18:55:30 +01:00
Dave Syer 78a428ec00 Fix names and ports 2014-08-23 06:55:55 +01:00
Dave Syer 4ab3db9c20 Use String type for HTTP status 2014-08-22 15:01:33 +01:00
Dave Syer bdf5c60c86 Fix typo in trace log 2014-08-22 15:00:10 +01:00
Dave Syer 403bd8d7a2 Move debug logging to TRaceRepository 2014-08-22 14:46:28 +01:00
Dave Syer ea80ac1700 Fix issue with Host header in proxied requests 2014-08-22 07:54:55 +01:00
Dave Syer 4b4a8a5b3e Fix warnings 2014-08-19 11:17:20 +01:00
Spencer Gibb afdb5a3109 Merge branch 'publish-eureka-events' 2014-08-18 14:55:00 -06:00
Spencer Gibb f8c0282feb publish instance info 2014-08-18 14:53:11 -06:00
Dave Syer 1f63ea919c Update build and fix race in eureka 2014-08-14 21:45:28 -07:00
Spencer Gibb c8be52b025 publish eureka instance events 2014-08-12 00:56:27 -06:00
Dave Syer 11d9ddbf85 Add TODO 2014-08-09 09:38:11 -07:00
Dave Syer c09127d13a Update to Boot 1.1.5 2014-08-08 09:36:36 -07:00
Dave Syer d4f3caca02 Exclude groovy-all 2014-08-07 16:15:15 -07:00
Dave Syer f9fb23d472 Move piggy back stuff from cloudfoundry 2014-08-07 11:32:19 -07:00
Spencer Gibb f85e3d137b fixed parameter mapping in RibbonRoutingFilter 2014-08-06 13:45:54 -06:00
Spencer Gibb 8fbba2b093 @EnableZuulProxy initial implementation 2014-08-06 01:47:53 -06:00
Dave Syer a2e8245e93 Add jersey stuff to dependency management 2014-08-04 09:00:23 -07:00
Dave Syer 345cc9b6a3 Convert Eureka client autoconfig to @EnableEurekaClient 2014-07-31 16:23:22 -07:00
Spencer Gibb 10d1ed38dc rename CircuitBreaker* to Hystrix* 2014-07-29 13:55:08 -06:00
Dave Syer 88f79507e3 Fix race condition in server 2014-07-27 19:38:51 -07:00
Dave Syer 98d0da973e Clarify serviceUrls 2014-07-25 06:17:05 -07:00
Dave Syer bd7ffe99db Unset quiet flag for Maven 2014-07-20 17:15:16 +01:00
Dave Syer 1a6bc1197b Add travis build 2014-07-20 17:10:08 +01:00
Dave Syer 543adca971 Add build config for snapshot deploys 2014-07-20 17:10:08 +01:00
Spencer Gibb 7b60ea7308 updated RUNNING with new jar names;
only configure archaius once;
add eureka-client to hystrix dashboard
2014-07-17 18:12:29 -06:00
Spencer Gibb 2f8ae888ac use appGroupName as cluster rather than asgName 2014-07-15 13:10:16 -06:00
Spencer Gibb fe1cadfc52 added logging to eureka client auto config;
fixed running.md typo;
added comment to turbine eureka instance discovery
2014-07-15 11:06:01 -06:00
Dave Syer 5a2edc5a7d Exclude mouldy servlet API 2014-07-15 16:44:24 +01:00
Spencer Gibb f966b4525c use eureka to lookup hystrix streams in turbine 2014-07-14 20:13:45 -06:00
Spencer Gibb 80688bebd3 added RUNNING.md for notes on running various components 2014-07-14 18:39:18 -06:00
Spencer Gibb 9b506638f7 moved zuul to io.spring.platform.zuul;
added turbine
2014-07-14 17:33:46 -06:00
Spencer Gibb 103bc77765 moved hystrix dashboard to io.spring.platform.netflix 2014-07-14 16:15:10 -06:00
Spencer Gibb 777fad2a0f added missing dependencies 2014-07-14 15:57:03 -06:00
Dave Syer 0608f987f5 Ensure server port is 8080 by default 2014-07-14 14:47:18 +01:00
Dave Syer e42328faae Fix compiler warnings 2014-07-14 13:46:49 +01:00
Dave Syer 0f85b5ac6e Add Eureka server configuration 2014-07-14 06:37:14 +01:00
Spencer Gibb 38cc8a7688 added hystrix-dashboard 2014-07-11 17:50:33 -06:00
Spencer Gibb 998b7dc784 move netflix code from sandbox 2014-07-11 15:53:27 -06:00
Dave Syer d454e42ac9 Add enabled flag 2014-07-11 17:25:43 +01:00
Dave Syer 800acce4bd Add @Conditionals to EurekaClientAutoConfiguration 2014-07-11 17:04:15 +01:00
Dave Syer 8b199c5c73 Use Environment for defaulting app name and port 2014-07-11 16:59:32 +01:00
Dave Syer 5ee8c8c846 Initial version with client autoconfig 2014-07-11 16:46:38 +01:00
481 changed files with 16769 additions and 55957 deletions
+39
View File
@@ -0,0 +1,39 @@
version: 2
jobs:
build:
docker:
- image: springcloud/pipeline-base
environment:
_JAVA_OPTIONS: "-Xms1024m -Xmx2048m"
TERM: dumb
branches:
ignore:
- gh-pages # list of branches to ignore
resource_class: large
steps:
- checkout
- restore_cache:
key: sc-openfeign-{{ .Branch }}
- run:
name: "Download dependencies"
command: ./mvnw -s .settings.xml -U --fail-never dependency:go-offline || true
- save_cache:
key: sc-openfeign-{{ .Branch }}
paths:
- ~/.m2
- run:
name: "Running build"
command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- run:
name: "Aggregate test results"
when: always
command: |
mkdir -p $CIRCLE_TEST_REPORTS/junit/
find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
bash <(curl -s https://codecov.io/bash)
- store_artifacts:
path: /junit/
destination: artifacts
- store_test_results:
path: /junit/
destination: testartifacts
-134
View File
@@ -1,134 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath></relativePath>
</parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Spring Cloud OpenFeign</name>
<description>Spring Cloud OpenFeign</description>
<url>https://spring.io/spring-cloud/spring-cloud-openfeign</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>https://www.spring.io</url>
</organization>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<comments>Copyright 2014-2015 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
See the License for the specific language governing permissions and
limitations under the License.</comments>
</license>
</licenses>
<developers>
<developer>
<id>dsyer</id>
<name>Dave Syer</name>
<email>dsyer at pivotal.io</email>
<organization>Pivotal Software, Inc.</organization>
<organizationUrl>https://www.spring.io</organizationUrl>
<roles>
<role>lead</role>
</roles>
</developer>
<developer>
<id>sgibb</id>
<name>Spencer Gibb</name>
<email>sgibb at pivotal.io</email>
<organization>Pivotal Software, Inc.</organization>
<organizationUrl>https://www.spring.io</organizationUrl>
<roles>
<role>lead</role>
</roles>
</developer>
<developer>
<id>mgrzejszczak</id>
<name>Marcin Grzejszczak</name>
<email>mgrzejszczak at pivotal.io</email>
<organization>Pivotal Software, Inc.</organization>
<organizationUrl>https://www.spring.io</organizationUrl>
<roles>
<role>developer</role>
</roles>
</developer>
<developer>
<id>rbaxter</id>
<name>Ryan Baxter</name>
<email>rbaxter at pivotal.io</email>
<organization>Pivotal Software, Inc.</organization>
<organizationUrl>https://www.spring.io</organizationUrl>
<roles>
<role>developer</role>
</roles>
</developer>
<developer>
<id>omaciaszeksharma</id>
<name>Olga Maciaszek-Sharma</name>
<email>omaciaszeksharma at pivotal.io</email>
<organization>Pivotal Software, Inc.</organization>
<organizationUrl>https://www.spring.io</organizationUrl>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/spring-cloud/spring-cloud-openfeign.git</connection>
<developerConnection>scm:git:ssh://git@github.com/spring-cloud/spring-cloud-openfeign.git</developerConnection>
<url>https://github.com/spring-cloud/spring-cloud-openfeign</url>
</scm>
<profiles>
<profile>
<id>spring</id>
<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
</repository>
</repositories>
</profile>
</profiles>
</project>
+45
View File
@@ -0,0 +1,45 @@
# Contributing
Spring Cloud is released under the non-restrictive Apache 2.0 license,
and follows a very standard Github development process, using Github
tracker for issues and merging pull requests into master. If you want
to contribute even something trivial please do not hesitate, but
follow the guidelines below.
## Sign the Contributor License Agreement
Before we accept a non-trivial patch or pull request we will need you to sign the
[Contributor License Agreement](https://cla.pivotal.io/sign/spring).
Signing the contributor's agreement does not grant anyone commit rights to the main
repository, but it does mean that we can accept your contributions, and you will get an
author credit if we do. Active contributors might be asked to join the core team, and
given the ability to merge pull requests.
## Code of Conduct
This project adheres to the Contributor Covenant [code of
conduct](https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc). By participating, you are expected to uphold this code. Please report
unacceptable behavior to spring-code-of-conduct@pivotal.io.
## Code Conventions and Housekeeping
None of these is essential for a pull request, but they will all help. They can also be
added after the original pull request but before a merge.
* Use the Spring Framework code format conventions. If you use Eclipse
you can import formatter settings using the
`eclipse-code-formatter.xml` file from the
[Spring Cloud Build](https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml) project. If using IntelliJ, you can use the
[Eclipse Code Formatter Plugin](http://plugins.jetbrains.com/plugin/6546) to import the same file.
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
`@author` tag identifying you, and preferably at least a paragraph on what the class is
for.
* Add the ASF license header comment to all new `.java` files (copy from existing files
in the project)
* Add yourself as an `@author` to the .java files that you modify substantially (more
than cosmetic changes).
* Add some Javadocs and, if you change the namespace, some XSD doc elements.
* A few unit tests would help a lot as well -- someone has to do it.
* If no-one else is using your branch, please rebase it against the current master (or
other target branch in the main project).
* When writing a commit message please follow [these conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
message (where XXXX is the issue number).
+20
View File
@@ -0,0 +1,20 @@
<!--
Thanks for raising a Spring Cloud issue. What sort of issue are you raising?
Question
Please ask questions about how to use something, or to understand why something isn't
working as you expect it to, on Stack Overflow using the spring-cloud tag.
Bug report
Please provide details of the problem, including the version of Spring Cloud that you
are using. If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.
Enhancement
Please start by describing the problem that you are trying to solve. There may already
be a solution, or there may be a way to solve it that you hadn't considered.
-->
+6 -11
View File
@@ -7,19 +7,14 @@
.settings/
.springBeans
target/
bin/
_site/
.idea
*.iml
*.swp
*.ipr
*.iws
.factorypath
*.logtjmeter
.checkstyle
*.log
.DS_Store
/spring-cloud-sleuth-core/nb-configuration.xml
/spring-cloud-sleuth-core/nbactions.xml
*.sw[op]
.project
sample-pages
.class
antrun
.shelf
*.swp
*.swo
+1
View File
@@ -0,0 +1 @@
-Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
+1
View File
@@ -0,0 +1 @@
-DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
-1
View File
@@ -1 +0,0 @@
spring-gh-pages
-1
View File
@@ -1 +0,0 @@
ruby-2.2.0
+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>repo.spring.io</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<!--
N.B. this profile is only here to support users and IDEs that do not use Maven 3.3.
It isn't needed on the command line if you use the wrapper script (mvnw) or if you use
a native Maven with the right version. Eclipse users should points their Maven tooling to
this settings file, or copy the profile into their ~/.m2/settings.xml.
-->
<id>spring</id>
<activation><activeByDefault>true</activeByDefault></activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
-3
View File
@@ -1,3 +0,0 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
}
-35
View File
@@ -1,35 +0,0 @@
/*
code highlight CSS resemblign the Eclipse IDE default color schema
@author Costin Leau
*/
.hl-keyword {
color: #7F0055;
font-weight: bold;
}
.hl-comment {
color: #3F5F5F;
font-style: italic;
}
.hl-multiline-comment {
color: #3F5FBF;
font-style: italic;
}
.hl-tag {
color: #3F7F7F;
}
.hl-attribute {
color: #7F007F;
}
.hl-value {
color: #2A00FF;
}
.hl-string {
color: #2A00FF;
}
-9
View File
@@ -1,9 +0,0 @@
@IMPORT url("manual.css");
body.firstpage {
background: url("../images/background.png") no-repeat center top;
}
div.part h1 {
border-top: none;
}
-6
View File
@@ -1,6 +0,0 @@
@IMPORT url("manual.css");
body {
background: url("../images/background.png") no-repeat center top;
}
-344
View File
@@ -1,344 +0,0 @@
@IMPORT url("highlight.css");
html {
padding: 0pt;
margin: 0pt;
}
body {
color: #333333;
margin: 15px 30px;
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
code {
font-size: 16px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
:not(a)>code {
color: #6D180B;
}
:not(pre)>code {
background-color: #F2F2F2;
border: 1px solid #CCCCCC;
border-radius: 4px;
padding: 1px 3px 0;
text-shadow: none;
white-space: nowrap;
}
body>*:first-child {
margin-top: 0 !important;
}
div {
margin: 0pt;
}
hr {
border: 1px solid #CCCCCC;
background: #CCCCCC;
}
h1,h2,h3,h4,h5,h6 {
color: #000000;
cursor: text;
font-weight: bold;
margin: 30px 0 10px;
padding: 0;
}
h1,h2,h3 {
margin: 40px 0 10px;
}
h1 {
margin: 70px 0 30px;
padding-top: 20px;
}
div.part h1 {
border-top: 1px dotted #CCCCCC;
}
h1,h1 code {
font-size: 32px;
}
h2,h2 code {
font-size: 24px;
}
h3,h3 code {
font-size: 20px;
}
h4,h1 code,h5,h5 code,h6,h6 code {
font-size: 18px;
}
div.book,div.chapter,div.appendix,div.part,div.preface {
min-width: 300px;
max-width: 1200px;
margin: 0 auto;
}
p.releaseinfo {
font-weight: bold;
margin-bottom: 40px;
margin-top: 40px;
}
div.authorgroup {
line-height: 1;
}
p.copyright {
line-height: 1;
margin-bottom: -5px;
}
.legalnotice p {
font-style: italic;
font-size: 14px;
line-height: 1;
}
div.titlepage+p,div.titlepage+p {
margin-top: 0;
}
pre {
line-height: 1.0;
color: black;
}
a {
color: #4183C4;
text-decoration: none;
}
p {
margin: 15px 0;
text-align: left;
}
ul,ol {
padding-left: 30px;
}
li p {
margin: 0;
}
div.table {
margin: 1em;
padding: 0.5em;
text-align: center;
}
div.table table,div.informaltable table {
display: table;
width: 100%;
}
div.table td {
padding-left: 7px;
padding-right: 7px;
}
.sidebar {
line-height: 1.4;
padding: 0 20px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
}
.sidebar p.title {
color: #6D180B;
}
pre.programlisting,pre.screen {
font-size: 15px;
padding: 6px 10px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
clear: both;
overflow: auto;
line-height: 1.4;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
table {
border-collapse: collapse;
border-spacing: 0;
border: 1px solid #DDDDDD !important;
border-radius: 4px !important;
border-collapse: separate !important;
line-height: 1.6;
}
table thead {
background: #F5F5F5;
}
table tr {
border: none;
border-bottom: none;
}
table th {
font-weight: bold;
}
table th,table td {
border: none !important;
padding: 6px 13px;
}
table tr:nth-child(2n) {
background-color: #F8F8F8;
}
td p {
margin: 0 0 15px 0;
}
div.table-contents td p {
margin: 0;
}
div.important *,div.note *,div.tip *,div.warning *,div.navheader *,div.navfooter *,div.calloutlist *
{
border: none !important;
background: none !important;
margin: 0;
}
div.important p,div.note p,div.tip p,div.warning p {
color: #6F6F6F;
line-height: 1.6;
}
div.important code,div.note code,div.tip code,div.warning code {
background-color: #F2F2F2 !important;
border: 1px solid #CCCCCC !important;
border-radius: 4px !important;
padding: 1px 3px 0 !important;
text-shadow: none !important;
white-space: nowrap !important;
}
.note th,.tip th,.warning th {
display: none;
}
.note tr:first-child td,.tip tr:first-child td,.warning tr:first-child td
{
border-right: 1px solid #CCCCCC !important;
padding-top: 10px;
}
div.calloutlist p,div.calloutlist td {
padding: 0;
margin: 0;
}
div.calloutlist>table>tbody>tr>td:first-child {
padding-left: 10px;
width: 30px !important;
}
div.important,div.note,div.tip,div.warning {
margin-left: 0px !important;
margin-right: 20px !important;
margin-top: 20px;
margin-bottom: 20px;
padding-top: 10px;
padding-bottom: 10px;
}
div.toc {
line-height: 1.2;
}
dl,dt {
margin-top: 1px;
margin-bottom: 0;
}
div.toc>dl>dt {
font-size: 32px;
font-weight: bold;
margin: 30px 0 10px 0;
display: block;
}
div.toc>dl>dd>dl>dt {
font-size: 24px;
font-weight: bold;
margin: 20px 0 10px 0;
display: block;
}
div.toc>dl>dd>dl>dd>dl>dt {
font-weight: bold;
font-size: 20px;
margin: 10px 0 0 0;
}
tbody.footnotes * {
border: none !important;
}
div.footnote p {
margin: 0;
line-height: 1;
}
div.footnote p sup {
margin-right: 6px;
vertical-align: middle;
}
div.navheader {
border-bottom: 1px solid #CCCCCC;
}
div.navfooter {
border-top: 1px solid #CCCCCC;
}
.title {
margin-left: -1em;
padding-left: 1em;
}
.title>a {
position: absolute;
visibility: hidden;
display: block;
font-size: 0.85em;
margin-top: 0.05em;
margin-left: -1em;
vertical-align: text-top;
color: black;
}
.title>a:before {
content: "\00A7";
}
.title:hover>a,.title>a:hover,.title:hover>a:hover {
visibility: visible;
}
.title:focus>a,.title>a:focus,.title:focus>a:focus {
outline: 0;
}
-330
View File
@@ -1,330 +0,0 @@
#!/bin/bash -x
set -e
# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
function set_default_props() {
# The script should be executed from the root folder
ROOT_FOLDER=`pwd`
echo "Current folder is ${ROOT_FOLDER}"
if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
echo "You're not in the root folder of the project!"
exit 1
fi
# Prop that will let commit the changes
COMMIT_CHANGES="no"
MAVEN_PATH=${MAVEN_PATH:-}
echo "Path to Maven is [${MAVEN_PATH}]"
REPO_NAME=${PWD##*/}
echo "Repo name is [${REPO_NAME}]"
SPRING_CLOUD_STATIC_REPO=${SPRING_CLOUD_STATIC_REPO:-git@github.com:spring-cloud/spring-cloud-static.git}
echo "Spring Cloud Static repo is [${SPRING_CLOUD_STATIC_REPO}"
}
# Check if gh-pages exists and docs have been built
function check_if_anything_to_sync() {
git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'`
if ! (git remote set-branches --add origin gh-pages && git fetch -q); then
echo "No gh-pages, so not syncing"
exit 0
fi
if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then
echo "No gh-pages sources in docs/target/generated-docs, so not syncing"
exit 0
fi
}
function retrieve_current_branch() {
# Code getting the name of the current branch. For master we want to publish as we did until now
# https://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
# If there is a branch already passed will reuse it - otherwise will try to find it
CURRENT_BRANCH=${BRANCH}
if [[ -z "${CURRENT_BRANCH}" ]] ; then
CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
fi
echo "Current branch is [${CURRENT_BRANCH}]"
git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
}
# Switches to the provided value of the release version. We always prefix it with `v`
function switch_to_tag() {
git checkout v${VERSION}
}
# Build the docs if switch is on
function build_docs_if_applicable() {
if [[ "${BUILD}" == "yes" ]] ; then
./mvnw clean install -P docs -pl docs -DskipTests
fi
}
# Get the name of the `docs.main` property
# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile
function retrieve_doc_properties() {
MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \
-Dexec.executable="echo" \
-Dexec.args='${docs.main}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"}
WHITELISTED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
-Dexec.executable="echo" \
-Dexec.args="\${${WHITELIST_PROPERTY}}" \
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
-P docs \
-pl docs)
echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]"
}
# Stash any outstanding changes
function stash_changes() {
git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1")
if [ "$dirty" != "0" ]; then git stash; fi
}
# Switch to gh-pages branch to sync it with current branch
function add_docs_from_target() {
local DESTINATION_REPO_FOLDER
if [[ -z "${DESTINATION}" && -z "${CLONE}" ]] ; then
DESTINATION_REPO_FOLDER=${ROOT_FOLDER}
elif [[ "${CLONE}" == "yes" ]]; then
mkdir -p ${ROOT_FOLDER}/target
local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static
if [[ ! -e "${clonedStatic}/.git" ]]; then
echo "Cloning Spring Cloud Static to target"
git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && git checkout gh-pages
else
echo "Spring Cloud Static already cloned - will pull changes"
cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages
fi
DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME}
mkdir -p ${DESTINATION_REPO_FOLDER}
else
if [[ ! -e "${DESTINATION}/.git" ]]; then
echo "[${DESTINATION}] is not a git repository"
exit 1
fi
DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME}
mkdir -p ${DESTINATION_REPO_FOLDER}
echo "Destination was provided [${DESTINATION}]"
fi
cd ${DESTINATION_REPO_FOLDER}
git checkout gh-pages
git pull origin gh-pages
# Add git branches
###################################################################
if [[ -z "${VERSION}" ]] ; then
copy_docs_for_current_version
else
copy_docs_for_provided_version
fi
commit_changes_if_applicable
}
# Copies the docs by using the retrieved properties from Maven build
function copy_docs_for_current_version() {
if [[ "${CURRENT_BRANCH}" == "master" ]] ; then
echo -e "Current branch is master - will copy the current docs only to the root folder"
for f in docs/target/generated-docs/*; do
file=${f#docs/target/generated-docs/*}
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
# Not ignored...
cp -rf $f ${ROOT_FOLDER}/
git add -A ${ROOT_FOLDER}/$file
fi
done
COMMIT_CHANGES="yes"
else
echo -e "Current branch is [${CURRENT_BRANCH}]"
# https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
for f in docs/target/generated-docs/*; do
file=${f#docs/target/generated-docs/*}
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
# Not ignored...
# We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then
# We don't want to copy the spring-cloud-sleuth.html
# we want it to be converted to index.html
cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
else
cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}
git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file
fi
fi
done
COMMIT_CHANGES="yes"
else
echo -e "Branch [${CURRENT_BRANCH}] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY}] property in
[docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
fi
fi
}
# Copies the docs by using the explicitly provided version
function copy_docs_for_provided_version() {
local FOLDER=${DESTINATION_REPO_FOLDER}/${VERSION}
mkdir -p ${FOLDER}
echo -e "Current tag is [v${VERSION}] Will copy the current docs to the [${FOLDER}] folder"
for f in ${ROOT_FOLDER}/docs/target/generated-docs/*; do
file=${f#${ROOT_FOLDER}/docs/target/generated-docs/*}
copy_docs_for_branch ${file} ${FOLDER}
done
COMMIT_CHANGES="yes"
CURRENT_BRANCH="v${VERSION}"
}
# Copies the docs from target to the provided destination
# Params:
# $1 - file from target
# $2 - destination to which copy the files
function copy_docs_for_branch() {
local file=$1
local destination=$2
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^${file}$; then
# Not ignored...
# We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then
# We don't want to copy the spring-cloud-sleuth.html
# we want it to be converted to index.html
cp -rf $f ${destination}/index.html
git add -A ${destination}/index.html
else
cp -rf $f ${destination}
git add -A ${destination}/$file
fi
fi
}
function commit_changes_if_applicable() {
if [[ "${COMMIT_CHANGES}" == "yes" ]] ; then
COMMIT_SUCCESSFUL="no"
git commit -a -m "Sync docs from ${CURRENT_BRANCH} to gh-pages" && COMMIT_SUCCESSFUL="yes" || echo "Failed to commit changes"
# Uncomment the following push if you want to auto push to
# the gh-pages branch whenever you commit to master locally.
# This is a little extreme. Use with care!
###################################################################
if [[ "${COMMIT_SUCCESSFUL}" == "yes" ]] ; then
git push origin gh-pages
fi
fi
}
# Switch back to the previous branch and exit block
function checkout_previous_branch() {
# If -version was provided we need to come back to root project
cd ${ROOT_FOLDER}
git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
if [ "$dirty" != "0" ]; then git stash pop; fi
exit 0
}
# Assert if properties have been properly passed
function assert_properties() {
echo "VERSION [${VERSION}], DESTINATION [${DESTINATION}], CLONE [${CLONE}]"
if [[ "${VERSION}" != "" && (-z "${DESTINATION}" && -z "${CLONE}") ]] ; then echo "Version was set but destination / clone was not!"; exit 1;fi
if [[ ("${DESTINATION}" != "" && "${CLONE}" != "") && -z "${VERSION}" ]] ; then echo "Destination / clone was set but version was not!"; exit 1;fi
if [[ "${DESTINATION}" != "" && "${CLONE}" == "yes" ]] ; then echo "Destination and clone was set. Pick one!"; exit 1;fi
}
# Prints the usage
function print_usage() {
cat <<EOF
The idea of this script is to update gh-pages branch with the generated docs. Without any options
the script will work in the following manner:
- if there's no gh-pages / target for docs module then the script ends
- for master branch the generated docs are copied to the root of gh-pages branch
- for any other branch (if that branch is whitelisted) a subfolder with branch name is created
and docs are copied there
- if the version switch is passed (-v) then a tag with (v) prefix will be retrieved and a folder
with that version number will be created in the gh-pages branch. WARNING! No whitelist verification will take place
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
switch to gh-pages of that repo and copy the generated docs to `docs/<project-name>/<version>`
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
switch to gh-pages of that repo and copy the generated docs to `docs/<project-name>/<version>`
USAGE:
You can use the following options:
-v|--version - the script will apply the whole procedure for a particular library version
-d|--destination - the root of destination folder where the docs should be copied. You have to use the full path.
E.g. point to spring-cloud-static folder. Can't be used with (-c)
-b|--build - will run the standard build process after checking out the branch
-c|--clone - will automatically clone the spring-cloud-static repo instead of providing the destination.
Obviously can't be used with (-d)
EOF
}
# ==========================================
# ____ ____ _____ _____ _____ _______
# / ____|/ ____| __ \|_ _| __ \__ __|
# | (___ | | | |__) | | | | |__) | | |
# \___ \| | | _ / | | | ___/ | |
# ____) | |____| | \ \ _| |_| | | |
# |_____/ \_____|_| \_\_____|_| |_|
#
# ==========================================
while [[ $# > 0 ]]
do
key="$1"
case ${key} in
-v|--version)
VERSION="$2"
shift # past argument
;;
-d|--destination)
DESTINATION="$2"
shift # past argument
;;
-b|--build)
BUILD="yes"
;;
-c|--clone)
CLONE="yes"
;;
-h|--help)
print_usage
exit 0
;;
*)
echo "Invalid option: [$1]"
print_usage
exit 1
;;
esac
shift # past argument or value
done
assert_properties
set_default_props
check_if_anything_to_sync
if [[ -z "${VERSION}" ]] ; then
retrieve_current_branch
else
switch_to_tag
fi
build_docs_if_applicable
retrieve_doc_properties
stash_changes
add_docs_from_target
checkout_previous_branch
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

-117
View File
@@ -1,117 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.5">
<title>spring-cloud-openfeign</title>
<link rel="stylesheet" href="css/manual-singlepage.css">
<style>
.hidden {
display: none;
}
.switch {
border-width: 1px 1px 0 1px;
border-style: solid;
border-color: #7a2518;
display: inline-block;
}
.switch--item {
padding: 10px;
background-color: #ffffff;
color: #7a2518;
display: inline-block;
cursor: pointer;
}
.switch--item.selected {
background-color: #7a2519;
color: #ffffff;
}
</style>
<script src="http://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
<script type="text/javascript">
function addBlockSwitches() {
$('.primary').each(function() {
primary = $(this);
createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");
primary.children('.title').remove();
});
$('.secondary').each(function(idx, node) {
secondary = $(node);
primary = findPrimary(secondary);
switchItem = createSwitchItem(secondary, primary.children('.switch'));
switchItem.content.addClass('hidden');
findPrimary(secondary).append(switchItem.content);
secondary.remove();
});
}
function createBlockSwitch(primary) {
blockSwitch = $('<div class="switch"></div>');
primary.prepend(blockSwitch);
return blockSwitch;
}
function findPrimary(secondary) {
candidate = secondary.prev();
while (!candidate.is('.primary')) {
candidate = candidate.prev();
}
return candidate;
}
function createSwitchItem(block, blockSwitch) {
blockName = block.children('.title').text();
content = block.children('.content').first().append(block.next('.colist'));
item = $('<div class="switch--item">' + blockName + '</div>');
item.on('click', '', content, function(e) {
$(this).addClass('selected');
$(this).siblings().removeClass('selected');
e.data.siblings('.content').addClass('hidden');
e.data.removeClass('hidden');
});
blockSwitch.append(item);
return {'item': item, 'content': content};
}
$(addBlockSwitches);
</script>
</head>
<body class="article">
<div id="header">
<h1>spring-cloud-openfeign</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>2.0.5.BUILD-SNAPSHOT</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pick_the_documentation_option">Pick The Documentation Option</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="single/spring-cloud-openfeign.html">Single HTML</a></p>
</li>
<li>
<p><a href="multi/multi_spring-cloud-openfeign.html">Multi HTML</a></p>
</li>
</ul>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js"></script>
<script>prettyPrint()</script>
</body>
</html>
-35
View File
@@ -1,35 +0,0 @@
/*
code highlight CSS resemblign the Eclipse IDE default color schema
@author Costin Leau
*/
.hl-keyword {
color: #7F0055;
font-weight: bold;
}
.hl-comment {
color: #3F5F5F;
font-style: italic;
}
.hl-multiline-comment {
color: #3F5FBF;
font-style: italic;
}
.hl-tag {
color: #3F7F7F;
}
.hl-attribute {
color: #7F007F;
}
.hl-value {
color: #2A00FF;
}
.hl-string {
color: #2A00FF;
}
-9
View File
@@ -1,9 +0,0 @@
@IMPORT url("manual.css");
body.firstpage {
background: url("../images/background.png") no-repeat center top;
}
div.part h1 {
border-top: none;
}
-6
View File
@@ -1,6 +0,0 @@
@IMPORT url("manual.css");
body {
background: url("../images/background.png") no-repeat center top;
}
-344
View File
@@ -1,344 +0,0 @@
@IMPORT url("highlight.css");
html {
padding: 0pt;
margin: 0pt;
}
body {
color: #333333;
margin: 15px 30px;
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
code {
font-size: 16px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
:not(a)>code {
color: #6D180B;
}
:not(pre)>code {
background-color: #F2F2F2;
border: 1px solid #CCCCCC;
border-radius: 4px;
padding: 1px 3px 0;
text-shadow: none;
white-space: nowrap;
}
body>*:first-child {
margin-top: 0 !important;
}
div {
margin: 0pt;
}
hr {
border: 1px solid #CCCCCC;
background: #CCCCCC;
}
h1,h2,h3,h4,h5,h6 {
color: #000000;
cursor: text;
font-weight: bold;
margin: 30px 0 10px;
padding: 0;
}
h1,h2,h3 {
margin: 40px 0 10px;
}
h1 {
margin: 70px 0 30px;
padding-top: 20px;
}
div.part h1 {
border-top: 1px dotted #CCCCCC;
}
h1,h1 code {
font-size: 32px;
}
h2,h2 code {
font-size: 24px;
}
h3,h3 code {
font-size: 20px;
}
h4,h1 code,h5,h5 code,h6,h6 code {
font-size: 18px;
}
div.book,div.chapter,div.appendix,div.part,div.preface {
min-width: 300px;
max-width: 1200px;
margin: 0 auto;
}
p.releaseinfo {
font-weight: bold;
margin-bottom: 40px;
margin-top: 40px;
}
div.authorgroup {
line-height: 1;
}
p.copyright {
line-height: 1;
margin-bottom: -5px;
}
.legalnotice p {
font-style: italic;
font-size: 14px;
line-height: 1;
}
div.titlepage+p,div.titlepage+p {
margin-top: 0;
}
pre {
line-height: 1.0;
color: black;
}
a {
color: #4183C4;
text-decoration: none;
}
p {
margin: 15px 0;
text-align: left;
}
ul,ol {
padding-left: 30px;
}
li p {
margin: 0;
}
div.table {
margin: 1em;
padding: 0.5em;
text-align: center;
}
div.table table,div.informaltable table {
display: table;
width: 100%;
}
div.table td {
padding-left: 7px;
padding-right: 7px;
}
.sidebar {
line-height: 1.4;
padding: 0 20px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
}
.sidebar p.title {
color: #6D180B;
}
pre.programlisting,pre.screen {
font-size: 15px;
padding: 6px 10px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
clear: both;
overflow: auto;
line-height: 1.4;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
table {
border-collapse: collapse;
border-spacing: 0;
border: 1px solid #DDDDDD !important;
border-radius: 4px !important;
border-collapse: separate !important;
line-height: 1.6;
}
table thead {
background: #F5F5F5;
}
table tr {
border: none;
border-bottom: none;
}
table th {
font-weight: bold;
}
table th,table td {
border: none !important;
padding: 6px 13px;
}
table tr:nth-child(2n) {
background-color: #F8F8F8;
}
td p {
margin: 0 0 15px 0;
}
div.table-contents td p {
margin: 0;
}
div.important *,div.note *,div.tip *,div.warning *,div.navheader *,div.navfooter *,div.calloutlist *
{
border: none !important;
background: none !important;
margin: 0;
}
div.important p,div.note p,div.tip p,div.warning p {
color: #6F6F6F;
line-height: 1.6;
}
div.important code,div.note code,div.tip code,div.warning code {
background-color: #F2F2F2 !important;
border: 1px solid #CCCCCC !important;
border-radius: 4px !important;
padding: 1px 3px 0 !important;
text-shadow: none !important;
white-space: nowrap !important;
}
.note th,.tip th,.warning th {
display: none;
}
.note tr:first-child td,.tip tr:first-child td,.warning tr:first-child td
{
border-right: 1px solid #CCCCCC !important;
padding-top: 10px;
}
div.calloutlist p,div.calloutlist td {
padding: 0;
margin: 0;
}
div.calloutlist>table>tbody>tr>td:first-child {
padding-left: 10px;
width: 30px !important;
}
div.important,div.note,div.tip,div.warning {
margin-left: 0px !important;
margin-right: 20px !important;
margin-top: 20px;
margin-bottom: 20px;
padding-top: 10px;
padding-bottom: 10px;
}
div.toc {
line-height: 1.2;
}
dl,dt {
margin-top: 1px;
margin-bottom: 0;
}
div.toc>dl>dt {
font-size: 32px;
font-weight: bold;
margin: 30px 0 10px 0;
display: block;
}
div.toc>dl>dd>dl>dt {
font-size: 24px;
font-weight: bold;
margin: 20px 0 10px 0;
display: block;
}
div.toc>dl>dd>dl>dd>dl>dt {
font-weight: bold;
font-size: 20px;
margin: 10px 0 0 0;
}
tbody.footnotes * {
border: none !important;
}
div.footnote p {
margin: 0;
line-height: 1;
}
div.footnote p sup {
margin-right: 6px;
vertical-align: middle;
}
div.navheader {
border-bottom: 1px solid #CCCCCC;
}
div.navfooter {
border-top: 1px solid #CCCCCC;
}
.title {
margin-left: -1em;
padding-left: 1em;
}
.title>a {
position: absolute;
visibility: hidden;
display: block;
font-size: 0.85em;
margin-top: 0.05em;
margin-left: -1em;
vertical-align: text-top;
color: black;
}
.title>a:before {
content: "\00A7";
}
.title:hover>a,.title>a:hover,.title:hover>a:hover {
visibility: visible;
}
.title:focus>a,.title>a:focus,.title:focus>a:focus {
outline: 0;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

-4
View File
@@ -1,4 +0,0 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="up" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="prev" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="next" href="multi_spring-cloud-feign.html" title="1.&nbsp;Declarative REST Client: Feign"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-openfeign.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-feign.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.0.5.BUILD-SNAPSHOT</strong></span></p><p>This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-openfeign.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-feign.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Spring Cloud OpenFeign&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-openfeign.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;1.&nbsp;Declarative REST Client: Feign</td></tr></table></div></body></html>
-192
View File
@@ -1,192 +0,0 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>1.&nbsp;Declarative REST Client: Feign</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="up" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="prev" href="multi_pr01.html" title=""></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1.&nbsp;Declarative REST Client: Feign</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-feign" href="#spring-cloud-feign"></a>1.&nbsp;Declarative REST Client: Feign</h1></div></div></div><p><a class="link" href="https://github.com/Netflix/feign" target="_top">Feign</a> is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring MVC annotations and for using the same <code class="literal">HttpMessageConverters</code> used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="netflix-feign-starter" href="#netflix-feign-starter"></a>1.1&nbsp;How to Include Feign</h2></div></div></div><p>To include Feign in your project use the starter with group <code class="literal">org.springframework.cloud</code>
and artifact id <code class="literal">spring-cloud-starter-openfeign</code>. See the <a class="link" href="https://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a>
for details on setting up your build system with the current Spring Cloud Release Train.</p><p>Example spring boot app</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em>
<em><span class="hl-annotation" style="color: gray">@EnableFeignClients</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Application {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> main(String[] args) {
SpringApplication.run(Application.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, args);
}
}</pre><p><b>StoreClient.java.&nbsp;</b>
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient("stores")</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/stores")</span></em>
List&lt;Store&gt; getStores();
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")</span></em>
Store update(<em><span class="hl-annotation" style="color: gray">@PathVariable("storeId")</span></em> Long storeId, Store store);
}</pre><p>
</p><p>In the <code class="literal">@FeignClient</code> annotation the String value ("stores" above) is
an arbitrary client name, which is used to create a Ribbon load
balancer (see <a class="link" href="">below for details of Ribbon
support</a>). You can also specify a URL using the <code class="literal">url</code> attribute
(absolute value or just a hostname). The name of the bean in the
application context is the fully qualified name of the interface.
To specify your own alias value you can use the <code class="literal">qualifier</code> value
of the <code class="literal">@FeignClient</code> annotation.</p><p>The Ribbon client above will want to discover the physical addresses
for the "stores" service. If your application is a Eureka client then
it will resolve the service in the Eureka service registry. If you
don&#8217;t want to use Eureka, you can simply configure a list of servers
in your external configuration (see
<a class="link" href="">above for example</a>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-overriding-defaults" href="#spring-cloud-feign-overriding-defaults"></a>1.2&nbsp;Overriding Feign Defaults</h2></div></div></div><p>A central concept in Spring Cloud&#8217;s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the <code class="literal">@FeignClient</code> annotation. Spring Cloud creates a new ensemble as an
<code class="literal">ApplicationContext</code> on demand for each named client using <code class="literal">FeignClientsConfiguration</code>. This contains (amongst other things) an <code class="literal">feign.Decoder</code>, a <code class="literal">feign.Encoder</code>, and a <code class="literal">feign.Contract</code>.</p><p>Spring Cloud lets you take full control of the feign client by declaring additional configuration (on top of the <code class="literal">FeignClientsConfiguration</code>) using <code class="literal">@FeignClient</code>. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "stores", configuration = FooConfiguration.class)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span>
}</pre><p>In this case the client is composed from the components already in <code class="literal">FeignClientsConfiguration</code> together with any in <code class="literal">FooConfiguration</code> (where the latter will override the former).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">FooConfiguration</code> does not need to be annotated with <code class="literal">@Configuration</code>. However, if it is, then take care to exclude it from any <code class="literal">@ComponentScan</code> that would otherwise include this configuration as it will become the default source for <code class="literal">feign.Decoder</code>, <code class="literal">feign.Encoder</code>, <code class="literal">feign.Contract</code>, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any <code class="literal">@ComponentScan</code> or <code class="literal">@SpringBootApplication</code>, or it can be explicitly excluded in <code class="literal">@ComponentScan</code>.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The <code class="literal">serviceId</code> attribute is now deprecated in favor of the <code class="literal">name</code> attribute.</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Previously, using the <code class="literal">url</code> attribute, did not require the <code class="literal">name</code> attribute. Using <code class="literal">name</code> is now required.</p></td></tr></table></div><p>Placeholders are supported in the <code class="literal">name</code> and <code class="literal">url</code> attributes.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "${feign.name}", url = "${feign.url}")</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span>
}</pre><p>Spring Cloud Netflix provides the following beans by default for feign (<code class="literal">BeanType</code> beanName: <code class="literal">ClassName</code>):</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Decoder</code> feignDecoder: <code class="literal">ResponseEntityDecoder</code> (which wraps a <code class="literal">SpringDecoder</code>)</li><li class="listitem"><code class="literal">Encoder</code> feignEncoder: <code class="literal">SpringEncoder</code></li><li class="listitem"><code class="literal">Logger</code> feignLogger: <code class="literal">Slf4jLogger</code></li><li class="listitem"><code class="literal">Contract</code> feignContract: <code class="literal">SpringMvcContract</code></li><li class="listitem"><code class="literal">Feign.Builder</code> feignBuilder: <code class="literal">HystrixFeign.Builder</code></li><li class="listitem"><code class="literal">Client</code> feignClient: if Ribbon is enabled it is a <code class="literal">LoadBalancerFeignClient</code>, otherwise the default feign client is used.</li></ul></div><p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code class="literal">feign.okhttp.enabled</code> or <code class="literal">feign.httpclient.enabled</code> to <code class="literal">true</code>, respectively, and having them on the classpath.
You can customize the HTTP client used by providing a bean of either <code class="literal">ClosableHttpClient</code> when using Apache or <code class="literal">OkHttpClient</code> when using OK HTTP.</p><p>Spring Cloud Netflix <span class="emphasis"><em>does not</em></span> provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Logger.Level</code></li><li class="listitem"><code class="literal">Retryer</code></li><li class="listitem"><code class="literal">ErrorDecoder</code></li><li class="listitem"><code class="literal">Request.Options</code></li><li class="listitem"><code class="literal">Collection&lt;RequestInterceptor&gt;</code></li><li class="listitem"><code class="literal">SetterFactory</code></li></ul></div><p>Creating a bean of one of those type and placing it in a <code class="literal">@FeignClient</code> configuration (such as <code class="literal">FooConfiguration</code> above) allows you to override each one of the beans described. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Contract feignContract() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> feign.Contract.Default();
}
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"password"</span>);
}
}</pre><p>This replaces the <code class="literal">SpringMvcContract</code> with <code class="literal">feign.Contract.Default</code> and adds a <code class="literal">RequestInterceptor</code> to the collection of <code class="literal">RequestInterceptor</code>.</p><p><code class="literal">@FeignClient</code> also can be configured using configuration properties.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> feignName</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: full
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> errorDecoder</span>: com.example.SimpleErrorDecoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> retryer</span>: com.example.SimpleRetryer
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> requestInterceptors</span>:
- com.example.FooRequestInterceptor
- com.example.BarRequestInterceptor
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decode404</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> encoder</span>: com.example.SimpleEncoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decoder</span>: com.example.SimpleDecoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> contract</span>: com.example.SimpleContract</pre><p>Default configurations can be specified in the <code class="literal">@EnableFeignClients</code> attribute <code class="literal">defaultConfiguration</code> in a similar manner as described above. The difference is that this configuration will apply to <span class="emphasis"><em>all</em></span> feign clients.</p><p>If you prefer using configuration properties to configured all <code class="literal">@FeignClient</code>, you can create configuration properties with <code class="literal">default</code> feign name.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: basic</pre><p>If we create both <code class="literal">@Configuration</code> bean and configuration properties, configuration properties will win.
It will override <code class="literal">@Configuration</code> values. But if you want to change the priority to <code class="literal">@Configuration</code>,
you can change <code class="literal">feign.client.default-to-properties</code> to <code class="literal">false</code>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If you need to use <code class="literal">ThreadLocal</code> bound variables in your <code class="literal">RequestInterceptor`s you will need to either set the
thread isolation strategy for Hystrix to `SEMAPHORE</code> or disable Hystrix in Feign.</p></td></tr></table></div><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To disable Hystrix in Feign</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hystrix</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> enabled</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To set thread isolation to SEMAPHORE</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">hystrix</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> command</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> execution</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> isolation</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> strategy</span>: SEMAPHORE</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_creating_feign_clients_manually" href="#_creating_feign_clients_manually"></a>1.3&nbsp;Creating Feign Clients Manually</h2></div></div></div><p>In some cases it might be necessary to customize your Feign Clients in a way that is not
possible using the methods above. In this case you can create Clients using the
<a class="link" href="https://github.com/OpenFeign/feign/#basics" target="_top">Feign Builder API</a>. Below is an example
which creates two Feign Clients with the same interface but configures each one with
a separate request interceptor.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Import(FeignClientsConfiguration.class)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooController {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient fooClient;
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient adminClient;
<em><span class="hl-annotation" style="color: gray">@Autowired</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> FooController(Decoder decoder, Encoder encoder, Client client, Contract contract) {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.fooClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.contract(contract)
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>))
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>);
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.adminClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.contract(contract)
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>))
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>);
}
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In the above example <code class="literal">FeignClientsConfiguration.class</code> is the default configuration
provided by Spring Cloud Netflix.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">PROD-SVC</code> is the name of the service the Clients will be making requests to.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The Feign <code class="literal">Contract</code> object defines what annotations and values are valid on interfaces. The
autowired <code class="literal">Contract</code> bean provides supports for SpringMVC annotations, instead of
the default Feign native annotations.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix" href="#spring-cloud-feign-hystrix"></a>1.4&nbsp;Feign Hystrix Support</h2></div></div></div><p>If Hystrix is on the classpath and <code class="literal">feign.hystrix.enabled=true</code>, Feign will wrap all methods with a circuit breaker. Returning a <code class="literal">com.netflix.hystrix.HystrixCommand</code> is also available. This lets you use reactive patterns (with a call to <code class="literal">.toObservable()</code> or <code class="literal">.observe()</code> or asynchronous use (with a call to <code class="literal">.queue()</code>).</p><p>To disable Hystrix support on a per-client basis create a vanilla <code class="literal">Feign.Builder</code> with the "prototype" scope, e.g.:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
<em><span class="hl-annotation" style="color: gray">@Scope("prototype")</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Feign.Builder feignBuilder() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Feign.builder();
}
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in
favor for an opt-in approach.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix-fallback" href="#spring-cloud-feign-hystrix-fallback"></a>1.5&nbsp;Feign Hystrix Fallbacks</h2></div></div></div><p>Hystrix supports the notion of a fallback: a default code path that is executed when they circuit is open or there is an error. To enable fallbacks for a given <code class="literal">@FeignClient</code> set the <code class="literal">fallback</code> attribute to the class name that implements the fallback. You also need to declare your implementation as a Spring bean.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallback = HystrixClientFallback.class)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient {
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em>
Hello iFailSometimes();
}
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallback <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> HystrixClient {
<em><span class="hl-annotation" style="color: gray">@Override</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback"</span>);
}
}</pre><p>If one needs access to the cause that made the fallback trigger, one can use the <code class="literal">fallbackFactory</code> attribute inside <code class="literal">@FeignClient</code>.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallbackFactory = HystrixClientFallbackFactory.class)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient {
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em>
Hello iFailSometimes();
}
<em><span class="hl-annotation" style="color: gray">@Component</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallbackFactory <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> FallbackFactory&lt;HystrixClient&gt; {
<em><span class="hl-annotation" style="color: gray">@Override</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> HystrixClient create(Throwable cause) {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> HystrixClient() {
<em><span class="hl-annotation" style="color: gray">@Override</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback; reason was: "</span> + cause.getMessage());
}
};
}
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>There is a limitation with the implementation of fallbacks in Feign and how Hystrix fallbacks work. Fallbacks are currently not supported for methods that return <code class="literal">com.netflix.hystrix.HystrixCommand</code> and <code class="literal">rx.Observable</code>.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_and_literal_primary_literal" href="#_feign_and_literal_primary_literal"></a>1.6&nbsp;Feign and <code class="literal">@Primary</code></h2></div></div></div><p>When using Feign with Hystrix fallbacks, there are multiple beans in the <code class="literal">ApplicationContext</code> of the same type. This will cause <code class="literal">@Autowired</code> to not work because there isn&#8217;t exactly one bean, or one marked as primary. To work around this, Spring Cloud Netflix marks all Feign instances as <code class="literal">@Primary</code>, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the <code class="literal">primary</code> attribute of <code class="literal">@FeignClient</code> to false.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", primary = false)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HelloClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// methods here</span>
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-inheritance" href="#spring-cloud-feign-inheritance"></a>1.7&nbsp;Feign Inheritance Support</h2></div></div></div><p>Feign supports boilerplate apis via single-inheritance interfaces.
This allows grouping common operations into convenient base interfaces.</p><p><b>UserService.java.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserService {
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")</span></em>
User getUser(<em><span class="hl-annotation" style="color: gray">@PathVariable("id")</span></em> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">long</span> id);
}</pre><p>
</p><p><b>UserResource.java.&nbsp;</b>
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@RestController</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> UserResource <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> UserService {
}</pre><p>
</p><p><b>UserClient.java.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">package</span> project.user;
<em><span class="hl-annotation" style="color: gray">@FeignClient("users")</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserClient <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">extends</span> UserService {
}</pre><p>
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is generally not advisable to share an interface between a
server and a client. It introduces tight coupling, and also actually
doesn&#8217;t work with Spring MVC in its current form (method parameter
mapping is not inherited).</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_request_response_compression" href="#_feign_request_response_compression"></a>1.8&nbsp;Feign request/response compression</h2></div></div></div><p>You may consider enabling the request or response GZIP compression for your
Feign requests. You can do this by enabling one of the properties:</p><pre class="programlisting">feign.compression.request.enabled=true
feign.compression.response.enabled=true</pre><p>Feign request compression gives you settings similar to what you may set for your web server:</p><pre class="programlisting">feign.compression.request.enabled=true
feign.compression.request.mime-types=text/xml,application/xml,application/json
feign.compression.request.min-request-size=<span class="hl-number">2048</span></pre><p>These properties allow you to be selective about the compressed media types and minimum request threshold length.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_logging" href="#_feign_logging"></a>1.9&nbsp;Feign logging</h2></div></div></div><p>A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client. Feign logging only responds to the <code class="literal">DEBUG</code> level.</p><p><b>application.yml.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">logging.level.project.user.UserClient</span>: DEBUG</pre><p>
</p><p>The <code class="literal">Logger.Level</code> object that you may configure per client, tells Feign how much to log. Choices are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">NONE</code>, No logging (<span class="strong"><strong>DEFAULT</strong></span>).</li><li class="listitem"><code class="literal">BASIC</code>, Log only the request method and URL and the response status code and execution time.</li><li class="listitem"><code class="literal">HEADERS</code>, Log the basic information along with request and response headers.</li><li class="listitem"><code class="literal">FULL</code>, Log the headers, body, and metadata for both requests and responses.</li></ul></div><p>For example, the following would set the <code class="literal">Logger.Level</code> to <code class="literal">FULL</code>:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
Logger.Level feignLoggerLevel() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Logger.Level.FULL;
}
}</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-openfeign.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>
@@ -1,3 +0,0 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Spring Cloud OpenFeign</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Cloud OpenFeign</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud OpenFeign</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-feign.html">1. Declarative REST Client: Feign</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-feign.html#netflix-feign-starter">1.1. How to Include Feign</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-overriding-defaults">1.2. Overriding Feign Defaults</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_creating_feign_clients_manually">1.3. Creating Feign Clients Manually</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-hystrix">1.4. Feign Hystrix Support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-hystrix-fallback">1.5. Feign Hystrix Fallbacks</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_and_literal_primary_literal">1.6. Feign and <code class="literal">@Primary</code></a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-inheritance">1.7. Feign Inheritance Support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_request_response_compression">1.8. Feign request/response compression</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_logging">1.9. Feign logging</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>
-35
View File
@@ -1,35 +0,0 @@
/*
code highlight CSS resemblign the Eclipse IDE default color schema
@author Costin Leau
*/
.hl-keyword {
color: #7F0055;
font-weight: bold;
}
.hl-comment {
color: #3F5F5F;
font-style: italic;
}
.hl-multiline-comment {
color: #3F5FBF;
font-style: italic;
}
.hl-tag {
color: #3F7F7F;
}
.hl-attribute {
color: #7F007F;
}
.hl-value {
color: #2A00FF;
}
.hl-string {
color: #2A00FF;
}
-9
View File
@@ -1,9 +0,0 @@
@IMPORT url("manual.css");
body.firstpage {
background: url("../images/background.png") no-repeat center top;
}
div.part h1 {
border-top: none;
}
-6
View File
@@ -1,6 +0,0 @@
@IMPORT url("manual.css");
body {
background: url("../images/background.png") no-repeat center top;
}
-344
View File
@@ -1,344 +0,0 @@
@IMPORT url("highlight.css");
html {
padding: 0pt;
margin: 0pt;
}
body {
color: #333333;
margin: 15px 30px;
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
code {
font-size: 16px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
:not(a)>code {
color: #6D180B;
}
:not(pre)>code {
background-color: #F2F2F2;
border: 1px solid #CCCCCC;
border-radius: 4px;
padding: 1px 3px 0;
text-shadow: none;
white-space: nowrap;
}
body>*:first-child {
margin-top: 0 !important;
}
div {
margin: 0pt;
}
hr {
border: 1px solid #CCCCCC;
background: #CCCCCC;
}
h1,h2,h3,h4,h5,h6 {
color: #000000;
cursor: text;
font-weight: bold;
margin: 30px 0 10px;
padding: 0;
}
h1,h2,h3 {
margin: 40px 0 10px;
}
h1 {
margin: 70px 0 30px;
padding-top: 20px;
}
div.part h1 {
border-top: 1px dotted #CCCCCC;
}
h1,h1 code {
font-size: 32px;
}
h2,h2 code {
font-size: 24px;
}
h3,h3 code {
font-size: 20px;
}
h4,h1 code,h5,h5 code,h6,h6 code {
font-size: 18px;
}
div.book,div.chapter,div.appendix,div.part,div.preface {
min-width: 300px;
max-width: 1200px;
margin: 0 auto;
}
p.releaseinfo {
font-weight: bold;
margin-bottom: 40px;
margin-top: 40px;
}
div.authorgroup {
line-height: 1;
}
p.copyright {
line-height: 1;
margin-bottom: -5px;
}
.legalnotice p {
font-style: italic;
font-size: 14px;
line-height: 1;
}
div.titlepage+p,div.titlepage+p {
margin-top: 0;
}
pre {
line-height: 1.0;
color: black;
}
a {
color: #4183C4;
text-decoration: none;
}
p {
margin: 15px 0;
text-align: left;
}
ul,ol {
padding-left: 30px;
}
li p {
margin: 0;
}
div.table {
margin: 1em;
padding: 0.5em;
text-align: center;
}
div.table table,div.informaltable table {
display: table;
width: 100%;
}
div.table td {
padding-left: 7px;
padding-right: 7px;
}
.sidebar {
line-height: 1.4;
padding: 0 20px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
}
.sidebar p.title {
color: #6D180B;
}
pre.programlisting,pre.screen {
font-size: 15px;
padding: 6px 10px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
clear: both;
overflow: auto;
line-height: 1.4;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
table {
border-collapse: collapse;
border-spacing: 0;
border: 1px solid #DDDDDD !important;
border-radius: 4px !important;
border-collapse: separate !important;
line-height: 1.6;
}
table thead {
background: #F5F5F5;
}
table tr {
border: none;
border-bottom: none;
}
table th {
font-weight: bold;
}
table th,table td {
border: none !important;
padding: 6px 13px;
}
table tr:nth-child(2n) {
background-color: #F8F8F8;
}
td p {
margin: 0 0 15px 0;
}
div.table-contents td p {
margin: 0;
}
div.important *,div.note *,div.tip *,div.warning *,div.navheader *,div.navfooter *,div.calloutlist *
{
border: none !important;
background: none !important;
margin: 0;
}
div.important p,div.note p,div.tip p,div.warning p {
color: #6F6F6F;
line-height: 1.6;
}
div.important code,div.note code,div.tip code,div.warning code {
background-color: #F2F2F2 !important;
border: 1px solid #CCCCCC !important;
border-radius: 4px !important;
padding: 1px 3px 0 !important;
text-shadow: none !important;
white-space: nowrap !important;
}
.note th,.tip th,.warning th {
display: none;
}
.note tr:first-child td,.tip tr:first-child td,.warning tr:first-child td
{
border-right: 1px solid #CCCCCC !important;
padding-top: 10px;
}
div.calloutlist p,div.calloutlist td {
padding: 0;
margin: 0;
}
div.calloutlist>table>tbody>tr>td:first-child {
padding-left: 10px;
width: 30px !important;
}
div.important,div.note,div.tip,div.warning {
margin-left: 0px !important;
margin-right: 20px !important;
margin-top: 20px;
margin-bottom: 20px;
padding-top: 10px;
padding-bottom: 10px;
}
div.toc {
line-height: 1.2;
}
dl,dt {
margin-top: 1px;
margin-bottom: 0;
}
div.toc>dl>dt {
font-size: 32px;
font-weight: bold;
margin: 30px 0 10px 0;
display: block;
}
div.toc>dl>dd>dl>dt {
font-size: 24px;
font-weight: bold;
margin: 20px 0 10px 0;
display: block;
}
div.toc>dl>dd>dl>dd>dl>dt {
font-weight: bold;
font-size: 20px;
margin: 10px 0 0 0;
}
tbody.footnotes * {
border: none !important;
}
div.footnote p {
margin: 0;
line-height: 1;
}
div.footnote p sup {
margin-right: 6px;
vertical-align: middle;
}
div.navheader {
border-bottom: 1px solid #CCCCCC;
}
div.navfooter {
border-top: 1px solid #CCCCCC;
}
.title {
margin-left: -1em;
padding-left: 1em;
}
.title>a {
position: absolute;
visibility: hidden;
display: block;
font-size: 0.85em;
margin-top: 0.05em;
margin-left: -1em;
vertical-align: text-top;
color: black;
}
.title>a:before {
content: "\00A7";
}
.title:hover>a,.title>a:hover,.title:hover>a:hover {
visibility: visible;
}
.title:focus>a,.title>a:focus,.title:focus>a:focus {
outline: 0;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

-193
View File
@@ -1,193 +0,0 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Spring Cloud OpenFeign</title><link rel="stylesheet" type="text/css" href="css/manual-singlepage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud OpenFeign</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#d0e9"></a></span></dt><dt><span class="chapter"><a href="#spring-cloud-feign">1. Declarative REST Client: Feign</a></span></dt><dd><dl><dt><span class="section"><a href="#netflix-feign-starter">1.1. How to Include Feign</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-overriding-defaults">1.2. Overriding Feign Defaults</a></span></dt><dt><span class="section"><a href="#_creating_feign_clients_manually">1.3. Creating Feign Clients Manually</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-hystrix">1.4. Feign Hystrix Support</a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-hystrix-fallback">1.5. Feign Hystrix Fallbacks</a></span></dt><dt><span class="section"><a href="#_feign_and_literal_primary_literal">1.6. Feign and <code class="literal">@Primary</code></a></span></dt><dt><span class="section"><a href="#spring-cloud-feign-inheritance">1.7. Feign Inheritance Support</a></span></dt><dt><span class="section"><a href="#_feign_request_response_compression">1.8. Feign request/response compression</a></span></dt><dt><span class="section"><a href="#_feign_logging">1.9. Feign logging</a></span></dt></dl></dd></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.0.5.BUILD-SNAPSHOT</strong></span></p><p>This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms.</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-feign" href="#spring-cloud-feign"></a>1.&nbsp;Declarative REST Client: Feign</h1></div></div></div><p><a class="link" href="https://github.com/Netflix/feign" target="_top">Feign</a> is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring MVC annotations and for using the same <code class="literal">HttpMessageConverters</code> used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="netflix-feign-starter" href="#netflix-feign-starter"></a>1.1&nbsp;How to Include Feign</h2></div></div></div><p>To include Feign in your project use the starter with group <code class="literal">org.springframework.cloud</code>
and artifact id <code class="literal">spring-cloud-starter-openfeign</code>. See the <a class="link" href="https://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a>
for details on setting up your build system with the current Spring Cloud Release Train.</p><p>Example spring boot app</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@SpringBootApplication</span></em>
<em><span class="hl-annotation" style="color: gray">@EnableFeignClients</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Application {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> main(String[] args) {
SpringApplication.run(Application.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, args);
}
}</pre><p><b>StoreClient.java.&nbsp;</b>
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient("stores")</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/stores")</span></em>
List&lt;Store&gt; getStores();
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")</span></em>
Store update(<em><span class="hl-annotation" style="color: gray">@PathVariable("storeId")</span></em> Long storeId, Store store);
}</pre><p>
</p><p>In the <code class="literal">@FeignClient</code> annotation the String value ("stores" above) is
an arbitrary client name, which is used to create a Ribbon load
balancer (see <a class="link" href="#">below for details of Ribbon
support</a>). You can also specify a URL using the <code class="literal">url</code> attribute
(absolute value or just a hostname). The name of the bean in the
application context is the fully qualified name of the interface.
To specify your own alias value you can use the <code class="literal">qualifier</code> value
of the <code class="literal">@FeignClient</code> annotation.</p><p>The Ribbon client above will want to discover the physical addresses
for the "stores" service. If your application is a Eureka client then
it will resolve the service in the Eureka service registry. If you
don&#8217;t want to use Eureka, you can simply configure a list of servers
in your external configuration (see
<a class="link" href="#">above for example</a>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-overriding-defaults" href="#spring-cloud-feign-overriding-defaults"></a>1.2&nbsp;Overriding Feign Defaults</h2></div></div></div><p>A central concept in Spring Cloud&#8217;s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the <code class="literal">@FeignClient</code> annotation. Spring Cloud creates a new ensemble as an
<code class="literal">ApplicationContext</code> on demand for each named client using <code class="literal">FeignClientsConfiguration</code>. This contains (amongst other things) an <code class="literal">feign.Decoder</code>, a <code class="literal">feign.Encoder</code>, and a <code class="literal">feign.Contract</code>.</p><p>Spring Cloud lets you take full control of the feign client by declaring additional configuration (on top of the <code class="literal">FeignClientsConfiguration</code>) using <code class="literal">@FeignClient</code>. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "stores", configuration = FooConfiguration.class)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span>
}</pre><p>In this case the client is composed from the components already in <code class="literal">FeignClientsConfiguration</code> together with any in <code class="literal">FooConfiguration</code> (where the latter will override the former).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">FooConfiguration</code> does not need to be annotated with <code class="literal">@Configuration</code>. However, if it is, then take care to exclude it from any <code class="literal">@ComponentScan</code> that would otherwise include this configuration as it will become the default source for <code class="literal">feign.Decoder</code>, <code class="literal">feign.Encoder</code>, <code class="literal">feign.Contract</code>, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any <code class="literal">@ComponentScan</code> or <code class="literal">@SpringBootApplication</code>, or it can be explicitly excluded in <code class="literal">@ComponentScan</code>.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The <code class="literal">serviceId</code> attribute is now deprecated in favor of the <code class="literal">name</code> attribute.</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Previously, using the <code class="literal">url</code> attribute, did not require the <code class="literal">name</code> attribute. Using <code class="literal">name</code> is now required.</p></td></tr></table></div><p>Placeholders are supported in the <code class="literal">name</code> and <code class="literal">url</code> attributes.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "${feign.name}", url = "${feign.url}")</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span>
}</pre><p>Spring Cloud Netflix provides the following beans by default for feign (<code class="literal">BeanType</code> beanName: <code class="literal">ClassName</code>):</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Decoder</code> feignDecoder: <code class="literal">ResponseEntityDecoder</code> (which wraps a <code class="literal">SpringDecoder</code>)</li><li class="listitem"><code class="literal">Encoder</code> feignEncoder: <code class="literal">SpringEncoder</code></li><li class="listitem"><code class="literal">Logger</code> feignLogger: <code class="literal">Slf4jLogger</code></li><li class="listitem"><code class="literal">Contract</code> feignContract: <code class="literal">SpringMvcContract</code></li><li class="listitem"><code class="literal">Feign.Builder</code> feignBuilder: <code class="literal">HystrixFeign.Builder</code></li><li class="listitem"><code class="literal">Client</code> feignClient: if Ribbon is enabled it is a <code class="literal">LoadBalancerFeignClient</code>, otherwise the default feign client is used.</li></ul></div><p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code class="literal">feign.okhttp.enabled</code> or <code class="literal">feign.httpclient.enabled</code> to <code class="literal">true</code>, respectively, and having them on the classpath.
You can customize the HTTP client used by providing a bean of either <code class="literal">ClosableHttpClient</code> when using Apache or <code class="literal">OkHttpClient</code> when using OK HTTP.</p><p>Spring Cloud Netflix <span class="emphasis"><em>does not</em></span> provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Logger.Level</code></li><li class="listitem"><code class="literal">Retryer</code></li><li class="listitem"><code class="literal">ErrorDecoder</code></li><li class="listitem"><code class="literal">Request.Options</code></li><li class="listitem"><code class="literal">Collection&lt;RequestInterceptor&gt;</code></li><li class="listitem"><code class="literal">SetterFactory</code></li></ul></div><p>Creating a bean of one of those type and placing it in a <code class="literal">@FeignClient</code> configuration (such as <code class="literal">FooConfiguration</code> above) allows you to override each one of the beans described. Example:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Contract feignContract() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> feign.Contract.Default();
}
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"password"</span>);
}
}</pre><p>This replaces the <code class="literal">SpringMvcContract</code> with <code class="literal">feign.Contract.Default</code> and adds a <code class="literal">RequestInterceptor</code> to the collection of <code class="literal">RequestInterceptor</code>.</p><p><code class="literal">@FeignClient</code> also can be configured using configuration properties.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> feignName</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: full
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> errorDecoder</span>: com.example.SimpleErrorDecoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> retryer</span>: com.example.SimpleRetryer
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> requestInterceptors</span>:
- com.example.FooRequestInterceptor
- com.example.BarRequestInterceptor
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decode404</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> encoder</span>: com.example.SimpleEncoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decoder</span>: com.example.SimpleDecoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> contract</span>: com.example.SimpleContract</pre><p>Default configurations can be specified in the <code class="literal">@EnableFeignClients</code> attribute <code class="literal">defaultConfiguration</code> in a similar manner as described above. The difference is that this configuration will apply to <span class="emphasis"><em>all</em></span> feign clients.</p><p>If you prefer using configuration properties to configured all <code class="literal">@FeignClient</code>, you can create configuration properties with <code class="literal">default</code> feign name.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <span class="hl-number">5000</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <span class="hl-number">5000</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: basic</pre><p>If we create both <code class="literal">@Configuration</code> bean and configuration properties, configuration properties will win.
It will override <code class="literal">@Configuration</code> values. But if you want to change the priority to <code class="literal">@Configuration</code>,
you can change <code class="literal">feign.client.default-to-properties</code> to <code class="literal">false</code>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If you need to use <code class="literal">ThreadLocal</code> bound variables in your <code class="literal">RequestInterceptor`s you will need to either set the
thread isolation strategy for Hystrix to `SEMAPHORE</code> or disable Hystrix in Feign.</p></td></tr></table></div><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To disable Hystrix in Feign</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hystrix</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> enabled</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To set thread isolation to SEMAPHORE</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">hystrix</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> command</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> execution</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> isolation</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> strategy</span>: SEMAPHORE</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_creating_feign_clients_manually" href="#_creating_feign_clients_manually"></a>1.3&nbsp;Creating Feign Clients Manually</h2></div></div></div><p>In some cases it might be necessary to customize your Feign Clients in a way that is not
possible using the methods above. In this case you can create Clients using the
<a class="link" href="https://github.com/OpenFeign/feign/#basics" target="_top">Feign Builder API</a>. Below is an example
which creates two Feign Clients with the same interface but configures each one with
a separate request interceptor.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Import(FeignClientsConfiguration.class)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooController {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient fooClient;
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient adminClient;
<em><span class="hl-annotation" style="color: gray">@Autowired</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> FooController(Decoder decoder, Encoder encoder, Client client, Contract contract) {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.fooClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.contract(contract)
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>))
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>);
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.adminClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.contract(contract)
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>))
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>);
}
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In the above example <code class="literal">FeignClientsConfiguration.class</code> is the default configuration
provided by Spring Cloud Netflix.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">PROD-SVC</code> is the name of the service the Clients will be making requests to.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The Feign <code class="literal">Contract</code> object defines what annotations and values are valid on interfaces. The
autowired <code class="literal">Contract</code> bean provides supports for SpringMVC annotations, instead of
the default Feign native annotations.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix" href="#spring-cloud-feign-hystrix"></a>1.4&nbsp;Feign Hystrix Support</h2></div></div></div><p>If Hystrix is on the classpath and <code class="literal">feign.hystrix.enabled=true</code>, Feign will wrap all methods with a circuit breaker. Returning a <code class="literal">com.netflix.hystrix.HystrixCommand</code> is also available. This lets you use reactive patterns (with a call to <code class="literal">.toObservable()</code> or <code class="literal">.observe()</code> or asynchronous use (with a call to <code class="literal">.queue()</code>).</p><p>To disable Hystrix support on a per-client basis create a vanilla <code class="literal">Feign.Builder</code> with the "prototype" scope, e.g.:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
<em><span class="hl-annotation" style="color: gray">@Scope("prototype")</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Feign.Builder feignBuilder() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Feign.builder();
}
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in
favor for an opt-in approach.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix-fallback" href="#spring-cloud-feign-hystrix-fallback"></a>1.5&nbsp;Feign Hystrix Fallbacks</h2></div></div></div><p>Hystrix supports the notion of a fallback: a default code path that is executed when they circuit is open or there is an error. To enable fallbacks for a given <code class="literal">@FeignClient</code> set the <code class="literal">fallback</code> attribute to the class name that implements the fallback. You also need to declare your implementation as a Spring bean.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallback = HystrixClientFallback.class)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient {
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em>
Hello iFailSometimes();
}
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallback <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> HystrixClient {
<em><span class="hl-annotation" style="color: gray">@Override</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback"</span>);
}
}</pre><p>If one needs access to the cause that made the fallback trigger, one can use the <code class="literal">fallbackFactory</code> attribute inside <code class="literal">@FeignClient</code>.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", fallbackFactory = HystrixClientFallbackFactory.class)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient {
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value = "/hello")</span></em>
Hello iFailSometimes();
}
<em><span class="hl-annotation" style="color: gray">@Component</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallbackFactory <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> FallbackFactory&lt;HystrixClient&gt; {
<em><span class="hl-annotation" style="color: gray">@Override</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> HystrixClient create(Throwable cause) {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> HystrixClient() {
<em><span class="hl-annotation" style="color: gray">@Override</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback; reason was: "</span> + cause.getMessage());
}
};
}
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>There is a limitation with the implementation of fallbacks in Feign and how Hystrix fallbacks work. Fallbacks are currently not supported for methods that return <code class="literal">com.netflix.hystrix.HystrixCommand</code> and <code class="literal">rx.Observable</code>.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_and_literal_primary_literal" href="#_feign_and_literal_primary_literal"></a>1.6&nbsp;Feign and <code class="literal">@Primary</code></h2></div></div></div><p>When using Feign with Hystrix fallbacks, there are multiple beans in the <code class="literal">ApplicationContext</code> of the same type. This will cause <code class="literal">@Autowired</code> to not work because there isn&#8217;t exactly one bean, or one marked as primary. To work around this, Spring Cloud Netflix marks all Feign instances as <code class="literal">@Primary</code>, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the <code class="literal">primary</code> attribute of <code class="literal">@FeignClient</code> to false.</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@FeignClient(name = "hello", primary = false)</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HelloClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// methods here</span>
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-inheritance" href="#spring-cloud-feign-inheritance"></a>1.7&nbsp;Feign Inheritance Support</h2></div></div></div><p>Feign supports boilerplate apis via single-inheritance interfaces.
This allows grouping common operations into convenient base interfaces.</p><p><b>UserService.java.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserService {
<em><span class="hl-annotation" style="color: gray">@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")</span></em>
User getUser(<em><span class="hl-annotation" style="color: gray">@PathVariable("id")</span></em> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">long</span> id);
}</pre><p>
</p><p><b>UserResource.java.&nbsp;</b>
</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@RestController</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> UserResource <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> UserService {
}</pre><p>
</p><p><b>UserClient.java.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">package</span> project.user;
<em><span class="hl-annotation" style="color: gray">@FeignClient("users")</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserClient <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">extends</span> UserService {
}</pre><p>
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is generally not advisable to share an interface between a
server and a client. It introduces tight coupling, and also actually
doesn&#8217;t work with Spring MVC in its current form (method parameter
mapping is not inherited).</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_request_response_compression" href="#_feign_request_response_compression"></a>1.8&nbsp;Feign request/response compression</h2></div></div></div><p>You may consider enabling the request or response GZIP compression for your
Feign requests. You can do this by enabling one of the properties:</p><pre class="programlisting">feign.compression.request.enabled=true
feign.compression.response.enabled=true</pre><p>Feign request compression gives you settings similar to what you may set for your web server:</p><pre class="programlisting">feign.compression.request.enabled=true
feign.compression.request.mime-types=text/xml,application/xml,application/json
feign.compression.request.min-request-size=<span class="hl-number">2048</span></pre><p>These properties allow you to be selective about the compressed media types and minimum request threshold length.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_logging" href="#_feign_logging"></a>1.9&nbsp;Feign logging</h2></div></div></div><p>A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client. Feign logging only responds to the <code class="literal">DEBUG</code> level.</p><p><b>application.yml.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">logging.level.project.user.UserClient</span>: DEBUG</pre><p>
</p><p>The <code class="literal">Logger.Level</code> object that you may configure per client, tells Feign how much to log. Choices are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">NONE</code>, No logging (<span class="strong"><strong>DEFAULT</strong></span>).</li><li class="listitem"><code class="literal">BASIC</code>, Log only the request method and URL and the response status code and execution time.</li><li class="listitem"><code class="literal">HEADERS</code>, Log the basic information along with request and response headers.</li><li class="listitem"><code class="literal">FULL</code>, Log the headers, body, and metadata for both requests and responses.</li></ul></div><p>For example, the following would set the <code class="literal">Logger.Level</code> to <code class="literal">FULL</code>:</p><pre class="programlisting"><em><span class="hl-annotation" style="color: gray">@Configuration</span></em>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<em><span class="hl-annotation" style="color: gray">@Bean</span></em>
Logger.Level feignLoggerLevel() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Logger.Level.FULL;
}
}</pre></div></div></div></body></html>
-117
View File
@@ -1,117 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.5">
<title>spring-cloud-openfeign</title>
<link rel="stylesheet" href="css/manual-singlepage.css">
<style>
.hidden {
display: none;
}
.switch {
border-width: 1px 1px 0 1px;
border-style: solid;
border-color: #7a2518;
display: inline-block;
}
.switch--item {
padding: 10px;
background-color: #ffffff;
color: #7a2518;
display: inline-block;
cursor: pointer;
}
.switch--item.selected {
background-color: #7a2519;
color: #ffffff;
}
</style>
<script src="http://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
<script type="text/javascript">
function addBlockSwitches() {
$('.primary').each(function() {
primary = $(this);
createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");
primary.children('.title').remove();
});
$('.secondary').each(function(idx, node) {
secondary = $(node);
primary = findPrimary(secondary);
switchItem = createSwitchItem(secondary, primary.children('.switch'));
switchItem.content.addClass('hidden');
findPrimary(secondary).append(switchItem.content);
secondary.remove();
});
}
function createBlockSwitch(primary) {
blockSwitch = $('<div class="switch"></div>');
primary.prepend(blockSwitch);
return blockSwitch;
}
function findPrimary(secondary) {
candidate = secondary.prev();
while (!candidate.is('.primary')) {
candidate = candidate.prev();
}
return candidate;
}
function createSwitchItem(block, blockSwitch) {
blockName = block.children('.title').text();
content = block.children('.content').first().append(block.next('.colist'));
item = $('<div class="switch--item">' + blockName + '</div>');
item.on('click', '', content, function(e) {
$(this).addClass('selected');
$(this).siblings().removeClass('selected');
e.data.siblings('.content').addClass('hidden');
e.data.removeClass('hidden');
});
blockSwitch.append(item);
return {'item': item, 'content': content};
}
$(addBlockSwitches);
</script>
</head>
<body class="article">
<div id="header">
<h1>spring-cloud-openfeign</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>2.0.5.BUILD-SNAPSHOT</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pick_the_documentation_option">Pick The Documentation Option</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="single/spring-cloud-openfeign.html">Single HTML</a></p>
</li>
<li>
<p><a href="multi/multi_spring-cloud-openfeign.html">Multi HTML</a></p>
</li>
</ul>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js"></script>
<script>prettyPrint()</script>
</body>
</html>
-387
View File
@@ -1,387 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>Spring Cloud OpenFeign</title>
<date>2019-09-16</date>
</info>
<preface>
<title></title>
<simpara><emphasis role="strong">2.0.5.BUILD-SNAPSHOT</emphasis></simpara>
<simpara>This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms.</simpara>
</preface>
<chapter xml:id="spring-cloud-feign">
<title>Declarative REST Client: Feign</title>
<simpara><link xl:href="https://github.com/Netflix/feign">Feign</link> is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring MVC annotations and for using the same <literal>HttpMessageConverters</literal> used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.</simpara>
<section xml:id="netflix-feign-starter">
<title>How to Include Feign</title>
<simpara>To include Feign in your project use the starter with group <literal>org.springframework.cloud</literal>
and artifact id <literal>spring-cloud-starter-openfeign</literal>. See the <link xl:href="https://projects.spring.io/spring-cloud/">Spring Cloud Project page</link>
for details on setting up your build system with the current Spring Cloud Release Train.</simpara>
<simpara>Example spring boot app</simpara>
<programlisting language="java" linenumbering="unnumbered">@SpringBootApplication
@EnableFeignClients
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}</programlisting>
<formalpara>
<title>StoreClient.java</title>
<para>
<programlisting language="java" linenumbering="unnumbered">@FeignClient("stores")
public interface StoreClient {
@RequestMapping(method = RequestMethod.GET, value = "/stores")
List&lt;Store&gt; getStores();
@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")
Store update(@PathVariable("storeId") Long storeId, Store store);
}</programlisting>
</para>
</formalpara>
<simpara>In the <literal>@FeignClient</literal> annotation the String value ("stores" above) is
an arbitrary client name, which is used to create a Ribbon load
balancer (see <link linkend="spring-cloud-ribbon">below for details of Ribbon
support</link>). You can also specify a URL using the <literal>url</literal> attribute
(absolute value or just a hostname). The name of the bean in the
application context is the fully qualified name of the interface.
To specify your own alias value you can use the <literal>qualifier</literal> value
of the <literal>@FeignClient</literal> annotation.</simpara>
<simpara>The Ribbon client above will want to discover the physical addresses
for the "stores" service. If your application is a Eureka client then
it will resolve the service in the Eureka service registry. If you
don&#8217;t want to use Eureka, you can simply configure a list of servers
in your external configuration (see
<link linkend="spring-cloud-ribbon-without-eureka">above for example</link>).</simpara>
</section>
<section xml:id="spring-cloud-feign-overriding-defaults">
<title>Overriding Feign Defaults</title>
<simpara>A central concept in Spring Cloud&#8217;s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the <literal>@FeignClient</literal> annotation. Spring Cloud creates a new ensemble as an
<literal>ApplicationContext</literal> on demand for each named client using <literal>FeignClientsConfiguration</literal>. This contains (amongst other things) an <literal>feign.Decoder</literal>, a <literal>feign.Encoder</literal>, and a <literal>feign.Contract</literal>.</simpara>
<simpara>Spring Cloud lets you take full control of the feign client by declaring additional configuration (on top of the <literal>FeignClientsConfiguration</literal>) using <literal>@FeignClient</literal>. Example:</simpara>
<programlisting language="java" linenumbering="unnumbered">@FeignClient(name = "stores", configuration = FooConfiguration.class)
public interface StoreClient {
//..
}</programlisting>
<simpara>In this case the client is composed from the components already in <literal>FeignClientsConfiguration</literal> together with any in <literal>FooConfiguration</literal> (where the latter will override the former).</simpara>
<note>
<simpara><literal>FooConfiguration</literal> does not need to be annotated with <literal>@Configuration</literal>. However, if it is, then take care to exclude it from any <literal>@ComponentScan</literal> that would otherwise include this configuration as it will become the default source for <literal>feign.Decoder</literal>, <literal>feign.Encoder</literal>, <literal>feign.Contract</literal>, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any <literal>@ComponentScan</literal> or <literal>@SpringBootApplication</literal>, or it can be explicitly excluded in <literal>@ComponentScan</literal>.</simpara>
</note>
<note>
<simpara>The <literal>serviceId</literal> attribute is now deprecated in favor of the <literal>name</literal> attribute.</simpara>
</note>
<warning>
<simpara>Previously, using the <literal>url</literal> attribute, did not require the <literal>name</literal> attribute. Using <literal>name</literal> is now required.</simpara>
</warning>
<simpara>Placeholders are supported in the <literal>name</literal> and <literal>url</literal> attributes.</simpara>
<programlisting language="java" linenumbering="unnumbered">@FeignClient(name = "${feign.name}", url = "${feign.url}")
public interface StoreClient {
//..
}</programlisting>
<simpara>Spring Cloud Netflix provides the following beans by default for feign (<literal>BeanType</literal> beanName: <literal>ClassName</literal>):</simpara>
<itemizedlist>
<listitem>
<simpara><literal>Decoder</literal> feignDecoder: <literal>ResponseEntityDecoder</literal> (which wraps a <literal>SpringDecoder</literal>)</simpara>
</listitem>
<listitem>
<simpara><literal>Encoder</literal> feignEncoder: <literal>SpringEncoder</literal></simpara>
</listitem>
<listitem>
<simpara><literal>Logger</literal> feignLogger: <literal>Slf4jLogger</literal></simpara>
</listitem>
<listitem>
<simpara><literal>Contract</literal> feignContract: <literal>SpringMvcContract</literal></simpara>
</listitem>
<listitem>
<simpara><literal>Feign.Builder</literal> feignBuilder: <literal>HystrixFeign.Builder</literal></simpara>
</listitem>
<listitem>
<simpara><literal>Client</literal> feignClient: if Ribbon is enabled it is a <literal>LoadBalancerFeignClient</literal>, otherwise the default feign client is used.</simpara>
</listitem>
</itemizedlist>
<simpara>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <literal>feign.okhttp.enabled</literal> or <literal>feign.httpclient.enabled</literal> to <literal>true</literal>, respectively, and having them on the classpath.
You can customize the HTTP client used by providing a bean of either <literal>ClosableHttpClient</literal> when using Apache or <literal>OkHttpClient</literal> when using OK HTTP.</simpara>
<simpara>Spring Cloud Netflix <emphasis>does not</emphasis> provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client:</simpara>
<itemizedlist>
<listitem>
<simpara><literal>Logger.Level</literal></simpara>
</listitem>
<listitem>
<simpara><literal>Retryer</literal></simpara>
</listitem>
<listitem>
<simpara><literal>ErrorDecoder</literal></simpara>
</listitem>
<listitem>
<simpara><literal>Request.Options</literal></simpara>
</listitem>
<listitem>
<simpara><literal>Collection&lt;RequestInterceptor&gt;</literal></simpara>
</listitem>
<listitem>
<simpara><literal>SetterFactory</literal></simpara>
</listitem>
</itemizedlist>
<simpara>Creating a bean of one of those type and placing it in a <literal>@FeignClient</literal> configuration (such as <literal>FooConfiguration</literal> above) allows you to override each one of the beans described. Example:</simpara>
<programlisting language="java" linenumbering="unnumbered">@Configuration
public class FooConfiguration {
@Bean
public Contract feignContract() {
return new feign.Contract.Default();
}
@Bean
public BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
return new BasicAuthRequestInterceptor("user", "password");
}
}</programlisting>
<simpara>This replaces the <literal>SpringMvcContract</literal> with <literal>feign.Contract.Default</literal> and adds a <literal>RequestInterceptor</literal> to the collection of <literal>RequestInterceptor</literal>.</simpara>
<simpara><literal>@FeignClient</literal> also can be configured using configuration properties.</simpara>
<simpara>application.yml</simpara>
<programlisting language="yaml" linenumbering="unnumbered">feign:
client:
config:
feignName:
connectTimeout: 5000
readTimeout: 5000
loggerLevel: full
errorDecoder: com.example.SimpleErrorDecoder
retryer: com.example.SimpleRetryer
requestInterceptors:
- com.example.FooRequestInterceptor
- com.example.BarRequestInterceptor
decode404: false
encoder: com.example.SimpleEncoder
decoder: com.example.SimpleDecoder
contract: com.example.SimpleContract</programlisting>
<simpara>Default configurations can be specified in the <literal>@EnableFeignClients</literal> attribute <literal>defaultConfiguration</literal> in a similar manner as described above. The difference is that this configuration will apply to <emphasis>all</emphasis> feign clients.</simpara>
<simpara>If you prefer using configuration properties to configured all <literal>@FeignClient</literal>, you can create configuration properties with <literal>default</literal> feign name.</simpara>
<simpara>application.yml</simpara>
<programlisting language="yaml" linenumbering="unnumbered">feign:
client:
config:
default:
connectTimeout: 5000
readTimeout: 5000
loggerLevel: basic</programlisting>
<simpara>If we create both <literal>@Configuration</literal> bean and configuration properties, configuration properties will win.
It will override <literal>@Configuration</literal> values. But if you want to change the priority to <literal>@Configuration</literal>,
you can change <literal>feign.client.default-to-properties</literal> to <literal>false</literal>.</simpara>
<note>
<simpara>If you need to use <literal>ThreadLocal</literal> bound variables in your <literal>RequestInterceptor`s you will need to either set the
thread isolation strategy for Hystrix to `SEMAPHORE</literal> or disable Hystrix in Feign.</simpara>
</note>
<simpara>application.yml</simpara>
<programlisting language="yaml" linenumbering="unnumbered"># To disable Hystrix in Feign
feign:
hystrix:
enabled: false
# To set thread isolation to SEMAPHORE
hystrix:
command:
default:
execution:
isolation:
strategy: SEMAPHORE</programlisting>
</section>
<section xml:id="_creating_feign_clients_manually">
<title>Creating Feign Clients Manually</title>
<simpara>In some cases it might be necessary to customize your Feign Clients in a way that is not
possible using the methods above. In this case you can create Clients using the
<link xl:href="https://github.com/OpenFeign/feign/#basics">Feign Builder API</link>. Below is an example
which creates two Feign Clients with the same interface but configures each one with
a separate request interceptor.</simpara>
<programlisting language="java" linenumbering="unnumbered">@Import(FeignClientsConfiguration.class)
class FooController {
private FooClient fooClient;
private FooClient adminClient;
@Autowired
public FooController(Decoder decoder, Encoder encoder, Client client, Contract contract) {
this.fooClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.contract(contract)
.requestInterceptor(new BasicAuthRequestInterceptor("user", "user"))
.target(FooClient.class, "http://PROD-SVC");
this.adminClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.contract(contract)
.requestInterceptor(new BasicAuthRequestInterceptor("admin", "admin"))
.target(FooClient.class, "http://PROD-SVC");
}
}</programlisting>
<note>
<simpara>In the above example <literal>FeignClientsConfiguration.class</literal> is the default configuration
provided by Spring Cloud Netflix.</simpara>
</note>
<note>
<simpara><literal>PROD-SVC</literal> is the name of the service the Clients will be making requests to.</simpara>
</note>
<note>
<simpara>The Feign <literal>Contract</literal> object defines what annotations and values are valid on interfaces. The
autowired <literal>Contract</literal> bean provides supports for SpringMVC annotations, instead of
the default Feign native annotations.</simpara>
</note>
</section>
<section xml:id="spring-cloud-feign-hystrix">
<title>Feign Hystrix Support</title>
<simpara>If Hystrix is on the classpath and <literal>feign.hystrix.enabled=true</literal>, Feign will wrap all methods with a circuit breaker. Returning a <literal>com.netflix.hystrix.HystrixCommand</literal> is also available. This lets you use reactive patterns (with a call to <literal>.toObservable()</literal> or <literal>.observe()</literal> or asynchronous use (with a call to <literal>.queue()</literal>).</simpara>
<simpara>To disable Hystrix support on a per-client basis create a vanilla <literal>Feign.Builder</literal> with the "prototype" scope, e.g.:</simpara>
<programlisting language="java" linenumbering="unnumbered">@Configuration
public class FooConfiguration {
@Bean
@Scope("prototype")
public Feign.Builder feignBuilder() {
return Feign.builder();
}
}</programlisting>
<warning>
<simpara>Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in
favor for an opt-in approach.</simpara>
</warning>
</section>
<section xml:id="spring-cloud-feign-hystrix-fallback">
<title>Feign Hystrix Fallbacks</title>
<simpara>Hystrix supports the notion of a fallback: a default code path that is executed when they circuit is open or there is an error. To enable fallbacks for a given <literal>@FeignClient</literal> set the <literal>fallback</literal> attribute to the class name that implements the fallback. You also need to declare your implementation as a Spring bean.</simpara>
<programlisting language="java" linenumbering="unnumbered">@FeignClient(name = "hello", fallback = HystrixClientFallback.class)
protected interface HystrixClient {
@RequestMapping(method = RequestMethod.GET, value = "/hello")
Hello iFailSometimes();
}
static class HystrixClientFallback implements HystrixClient {
@Override
public Hello iFailSometimes() {
return new Hello("fallback");
}
}</programlisting>
<simpara>If one needs access to the cause that made the fallback trigger, one can use the <literal>fallbackFactory</literal> attribute inside <literal>@FeignClient</literal>.</simpara>
<programlisting language="java" linenumbering="unnumbered">@FeignClient(name = "hello", fallbackFactory = HystrixClientFallbackFactory.class)
protected interface HystrixClient {
@RequestMapping(method = RequestMethod.GET, value = "/hello")
Hello iFailSometimes();
}
@Component
static class HystrixClientFallbackFactory implements FallbackFactory&lt;HystrixClient&gt; {
@Override
public HystrixClient create(Throwable cause) {
return new HystrixClient() {
@Override
public Hello iFailSometimes() {
return new Hello("fallback; reason was: " + cause.getMessage());
}
};
}
}</programlisting>
<warning>
<simpara>There is a limitation with the implementation of fallbacks in Feign and how Hystrix fallbacks work. Fallbacks are currently not supported for methods that return <literal>com.netflix.hystrix.HystrixCommand</literal> and <literal>rx.Observable</literal>.</simpara>
</warning>
</section>
<section xml:id="_feign_and_literal_primary_literal">
<title>Feign and <literal>@Primary</literal></title>
<simpara>When using Feign with Hystrix fallbacks, there are multiple beans in the <literal>ApplicationContext</literal> of the same type. This will cause <literal>@Autowired</literal> to not work because there isn&#8217;t exactly one bean, or one marked as primary. To work around this, Spring Cloud Netflix marks all Feign instances as <literal>@Primary</literal>, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the <literal>primary</literal> attribute of <literal>@FeignClient</literal> to false.</simpara>
<programlisting language="java" linenumbering="unnumbered">@FeignClient(name = "hello", primary = false)
public interface HelloClient {
// methods here
}</programlisting>
</section>
<section xml:id="spring-cloud-feign-inheritance">
<title>Feign Inheritance Support</title>
<simpara>Feign supports boilerplate apis via single-inheritance interfaces.
This allows grouping common operations into convenient base interfaces.</simpara>
<formalpara>
<title>UserService.java</title>
<para>
<programlisting language="java" linenumbering="unnumbered">public interface UserService {
@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")
User getUser(@PathVariable("id") long id);
}</programlisting>
</para>
</formalpara>
<formalpara>
<title>UserResource.java</title>
<para>
<programlisting language="java" linenumbering="unnumbered">@RestController
public class UserResource implements UserService {
}</programlisting>
</para>
</formalpara>
<formalpara>
<title>UserClient.java</title>
<para>
<programlisting language="java" linenumbering="unnumbered">package project.user;
@FeignClient("users")
public interface UserClient extends UserService {
}</programlisting>
</para>
</formalpara>
<note>
<simpara>It is generally not advisable to share an interface between a
server and a client. It introduces tight coupling, and also actually
doesn&#8217;t work with Spring MVC in its current form (method parameter
mapping is not inherited).</simpara>
</note>
</section>
<section xml:id="_feign_request_response_compression">
<title>Feign request/response compression</title>
<simpara>You may consider enabling the request or response GZIP compression for your
Feign requests. You can do this by enabling one of the properties:</simpara>
<programlisting language="java" linenumbering="unnumbered">feign.compression.request.enabled=true
feign.compression.response.enabled=true</programlisting>
<simpara>Feign request compression gives you settings similar to what you may set for your web server:</simpara>
<programlisting language="java" linenumbering="unnumbered">feign.compression.request.enabled=true
feign.compression.request.mime-types=text/xml,application/xml,application/json
feign.compression.request.min-request-size=2048</programlisting>
<simpara>These properties allow you to be selective about the compressed media types and minimum request threshold length.</simpara>
</section>
<section xml:id="_feign_logging">
<title>Feign logging</title>
<simpara>A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client. Feign logging only responds to the <literal>DEBUG</literal> level.</simpara>
<formalpara>
<title>application.yml</title>
<para>
<programlisting language="yaml" linenumbering="unnumbered">logging.level.project.user.UserClient: DEBUG</programlisting>
</para>
</formalpara>
<simpara>The <literal>Logger.Level</literal> object that you may configure per client, tells Feign how much to log. Choices are:</simpara>
<itemizedlist>
<listitem>
<simpara><literal>NONE</literal>, No logging (<emphasis role="strong">DEFAULT</emphasis>).</simpara>
</listitem>
<listitem>
<simpara><literal>BASIC</literal>, Log only the request method and URL and the response status code and execution time.</simpara>
</listitem>
<listitem>
<simpara><literal>HEADERS</literal>, Log the basic information along with request and response headers.</simpara>
</listitem>
<listitem>
<simpara><literal>FULL</literal>, Log the headers, body, and metadata for both requests and responses.</simpara>
</listitem>
</itemizedlist>
<simpara>For example, the following would set the <literal>Logger.Level</literal> to <literal>FULL</literal>:</simpara>
<programlisting language="java" linenumbering="unnumbered">@Configuration
public class FooConfiguration {
@Bean
Logger.Level feignLoggerLevel() {
return Logger.Level.FULL;
}
}</programlisting>
</section>
</chapter>
</book>
-35
View File
@@ -1,35 +0,0 @@
/*
code highlight CSS resemblign the Eclipse IDE default color schema
@author Costin Leau
*/
.hl-keyword {
color: #7F0055;
font-weight: bold;
}
.hl-comment {
color: #3F5F5F;
font-style: italic;
}
.hl-multiline-comment {
color: #3F5FBF;
font-style: italic;
}
.hl-tag {
color: #3F7F7F;
}
.hl-attribute {
color: #7F007F;
}
.hl-value {
color: #2A00FF;
}
.hl-string {
color: #2A00FF;
}
-9
View File
@@ -1,9 +0,0 @@
@IMPORT url("manual.css");
body.firstpage {
background: url("../images/background.png") no-repeat center top;
}
div.part h1 {
border-top: none;
}
-6
View File
@@ -1,6 +0,0 @@
@IMPORT url("manual.css");
body {
background: url("../images/background.png") no-repeat center top;
}
-342
View File
@@ -1,342 +0,0 @@
@IMPORT url("highlight.css");
html {
padding: 0pt;
margin: 0pt;
}
body {
color: #333333;
margin: 15px 30px;
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
code {
font-size: 16px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
:not(a) > code {
color: #6D180B;
}
:not(pre) > code {
background-color: #F2F2F2;
border: 1px solid #CCCCCC;
border-radius: 4px;
padding: 1px 3px 0;
text-shadow: none;
white-space: nowrap;
}
body > *:first-child {
margin-top: 0 !important;
}
div {
margin: 0pt;
}
hr {
border: 1px solid #CCCCCC;
background: #CCCCCC;
}
h1, h2, h3, h4, h5, h6 {
color: #000000;
cursor: text;
font-weight: bold;
margin: 30px 0 10px;
padding: 0;
}
h1, h2, h3 {
margin: 40px 0 10px;
}
h1 {
margin: 70px 0 30px;
padding-top: 20px;
}
div.part h1 {
border-top: 1px dotted #CCCCCC;
}
h1, h1 code {
font-size: 32px;
}
h2, h2 code {
font-size: 24px;
}
h3, h3 code {
font-size: 20px;
}
h4, h1 code, h5, h5 code, h6, h6 code {
font-size: 18px;
}
div.book, div.chapter, div.appendix, div.part, div.preface {
min-width: 300px;
max-width: 1200px;
margin: 0 auto;
}
p.releaseinfo {
font-weight: bold;
margin-bottom: 40px;
margin-top: 40px;
}
div.authorgroup {
line-height: 1;
}
p.copyright {
line-height: 1;
margin-bottom: -5px;
}
.legalnotice p {
font-style: italic;
font-size: 14px;
line-height: 1;
}
div.titlepage + p, div.titlepage + p {
margin-top: 0;
}
pre {
line-height: 1.0;
color: black;
}
a {
color: #4183C4;
text-decoration: none;
}
p {
margin: 15px 0;
text-align: left;
}
ul, ol {
padding-left: 30px;
}
li p {
margin: 0;
}
div.table {
margin: 1em;
padding: 0.5em;
text-align: center;
}
div.table table, div.informaltable table {
display: table;
width: 100%;
}
div.table td {
padding-left: 7px;
padding-right: 7px;
}
.sidebar {
line-height: 1.4;
padding: 0 20px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
}
.sidebar p.title {
color: #6D180B;
}
pre.programlisting, pre.screen {
font-size: 15px;
padding: 6px 10px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
clear: both;
overflow: auto;
line-height: 1.4;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
table {
border-collapse: collapse;
border-spacing: 0;
border: 1px solid #DDDDDD !important;
border-radius: 4px !important;
border-collapse: separate !important;
line-height: 1.6;
}
table thead {
background: #F5F5F5;
}
table tr {
border: none;
border-bottom: none;
}
table th {
font-weight: bold;
}
table th, table td {
border: none !important;
padding: 6px 13px;
}
table tr:nth-child(2n) {
background-color: #F8F8F8;
}
td p {
margin: 0 0 15px 0;
}
div.table-contents td p {
margin: 0;
}
div.important *, div.note *, div.tip *, div.warning *, div.navheader *, div.navfooter *, div.calloutlist * {
border: none !important;
background: none !important;
margin: 0;
}
div.important p, div.note p, div.tip p, div.warning p {
color: #6F6F6F;
line-height: 1.6;
}
div.important code, div.note code, div.tip code, div.warning code {
background-color: #F2F2F2 !important;
border: 1px solid #CCCCCC !important;
border-radius: 4px !important;
padding: 1px 3px 0 !important;
text-shadow: none !important;
white-space: nowrap !important;
}
.note th, .tip th, .warning th {
display: none;
}
.note tr:first-child td, .tip tr:first-child td, .warning tr:first-child td {
border-right: 1px solid #CCCCCC !important;
padding-top: 10px;
}
div.calloutlist p, div.calloutlist td {
padding: 0;
margin: 0;
}
div.calloutlist > table > tbody > tr > td:first-child {
padding-left: 10px;
width: 30px !important;
}
div.important, div.note, div.tip, div.warning {
margin-left: 0px !important;
margin-right: 20px !important;
margin-top: 20px;
margin-bottom: 20px;
padding-top: 10px;
padding-bottom: 10px;
}
div.toc {
line-height: 1.2;
}
dl, dt {
margin-top: 1px;
margin-bottom: 0;
}
div.toc > dl > dt {
font-size: 32px;
font-weight: bold;
margin: 30px 0 10px 0;
display: block;
}
div.toc > dl > dd > dl > dt {
font-size: 24px;
font-weight: bold;
margin: 20px 0 10px 0;
display: block;
}
div.toc > dl > dd > dl > dd > dl > dt {
font-weight: bold;
font-size: 20px;
margin: 10px 0 0 0;
}
tbody.footnotes * {
border: none !important;
}
div.footnote p {
margin: 0;
line-height: 1;
}
div.footnote p sup {
margin-right: 6px;
vertical-align: middle;
}
div.navheader {
border-bottom: 1px solid #CCCCCC;
}
div.navfooter {
border-top: 1px solid #CCCCCC;
}
.title {
margin-left: -1em;
padding-left: 1em;
}
.title > a {
position: absolute;
visibility: hidden;
display: block;
font-size: 0.85em;
margin-top: 0.05em;
margin-left: -1em;
vertical-align: text-top;
color: black;
}
.title > a:before {
content: "\00A7";
}
.title:hover > a, .title > a:hover, .title:hover > a:hover {
visibility: visible;
}
.title:focus > a, .title > a:focus, .title:focus > a:focus {
outline: 0;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

-117
View File
@@ -1,117 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.7.1">
<title>spring-cloud-openfeign</title>
<link rel="stylesheet" href="css/manual-singlepage.css">
<style>
.hidden {
display: none;
}
.switch {
border-width: 1px 1px 0 1px;
border-style: solid;
border-color: #7a2518;
display: inline-block;
}
.switch--item {
padding: 10px;
background-color: #ffffff;
color: #7a2518;
display: inline-block;
cursor: pointer;
}
.switch--item.selected {
background-color: #7a2519;
color: #ffffff;
}
</style>
<script src="http://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
<script type="text/javascript">
function addBlockSwitches() {
$('.primary').each(function() {
primary = $(this);
createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");
primary.children('.title').remove();
});
$('.secondary').each(function(idx, node) {
secondary = $(node);
primary = findPrimary(secondary);
switchItem = createSwitchItem(secondary, primary.children('.switch'));
switchItem.content.addClass('hidden');
findPrimary(secondary).append(switchItem.content);
secondary.remove();
});
}
function createBlockSwitch(primary) {
blockSwitch = $('<div class="switch"></div>');
primary.prepend(blockSwitch);
return blockSwitch;
}
function findPrimary(secondary) {
candidate = secondary.prev();
while (!candidate.is('.primary')) {
candidate = candidate.prev();
}
return candidate;
}
function createSwitchItem(block, blockSwitch) {
blockName = block.children('.title').text();
content = block.children('.content').first().append(block.next('.colist'));
item = $('<div class="switch--item">' + blockName + '</div>');
item.on('click', '', content, function(e) {
$(this).addClass('selected');
$(this).siblings().removeClass('selected');
e.data.siblings('.content').addClass('hidden');
e.data.removeClass('hidden');
});
blockSwitch.append(item);
return {'item': item, 'content': content};
}
$(addBlockSwitches);
</script>
</head>
<body class="article">
<div id="header">
<h1>spring-cloud-openfeign</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>2.1.3.BUILD-SNAPSHOT</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pick_the_documentation_option">Pick The Documentation Option</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="single/spring-cloud-openfeign.html">Single HTML</a></p>
</li>
<li>
<p><a href="multi/multi_spring-cloud-openfeign.html">Multi HTML</a></p>
</li>
</ul>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js"></script>
<script>prettyPrint()</script>
</body>
</html>
-35
View File
@@ -1,35 +0,0 @@
/*
code highlight CSS resemblign the Eclipse IDE default color schema
@author Costin Leau
*/
.hl-keyword {
color: #7F0055;
font-weight: bold;
}
.hl-comment {
color: #3F5F5F;
font-style: italic;
}
.hl-multiline-comment {
color: #3F5FBF;
font-style: italic;
}
.hl-tag {
color: #3F7F7F;
}
.hl-attribute {
color: #7F007F;
}
.hl-value {
color: #2A00FF;
}
.hl-string {
color: #2A00FF;
}
-9
View File
@@ -1,9 +0,0 @@
@IMPORT url("manual.css");
body.firstpage {
background: url("../images/background.png") no-repeat center top;
}
div.part h1 {
border-top: none;
}
-6
View File
@@ -1,6 +0,0 @@
@IMPORT url("manual.css");
body {
background: url("../images/background.png") no-repeat center top;
}
-342
View File
@@ -1,342 +0,0 @@
@IMPORT url("highlight.css");
html {
padding: 0pt;
margin: 0pt;
}
body {
color: #333333;
margin: 15px 30px;
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
code {
font-size: 16px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
:not(a) > code {
color: #6D180B;
}
:not(pre) > code {
background-color: #F2F2F2;
border: 1px solid #CCCCCC;
border-radius: 4px;
padding: 1px 3px 0;
text-shadow: none;
white-space: nowrap;
}
body > *:first-child {
margin-top: 0 !important;
}
div {
margin: 0pt;
}
hr {
border: 1px solid #CCCCCC;
background: #CCCCCC;
}
h1, h2, h3, h4, h5, h6 {
color: #000000;
cursor: text;
font-weight: bold;
margin: 30px 0 10px;
padding: 0;
}
h1, h2, h3 {
margin: 40px 0 10px;
}
h1 {
margin: 70px 0 30px;
padding-top: 20px;
}
div.part h1 {
border-top: 1px dotted #CCCCCC;
}
h1, h1 code {
font-size: 32px;
}
h2, h2 code {
font-size: 24px;
}
h3, h3 code {
font-size: 20px;
}
h4, h1 code, h5, h5 code, h6, h6 code {
font-size: 18px;
}
div.book, div.chapter, div.appendix, div.part, div.preface {
min-width: 300px;
max-width: 1200px;
margin: 0 auto;
}
p.releaseinfo {
font-weight: bold;
margin-bottom: 40px;
margin-top: 40px;
}
div.authorgroup {
line-height: 1;
}
p.copyright {
line-height: 1;
margin-bottom: -5px;
}
.legalnotice p {
font-style: italic;
font-size: 14px;
line-height: 1;
}
div.titlepage + p, div.titlepage + p {
margin-top: 0;
}
pre {
line-height: 1.0;
color: black;
}
a {
color: #4183C4;
text-decoration: none;
}
p {
margin: 15px 0;
text-align: left;
}
ul, ol {
padding-left: 30px;
}
li p {
margin: 0;
}
div.table {
margin: 1em;
padding: 0.5em;
text-align: center;
}
div.table table, div.informaltable table {
display: table;
width: 100%;
}
div.table td {
padding-left: 7px;
padding-right: 7px;
}
.sidebar {
line-height: 1.4;
padding: 0 20px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
}
.sidebar p.title {
color: #6D180B;
}
pre.programlisting, pre.screen {
font-size: 15px;
padding: 6px 10px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
clear: both;
overflow: auto;
line-height: 1.4;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
table {
border-collapse: collapse;
border-spacing: 0;
border: 1px solid #DDDDDD !important;
border-radius: 4px !important;
border-collapse: separate !important;
line-height: 1.6;
}
table thead {
background: #F5F5F5;
}
table tr {
border: none;
border-bottom: none;
}
table th {
font-weight: bold;
}
table th, table td {
border: none !important;
padding: 6px 13px;
}
table tr:nth-child(2n) {
background-color: #F8F8F8;
}
td p {
margin: 0 0 15px 0;
}
div.table-contents td p {
margin: 0;
}
div.important *, div.note *, div.tip *, div.warning *, div.navheader *, div.navfooter *, div.calloutlist * {
border: none !important;
background: none !important;
margin: 0;
}
div.important p, div.note p, div.tip p, div.warning p {
color: #6F6F6F;
line-height: 1.6;
}
div.important code, div.note code, div.tip code, div.warning code {
background-color: #F2F2F2 !important;
border: 1px solid #CCCCCC !important;
border-radius: 4px !important;
padding: 1px 3px 0 !important;
text-shadow: none !important;
white-space: nowrap !important;
}
.note th, .tip th, .warning th {
display: none;
}
.note tr:first-child td, .tip tr:first-child td, .warning tr:first-child td {
border-right: 1px solid #CCCCCC !important;
padding-top: 10px;
}
div.calloutlist p, div.calloutlist td {
padding: 0;
margin: 0;
}
div.calloutlist > table > tbody > tr > td:first-child {
padding-left: 10px;
width: 30px !important;
}
div.important, div.note, div.tip, div.warning {
margin-left: 0px !important;
margin-right: 20px !important;
margin-top: 20px;
margin-bottom: 20px;
padding-top: 10px;
padding-bottom: 10px;
}
div.toc {
line-height: 1.2;
}
dl, dt {
margin-top: 1px;
margin-bottom: 0;
}
div.toc > dl > dt {
font-size: 32px;
font-weight: bold;
margin: 30px 0 10px 0;
display: block;
}
div.toc > dl > dd > dl > dt {
font-size: 24px;
font-weight: bold;
margin: 20px 0 10px 0;
display: block;
}
div.toc > dl > dd > dl > dd > dl > dt {
font-weight: bold;
font-size: 20px;
margin: 10px 0 0 0;
}
tbody.footnotes * {
border: none !important;
}
div.footnote p {
margin: 0;
line-height: 1;
}
div.footnote p sup {
margin-right: 6px;
vertical-align: middle;
}
div.navheader {
border-bottom: 1px solid #CCCCCC;
}
div.navfooter {
border-top: 1px solid #CCCCCC;
}
.title {
margin-left: -1em;
padding-left: 1em;
}
.title > a {
position: absolute;
visibility: hidden;
display: block;
font-size: 0.85em;
margin-top: 0.05em;
margin-left: -1em;
vertical-align: text-top;
color: black;
}
.title > a:before {
content: "\00A7";
}
.title:hover > a, .title > a:hover, .title:hover > a:hover {
visibility: visible;
}
.title:focus > a, .title > a:focus, .title:focus > a:focus {
outline: 0;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

-4
View File
@@ -1,4 +0,0 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="up" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="prev" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="next" href="multi_spring-cloud-feign.html" title="1.&nbsp;Declarative REST Client: Feign"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-openfeign.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-feign.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p><span class="strong"><strong>2.1.6.BUILD-SNAPSHOT</strong></span></p><p>This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration
and binding to the Spring Environment and other Spring programming model idioms.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_spring-cloud-openfeign.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-feign.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Spring Cloud OpenFeign&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-openfeign.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;1.&nbsp;Declarative REST Client: Feign</td></tr></table></div></body></html>
-221
View File
@@ -1,221 +0,0 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>1.&nbsp;Declarative REST Client: Feign</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="up" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="prev" href="multi_pr01.html" title=""></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1.&nbsp;Declarative REST Client: Feign</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;</td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="spring-cloud-feign" href="#spring-cloud-feign"></a>1.&nbsp;Declarative REST Client: Feign</h1></div></div></div><p><a class="link" href="https://github.com/Netflix/feign" target="_top">Feign</a> is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring MVC annotations and for using the same <code class="literal">HttpMessageConverters</code> used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="netflix-feign-starter" href="#netflix-feign-starter"></a>1.1&nbsp;How to Include Feign</h2></div></div></div><p>To include Feign in your project use the starter with group <code class="literal">org.springframework.cloud</code>
and artifact id <code class="literal">spring-cloud-starter-openfeign</code>. See the <a class="link" href="https://projects.spring.io/spring-cloud/" target="_top">Spring Cloud Project page</a>
for details on setting up your build system with the current Spring Cloud Release Train.</p><p>Example spring boot app</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@SpringBootApplication</xslthl:annotation>
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@EnableFeignClients</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Application {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">void</span> main(String[] args) {
SpringApplication.run(Application.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, args);
}
}</pre><p><b>StoreClient.java.&nbsp;</b>
</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient("stores")</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@RequestMapping(method = RequestMethod.GET, value = "/stores")</xslthl:annotation>
List&lt;Store&gt; getStores();
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")</xslthl:annotation>
Store update(<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@PathVariable("storeId")</xslthl:annotation> Long storeId, Store store);
}</pre><p>
</p><p>In the <code class="literal">@FeignClient</code> annotation the String value ("stores" above) is
an arbitrary client name, which is used to create a Ribbon load
balancer (see <a class="link" href="">below for details of Ribbon
support</a>). You can also specify a URL using the <code class="literal">url</code> attribute
(absolute value or just a hostname). The name of the bean in the
application context is the fully qualified name of the interface.
To specify your own alias value you can use the <code class="literal">qualifier</code> value
of the <code class="literal">@FeignClient</code> annotation.</p><p>The Ribbon client above will want to discover the physical addresses
for the "stores" service. If your application is a Eureka client then
it will resolve the service in the Eureka service registry. If you
don&#8217;t want to use Eureka, you can simply configure a list of servers
in your external configuration (see
<a class="link" href="">above for example</a>).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-overriding-defaults" href="#spring-cloud-feign-overriding-defaults"></a>1.2&nbsp;Overriding Feign Defaults</h2></div></div></div><p>A central concept in Spring Cloud&#8217;s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the <code class="literal">@FeignClient</code> annotation. Spring Cloud creates a new ensemble as an
<code class="literal">ApplicationContext</code> on demand for each named client using <code class="literal">FeignClientsConfiguration</code>. This contains (amongst other things) an <code class="literal">feign.Decoder</code>, a <code class="literal">feign.Encoder</code>, and a <code class="literal">feign.Contract</code>.
It is possible to override the name of that ensemble by using the <code class="literal">contextId</code>
attribute of the <code class="literal">@FeignClient</code> annotation.</p><p>Spring Cloud lets you take full control of the feign client by declaring additional configuration (on top of the <code class="literal">FeignClientsConfiguration</code>) using <code class="literal">@FeignClient</code>. Example:</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient(name = "stores", configuration = FooConfiguration.class)</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span>
}</pre><p>In this case the client is composed from the components already in <code class="literal">FeignClientsConfiguration</code> together with any in <code class="literal">FooConfiguration</code> (where the latter will override the former).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">FooConfiguration</code> does not need to be annotated with <code class="literal">@Configuration</code>. However, if it is, then take care to exclude it from any <code class="literal">@ComponentScan</code> that would otherwise include this configuration as it will become the default source for <code class="literal">feign.Decoder</code>, <code class="literal">feign.Encoder</code>, <code class="literal">feign.Contract</code>, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any <code class="literal">@ComponentScan</code> or <code class="literal">@SpringBootApplication</code>, or it can be explicitly excluded in <code class="literal">@ComponentScan</code>.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The <code class="literal">serviceId</code> attribute is now deprecated in favor of the <code class="literal">name</code> attribute.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>Using <code class="literal">contextId</code> attribute of the <code class="literal">@FeignClient</code> annotation in addition to changing the name of
the <code class="literal">ApplicationContext</code> ensemble, it will override the alias of the client name
and it will be used as part of the name of the configuration bean created for that client.</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Previously, using the <code class="literal">url</code> attribute, did not require the <code class="literal">name</code> attribute. Using <code class="literal">name</code> is now required.</p></td></tr></table></div><p>Placeholders are supported in the <code class="literal">name</code> and <code class="literal">url</code> attributes.</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient(name = "${feign.name}", url = "${feign.url}")</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> StoreClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span>
}</pre><p>Spring Cloud Netflix provides the following beans by default for feign (<code class="literal">BeanType</code> beanName: <code class="literal">ClassName</code>):</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Decoder</code> feignDecoder: <code class="literal">ResponseEntityDecoder</code> (which wraps a <code class="literal">SpringDecoder</code>)</li><li class="listitem"><code class="literal">Encoder</code> feignEncoder: <code class="literal">SpringEncoder</code></li><li class="listitem"><code class="literal">Logger</code> feignLogger: <code class="literal">Slf4jLogger</code></li><li class="listitem"><code class="literal">Contract</code> feignContract: <code class="literal">SpringMvcContract</code></li><li class="listitem"><code class="literal">Feign.Builder</code> feignBuilder: <code class="literal">HystrixFeign.Builder</code></li><li class="listitem"><code class="literal">Client</code> feignClient: if Ribbon is enabled it is a <code class="literal">LoadBalancerFeignClient</code>, otherwise the default feign client is used.</li></ul></div><p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code class="literal">feign.okhttp.enabled</code> or <code class="literal">feign.httpclient.enabled</code> to <code class="literal">true</code>, respectively, and having them on the classpath.
You can customize the HTTP client used by providing a bean of either <code class="literal">ClosableHttpClient</code> when using Apache or <code class="literal">OkHttpClient</code> when using OK HTTP.</p><p>Spring Cloud Netflix <span class="emphasis"><em>does not</em></span> provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">Logger.Level</code></li><li class="listitem"><code class="literal">Retryer</code></li><li class="listitem"><code class="literal">ErrorDecoder</code></li><li class="listitem"><code class="literal">Request.Options</code></li><li class="listitem"><code class="literal">Collection&lt;RequestInterceptor&gt;</code></li><li class="listitem"><code class="literal">SetterFactory</code></li></ul></div><p>Creating a bean of one of those type and placing it in a <code class="literal">@FeignClient</code> configuration (such as <code class="literal">FooConfiguration</code> above) allows you to override each one of the beans described. Example:</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Configuration</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Bean</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Contract feignContract() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> feign.Contract.Default();
}
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Bean</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"password"</span>);
}
}</pre><p>This replaces the <code class="literal">SpringMvcContract</code> with <code class="literal">feign.Contract.Default</code> and adds a <code class="literal">RequestInterceptor</code> to the collection of <code class="literal">RequestInterceptor</code>.</p><p><code class="literal">@FeignClient</code> also can be configured using configuration properties.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> feignName</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">5000</xslthl:number>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">5000</xslthl:number>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: full
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> errorDecoder</span>: com.example.SimpleErrorDecoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> retryer</span>: com.example.SimpleRetryer
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> requestInterceptors</span>:
- com.example.FooRequestInterceptor
- com.example.BarRequestInterceptor
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decode404</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> encoder</span>: com.example.SimpleEncoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> decoder</span>: com.example.SimpleDecoder
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> contract</span>: com.example.SimpleContract</pre><p>Default configurations can be specified in the <code class="literal">@EnableFeignClients</code> attribute <code class="literal">defaultConfiguration</code> in a similar manner as described above. The difference is that this configuration will apply to <span class="emphasis"><em>all</em></span> feign clients.</p><p>If you prefer using configuration properties to configured all <code class="literal">@FeignClient</code>, you can create configuration properties with <code class="literal">default</code> feign name.</p><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> client</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> config</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> connectTimeout</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">5000</xslthl:number>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> readTimeout</span>: <xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">5000</xslthl:number>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> loggerLevel</span>: basic</pre><p>If we create both <code class="literal">@Configuration</code> bean and configuration properties, configuration properties will win.
It will override <code class="literal">@Configuration</code> values. But if you want to change the priority to <code class="literal">@Configuration</code>,
you can change <code class="literal">feign.client.default-to-properties</code> to <code class="literal">false</code>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If you need to use <code class="literal">ThreadLocal</code> bound variables in your <code class="literal">RequestInterceptor`s you will need to either set the
thread isolation strategy for Hystrix to `SEMAPHORE</code> or disable Hystrix in Feign.</p></td></tr></table></div><p>application.yml</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To disable Hystrix in Feign</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">feign</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> hystrix</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> enabled</span>: <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">false</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment"># To set thread isolation to SEMAPHORE</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">hystrix</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> command</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> default</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> execution</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> isolation</span>:
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute"> strategy</span>: SEMAPHORE</pre><p>If we want to create multiple feign clients with the same name or url
so that they would point to the same server but each with a different custom configuration then
we have to use <code class="literal">contextId</code> attribute of the <code class="literal">@FeignClient</code> in order to avoid name
collision of these configuration beans.</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient(contextId = "fooClient", name = "stores", configuration = FooConfiguration.class)</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> FooClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span>
}</pre><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient(contextId = "barClient", name = "stores", configuration = BarConfiguration.class)</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> BarClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">//..</span>
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_creating_feign_clients_manually" href="#_creating_feign_clients_manually"></a>1.3&nbsp;Creating Feign Clients Manually</h2></div></div></div><p>In some cases it might be necessary to customize your Feign Clients in a way that is not
possible using the methods above. In this case you can create Clients using the
<a class="link" href="https://github.com/OpenFeign/feign/#basics" target="_top">Feign Builder API</a>. Below is an example
which creates two Feign Clients with the same interface but configures each one with
a separate request interceptor.</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Import(FeignClientsConfiguration.class)</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooController {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient fooClient;
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> FooClient adminClient;
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Autowired</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> FooController(Decoder decoder, Encoder encoder, Client client, Contract contract) {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.fooClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.contract(contract)
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"user"</span>))
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>);
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">this</span>.adminClient = Feign.builder().client(client)
.encoder(encoder)
.decoder(decoder)
.contract(contract)
.requestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> BasicAuthRequestInterceptor(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"admin"</span>))
.target(FooClient.<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span>, <span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"http://PROD-SVC"</span>);
}
}</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In the above example <code class="literal">FeignClientsConfiguration.class</code> is the default configuration
provided by Spring Cloud Netflix.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><code class="literal">PROD-SVC</code> is the name of the service the Clients will be making requests to.</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The Feign <code class="literal">Contract</code> object defines what annotations and values are valid on interfaces. The
autowired <code class="literal">Contract</code> bean provides supports for SpringMVC annotations, instead of
the default Feign native annotations.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix" href="#spring-cloud-feign-hystrix"></a>1.4&nbsp;Feign Hystrix Support</h2></div></div></div><p>If Hystrix is on the classpath and <code class="literal">feign.hystrix.enabled=true</code>, Feign will wrap all methods with a circuit breaker. Returning a <code class="literal">com.netflix.hystrix.HystrixCommand</code> is also available. This lets you use reactive patterns (with a call to <code class="literal">.toObservable()</code> or <code class="literal">.observe()</code> or asynchronous use (with a call to <code class="literal">.queue()</code>).</p><p>To disable Hystrix support on a per-client basis create a vanilla <code class="literal">Feign.Builder</code> with the "prototype" scope, e.g.:</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Configuration</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Bean</xslthl:annotation>
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Scope("prototype")</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Feign.Builder feignBuilder() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Feign.builder();
}
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in
favor for an opt-in approach.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-hystrix-fallback" href="#spring-cloud-feign-hystrix-fallback"></a>1.5&nbsp;Feign Hystrix Fallbacks</h2></div></div></div><p>Hystrix supports the notion of a fallback: a default code path that is executed when they circuit is open or there is an error. To enable fallbacks for a given <code class="literal">@FeignClient</code> set the <code class="literal">fallback</code> attribute to the class name that implements the fallback. You also need to declare your implementation as a Spring bean.</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient(name = "hello", fallback = HystrixClientFallback.class)</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@RequestMapping(method = RequestMethod.GET, value = "/hello")</xslthl:annotation>
Hello iFailSometimes();
}
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallback <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> HystrixClient {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Override</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback"</span>);
}
}</pre><p>If one needs access to the cause that made the fallback trigger, one can use the <code class="literal">fallbackFactory</code> attribute inside <code class="literal">@FeignClient</code>.</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient(name = "hello", fallbackFactory = HystrixClientFallbackFactory.class)</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">protected</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HystrixClient {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@RequestMapping(method = RequestMethod.GET, value = "/hello")</xslthl:annotation>
Hello iFailSometimes();
}
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Component</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">static</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> HystrixClientFallbackFactory <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> FallbackFactory&lt;HystrixClient&gt; {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Override</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> HystrixClient create(Throwable cause) {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> HystrixClient() {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Override</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> Hello iFailSometimes() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">new</span> Hello(<span xmlns:d="http://docbook.org/ns/docbook" class="hl-string">"fallback; reason was: "</span> + cause.getMessage());
}
};
}
}</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>There is a limitation with the implementation of fallbacks in Feign and how Hystrix fallbacks work. Fallbacks are currently not supported for methods that return <code class="literal">com.netflix.hystrix.HystrixCommand</code> and <code class="literal">rx.Observable</code>.</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_and_primary" href="#_feign_and_primary"></a>1.6&nbsp;Feign and <code class="literal">@Primary</code></h2></div></div></div><p>When using Feign with Hystrix fallbacks, there are multiple beans in the <code class="literal">ApplicationContext</code> of the same type. This will cause <code class="literal">@Autowired</code> to not work because there isn&#8217;t exactly one bean, or one marked as primary. To work around this, Spring Cloud Netflix marks all Feign instances as <code class="literal">@Primary</code>, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the <code class="literal">primary</code> attribute of <code class="literal">@FeignClient</code> to false.</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient(name = "hello", primary = false)</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> HelloClient {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// methods here</span>
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="spring-cloud-feign-inheritance" href="#spring-cloud-feign-inheritance"></a>1.7&nbsp;Feign Inheritance Support</h2></div></div></div><p>Feign supports boilerplate apis via single-inheritance interfaces.
This allows grouping common operations into convenient base interfaces.</p><p><b>UserService.java.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserService {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@RequestMapping(method = RequestMethod.GET, value ="/users/{id}")</xslthl:annotation>
User getUser(<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@PathVariable("id")</xslthl:annotation> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">long</span> id);
}</pre><p>
</p><p><b>UserResource.java.&nbsp;</b>
</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@RestController</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> UserResource <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">implements</span> UserService {
}</pre><p>
</p><p><b>UserClient.java.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">package</span> project.user;
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient("users")</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">interface</span> UserClient <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">extends</span> UserService {
}</pre><p>
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is generally not advisable to share an interface between a
server and a client. It introduces tight coupling, and also actually
doesn&#8217;t work with Spring MVC in its current form (method parameter
mapping is not inherited).</p></td></tr></table></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_requestresponse_compression" href="#_feign_requestresponse_compression"></a>1.8&nbsp;Feign request/response compression</h2></div></div></div><p>You may consider enabling the request or response GZIP compression for your
Feign requests. You can do this by enabling one of the properties:</p><pre class="programlisting">feign.compression.request.enabled=true
feign.compression.response.enabled=true</pre><p>Feign request compression gives you settings similar to what you may set for your web server:</p><pre class="programlisting">feign.compression.request.enabled=true
feign.compression.request.mime-types=text/xml,application/xml,application/json
feign.compression.request.min-request-size=<xslthl:number xmlns:xslthl="http://xslthl.sourceforge.net/">2048</xslthl:number></pre><p>These properties allow you to be selective about the compressed media types and minimum request threshold length.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_logging" href="#_feign_logging"></a>1.9&nbsp;Feign logging</h2></div></div></div><p>A logger is created for each Feign client created. By default the name of the logger is the full class name of the interface used to create the Feign client. Feign logging only responds to the <code class="literal">DEBUG</code> level.</p><p><b>application.yml.&nbsp;</b>
</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-attribute">logging.level.project.user.UserClient</span>: DEBUG</pre><p>
</p><p>The <code class="literal">Logger.Level</code> object that you may configure per client, tells Feign how much to log. Choices are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">NONE</code>, No logging (<span class="strong"><strong>DEFAULT</strong></span>).</li><li class="listitem"><code class="literal">BASIC</code>, Log only the request method and URL and the response status code and execution time.</li><li class="listitem"><code class="literal">HEADERS</code>, Log the basic information along with request and response headers.</li><li class="listitem"><code class="literal">FULL</code>, Log the headers, body, and metadata for both requests and responses.</li></ul></div><p>For example, the following would set the <code class="literal">Logger.Level</code> to <code class="literal">FULL</code>:</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Configuration</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> FooConfiguration {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Bean</xslthl:annotation>
Logger.Level feignLoggerLevel() {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">return</span> Logger.Level.FULL;
}
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_feign_querymap_support" href="#_feign_querymap_support"></a>1.10&nbsp;Feign @QueryMap support</h2></div></div></div><p>The OpenFeign <code class="literal">@QueryMap</code> annotation provides support for POJOs to be used as
GET parameter maps. Unfortunately, the default OpenFeign QueryMap annotation is
incompatible with Spring because it lacks a <code class="literal">value</code> property.</p><p>Spring Cloud OpenFeign provides an equivalent <code class="literal">@SpringQueryMap</code> annotation, which
is used to annotate a POJO or Map parameter as a query parameter map.</p><p>For example, the <code class="literal">Params</code> class defines parameters <code class="literal">param1</code> and <code class="literal">param2</code>:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// Params.java</span>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> Params {
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> String param1;
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">private</span> String param2;
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-comment">// [Getters and setters omitted for brevity]</span>
}</pre><p>The following feign client uses the <code class="literal">Params</code> class by using the <code class="literal">@SpringQueryMap</code> annotation:</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@FeignClient("demo")</xslthl:annotation>
<span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">public</span> <span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">class</span> DemoTemplate {
<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@GetMapping(path = "/demo")</xslthl:annotation>
String demoEndpoint(<xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@SpringQueryMap</xslthl:annotation> Params params);
}</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_troubleshooting" href="#_troubleshooting"></a>1.11&nbsp;Troubleshooting</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_early_initialization_errors" href="#_early_initialization_errors"></a>1.11.1&nbsp;Early Initialization Errors</h3></div></div></div><p>Depending on how you are using your Feign clients you may see initialization errors when starting your application.
To work around this problem you can use an <code class="literal">ObjectProvider</code> when autowiring your client.</p><pre class="programlisting"><xslthl:annotation xmlns:xslthl="http://xslthl.sourceforge.net/">@Autowired</xslthl:annotation>
ObjectProvider&lt;TestFeginClient&gt; testFeginClient;</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;</td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-openfeign.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>
@@ -1,3 +0,0 @@
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Spring Cloud OpenFeign</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-openfeign.html" title="Spring Cloud OpenFeign"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Cloud OpenFeign</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud OpenFeign</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi_spring-cloud-feign.html">1. Declarative REST Client: Feign</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-feign.html#netflix-feign-starter">1.1. How to Include Feign</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-overriding-defaults">1.2. Overriding Feign Defaults</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_creating_feign_clients_manually">1.3. Creating Feign Clients Manually</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-hystrix">1.4. Feign Hystrix Support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-hystrix-fallback">1.5. Feign Hystrix Fallbacks</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_and_primary">1.6. Feign and <code class="literal">@Primary</code></a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#spring-cloud-feign-inheritance">1.7. Feign Inheritance Support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_requestresponse_compression">1.8. Feign request/response compression</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_logging">1.9. Feign logging</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_feign_querymap_support">1.10. Feign @QueryMap support</a></span></dt><dt><span class="section"><a href="multi_spring-cloud-feign.html#_troubleshooting">1.11. Troubleshooting</a></span></dt><dd><dl><dt><span class="section"><a href="multi_spring-cloud-feign.html#_early_initialization_errors">1.11.1. Early Initialization Errors</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right" valign="top">&nbsp;</td></tr></table></div></body></html>
-35
View File
@@ -1,35 +0,0 @@
/*
code highlight CSS resemblign the Eclipse IDE default color schema
@author Costin Leau
*/
.hl-keyword {
color: #7F0055;
font-weight: bold;
}
.hl-comment {
color: #3F5F5F;
font-style: italic;
}
.hl-multiline-comment {
color: #3F5FBF;
font-style: italic;
}
.hl-tag {
color: #3F7F7F;
}
.hl-attribute {
color: #7F007F;
}
.hl-value {
color: #2A00FF;
}
.hl-string {
color: #2A00FF;
}
-9
View File
@@ -1,9 +0,0 @@
@IMPORT url("manual.css");
body.firstpage {
background: url("../images/background.png") no-repeat center top;
}
div.part h1 {
border-top: none;
}
-6
View File
@@ -1,6 +0,0 @@
@IMPORT url("manual.css");
body {
background: url("../images/background.png") no-repeat center top;
}
-342
View File
@@ -1,342 +0,0 @@
@IMPORT url("highlight.css");
html {
padding: 0pt;
margin: 0pt;
}
body {
color: #333333;
margin: 15px 30px;
font-family: Helvetica, Arial, Freesans, Clean, Sans-serif;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
code {
font-size: 16px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
:not(a) > code {
color: #6D180B;
}
:not(pre) > code {
background-color: #F2F2F2;
border: 1px solid #CCCCCC;
border-radius: 4px;
padding: 1px 3px 0;
text-shadow: none;
white-space: nowrap;
}
body > *:first-child {
margin-top: 0 !important;
}
div {
margin: 0pt;
}
hr {
border: 1px solid #CCCCCC;
background: #CCCCCC;
}
h1, h2, h3, h4, h5, h6 {
color: #000000;
cursor: text;
font-weight: bold;
margin: 30px 0 10px;
padding: 0;
}
h1, h2, h3 {
margin: 40px 0 10px;
}
h1 {
margin: 70px 0 30px;
padding-top: 20px;
}
div.part h1 {
border-top: 1px dotted #CCCCCC;
}
h1, h1 code {
font-size: 32px;
}
h2, h2 code {
font-size: 24px;
}
h3, h3 code {
font-size: 20px;
}
h4, h1 code, h5, h5 code, h6, h6 code {
font-size: 18px;
}
div.book, div.chapter, div.appendix, div.part, div.preface {
min-width: 300px;
max-width: 1200px;
margin: 0 auto;
}
p.releaseinfo {
font-weight: bold;
margin-bottom: 40px;
margin-top: 40px;
}
div.authorgroup {
line-height: 1;
}
p.copyright {
line-height: 1;
margin-bottom: -5px;
}
.legalnotice p {
font-style: italic;
font-size: 14px;
line-height: 1;
}
div.titlepage + p, div.titlepage + p {
margin-top: 0;
}
pre {
line-height: 1.0;
color: black;
}
a {
color: #4183C4;
text-decoration: none;
}
p {
margin: 15px 0;
text-align: left;
}
ul, ol {
padding-left: 30px;
}
li p {
margin: 0;
}
div.table {
margin: 1em;
padding: 0.5em;
text-align: center;
}
div.table table, div.informaltable table {
display: table;
width: 100%;
}
div.table td {
padding-left: 7px;
padding-right: 7px;
}
.sidebar {
line-height: 1.4;
padding: 0 20px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
}
.sidebar p.title {
color: #6D180B;
}
pre.programlisting, pre.screen {
font-size: 15px;
padding: 6px 10px;
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
clear: both;
overflow: auto;
line-height: 1.4;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
table {
border-collapse: collapse;
border-spacing: 0;
border: 1px solid #DDDDDD !important;
border-radius: 4px !important;
border-collapse: separate !important;
line-height: 1.6;
}
table thead {
background: #F5F5F5;
}
table tr {
border: none;
border-bottom: none;
}
table th {
font-weight: bold;
}
table th, table td {
border: none !important;
padding: 6px 13px;
}
table tr:nth-child(2n) {
background-color: #F8F8F8;
}
td p {
margin: 0 0 15px 0;
}
div.table-contents td p {
margin: 0;
}
div.important *, div.note *, div.tip *, div.warning *, div.navheader *, div.navfooter *, div.calloutlist * {
border: none !important;
background: none !important;
margin: 0;
}
div.important p, div.note p, div.tip p, div.warning p {
color: #6F6F6F;
line-height: 1.6;
}
div.important code, div.note code, div.tip code, div.warning code {
background-color: #F2F2F2 !important;
border: 1px solid #CCCCCC !important;
border-radius: 4px !important;
padding: 1px 3px 0 !important;
text-shadow: none !important;
white-space: nowrap !important;
}
.note th, .tip th, .warning th {
display: none;
}
.note tr:first-child td, .tip tr:first-child td, .warning tr:first-child td {
border-right: 1px solid #CCCCCC !important;
padding-top: 10px;
}
div.calloutlist p, div.calloutlist td {
padding: 0;
margin: 0;
}
div.calloutlist > table > tbody > tr > td:first-child {
padding-left: 10px;
width: 30px !important;
}
div.important, div.note, div.tip, div.warning {
margin-left: 0px !important;
margin-right: 20px !important;
margin-top: 20px;
margin-bottom: 20px;
padding-top: 10px;
padding-bottom: 10px;
}
div.toc {
line-height: 1.2;
}
dl, dt {
margin-top: 1px;
margin-bottom: 0;
}
div.toc > dl > dt {
font-size: 32px;
font-weight: bold;
margin: 30px 0 10px 0;
display: block;
}
div.toc > dl > dd > dl > dt {
font-size: 24px;
font-weight: bold;
margin: 20px 0 10px 0;
display: block;
}
div.toc > dl > dd > dl > dd > dl > dt {
font-weight: bold;
font-size: 20px;
margin: 10px 0 0 0;
}
tbody.footnotes * {
border: none !important;
}
div.footnote p {
margin: 0;
line-height: 1;
}
div.footnote p sup {
margin-right: 6px;
vertical-align: middle;
}
div.navheader {
border-bottom: 1px solid #CCCCCC;
}
div.navfooter {
border-top: 1px solid #CCCCCC;
}
.title {
margin-left: -1em;
padding-left: 1em;
}
.title > a {
position: absolute;
visibility: hidden;
display: block;
font-size: 0.85em;
margin-top: 0.05em;
margin-left: -1em;
vertical-align: text-top;
color: black;
}
.title > a:before {
content: "\00A7";
}
.title:hover > a, .title > a:hover, .title:hover > a:hover {
visibility: visible;
}
.title:focus > a, .title > a:focus, .title:focus > a:focus {
outline: 0;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Some files were not shown because too many files have changed in this diff Show More