Skip to content

Commit fc6fd70

Browse files
Antora (#892)
Switch to Antora Docs.
1 parent 6fc8093 commit fc6fd70

File tree

17 files changed

+222
-70
lines changed

17 files changed

+222
-70
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches-ignore: [ gh-pages ]
5+
tags: '**'
6+
repository_dispatch:
7+
types: request-build-reference # legacy
8+
#schedule:
9+
#- cron: '0 10 * * *' # Once per day at 10am UTC
10+
workflow_dispatch:
11+
permissions:
12+
actions: write
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
# if: github.repository_owner == 'spring-cloud'
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
ref: docs-build
22+
fetch-depth: 1
23+
- name: Dispatch (partial build)
24+
if: github.ref_type == 'branch'
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
28+
- name: Dispatch (full build)
29+
if: github.ref_type == 'tag'
30+
env:
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ _site/
2121
.vscode/
2222
.flattened-pom.xml
2323

24+
25+
node
26+
node_modules
27+
build
28+
package.json
29+
package-lock.json

docs/antora-playbook.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
antora:
2+
extensions:
3+
- '@springio/antora-extensions/partial-build-extension'
4+
- require: '@springio/antora-extensions/latest-version-extension'
5+
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
6+
- '@antora/collector-extension'
7+
- '@antora/atlas-extension'
8+
- require: '@springio/antora-extensions/root-component-extension'
9+
root_component_name: 'cloud-openfeign'
10+
site:
11+
title: Spring Cloud Openfeign
12+
url: https://docs.spring.io/spring-cloud-openfeign/reference/
13+
content:
14+
sources:
15+
- url: ./..
16+
branches: HEAD
17+
start_path: docs
18+
worktrees: true
19+
asciidoc:
20+
attributes:
21+
page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud
22+
page-pagination: ''
23+
hide-uri-scheme: '@'
24+
tabs-sync-option: '@'
25+
chomp: 'all'
26+
extensions:
27+
- '@asciidoctor/tabs'
28+
- '@springio/asciidoctor-extensions'
29+
sourcemap: true
30+
urls:
31+
latest_version_segment: ''
32+
runtime:
33+
log:
34+
failure_level: warn
35+
format: pretty
36+
ui:
37+
bundle:
38+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip

docs/antora.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: cloud-openfeign
2+
version: true
3+
title: Spring Cloud OpenFeign
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
run:
9+
command: ./mvnw --no-transfer-progress -B process-resources -Pdocs -pl docs -Dantora-maven-plugin.phase=none -Dgenerate-docs.phase=none -Dgenerate-readme.phase=none -Dgenerate-cloud-resources.phase=none -Dmaven-dependency-plugin-for-docs.phase=none -Dmaven-dependency-plugin-for-docs-classes.phase=none -DskipTests
10+
local: true
11+
scan:
12+
dir: ./target/classes/antora-resources/

docs/modules/ROOT/nav.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* xref:index.adoc[]
2+
** xref:intro.adoc[]
3+
** xref:spring-cloud-openfeign.adoc[]
4+
* xref:appendix.adoc[]
5+
** xref:configprops.adoc[]

docs/src/main/asciidoc/_attributes.adoc renamed to docs/modules/ROOT/pages/_attributes.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
:doctype: book
22
:idprefix:
33
:idseparator: -
4-
:toc: left
5-
:toclevels: 4
64
:tabsize: 4
75
:numbered:
86
:sectanchors:
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
:numbered!:
22
[appendix]
33
[[common-application-properties]]
4-
== Common application properties
4+
= Common application properties
5+
:page-section-summary-toc: 1
56

6-
include::_attributes.adoc[]
77

88
Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches.
9-
This appendix provides a list of common {project-full-name} properties and references to the underlying classes that consume them.
9+
This appendix provides a list of common Spring Cloud OpenFeign properties and references to the underlying classes that consume them.
1010

1111
NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list.
1212
Also, you can define your own properties.
1313

14-
include::_configprops.adoc[]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[[configuration-properties]]
2+
= Configuration Properties
3+
4+
Below you can find a list of configuration properties.
5+
6+
include::partial$_configprops.adoc[]

docs/modules/ROOT/pages/index.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[[cloud-native-applications]]
2+
= Cloud Native Applications
3+
4+
include::partial$_attributes.adoc[]
5+
6+
// TODO: figure out remote includes in docs and replace pasted text
7+
// include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc[]
8+
NOTE: Spring Cloud is released under the non-restrictive Apache 2.0 license.
9+
If you would like to contribute to this section of the documentation or if you find an error, you can find the source code and issue trackers for the project at {github-issues}[github].
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[[intro]]
2+
= Introduction
3+
14
This project provides OpenFeign integrations for Spring Boot apps through autoconfiguration
25
and binding to the Spring Environment and other Spring programming model idioms.
36

docs/src/main/asciidoc/spring-cloud-openfeign.adoc renamed to docs/modules/ROOT/pages/spring-cloud-openfeign.adoc

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
= Spring Cloud OpenFeign
2-
include::_attributes.adoc[]
3-
4-
*{spring-cloud-version}*
5-
6-
include::intro.adoc[]
7-
1+
[[features]]
2+
= Spring Cloud OpenFeign Features
83

94
[[spring-cloud-feign]]
105
== Declarative REST Client: Feign
@@ -290,6 +285,7 @@ public FeignClientConfigurer feignClientConfigurer() {
290285

291286
TIP: By default, Feign clients do not encode slash `/` characters. You can change this behaviour, by setting the value of `spring.cloud.openfeign.client.decodeSlash` to `false`.
292287

288+
[[springencoder-configuration]]
293289
==== `SpringEncoder` configuration
294290

295291
In the `SpringEncoder` that we provide, we set `null` charset for binary content types and `UTF-8` for all the other ones.
@@ -306,6 +302,7 @@ We can configure timeouts on both the default and the named client. OpenFeign wo
306302

307303
NOTE: In case the server is not running or available a packet results in _connection refused_. The communication ends either with an error message or in a fallback. This can happen _before_ the `connectTimeout` if it is set very low. The time taken to perform a lookup and to receive such a packet causes a significant part of this delay. It is subject to change based on the remote host that involves a DNS lookup.
308304

305+
[[creating-feign-clients-manually]]
309306
=== Creating Feign Clients Manually
310307

311308
In some cases it might be necessary to customize your Feign Clients in a way that is not
@@ -511,6 +508,7 @@ If one needs access to the cause that made the fallback trigger, one can use the
511508
}
512509
----
513510

511+
[[feign-and-primary]]
514512
=== Feign and `@Primary`
515513

516514
When using Feign with Spring Cloud CircuitBreaker fallbacks, there are multiple beans in the `ApplicationContext` of the same type. This will cause `@Autowired` to not work because there isn't exactly one bean, or one marked as primary. To work around this, Spring Cloud OpenFeign marks all Feign instances as `@Primary`, so Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn off this behavior set the `primary` attribute of `@FeignClient` to false.
@@ -561,6 +559,7 @@ public interface UserClient extends UserService {
561559

562560
WARNING: `@FeignClient` interfaces should not be shared between server and client and annotating `@FeignClient` interfaces with `@RequestMapping` on class level is no longer supported.
563561

562+
[[feign-request/response-compression]]
564563
=== Feign request/response compression
565564

566565
You may consider enabling the request or response GZIP compression for your
@@ -585,6 +584,7 @@ These properties allow you to be selective about the compressed media types and
585584

586585
TIP: Since the OkHttpClient uses "transparent" compression, that is disabled if the `content-encoding` or `accept-encoding` header is present, we do not enable compression when `feign.okhttp.OkHttpClient` is present on the classpath and `spring.cloud.openfeign.okhttp.enabled` is set to `true`.
587586

587+
[[feign-logging]]
588588
=== Feign logging
589589

590590
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 `DEBUG` level.
@@ -616,10 +616,11 @@ public class FooConfiguration {
616616
}
617617
----
618618

619+
[[feign-capability-support]]
619620
=== Feign Capability support
620621

621622
The Feign capabilities expose core Feign components so that these components can be modified. For example, the capabilities can take the `Client`, _decorate_ it, and give the decorated instance back to Feign.
622-
The support for Micrometer is a good real-life example for this. See <<micrometer-support>>.
623+
The support for Micrometer is a good real-life example for this. See xref:spring-cloud-openfeign.adoc#micrometer-support[Micrometer Support].
623624

624625
Creating one or more `Capability` beans and placing them in a `@FeignClient` configuration lets you register them and modify the behavior of the involved client.
625626

@@ -634,6 +635,7 @@ public class FooConfiguration {
634635
}
635636
----
636637

638+
[[micrometer-support]]
637639
=== Micrometer Support
638640

639641
If all of the following conditions are true, a `MicrometerObservationCapability` bean is created and registered so that your Feign client is observable by Micrometer:
@@ -682,6 +684,7 @@ public class FooConfiguration {
682684
}
683685
----
684686

687+
[[feign-caching]]
685688
=== Feign Caching
686689

687690
If `@EnableCaching` annotation is used, a `CachingCapability` bean is created and registered so that your Feign client recognizes `@Cache*` annotations on its interface:
@@ -698,6 +701,7 @@ public interface DemoClient {
698701

699702
You can also disable the feature via property `spring.cloud.openfeign.cache.enabled=false`.
700703

704+
[[feign-querymap-support]]
701705
=== Feign @QueryMap support
702706

703707
Spring Cloud OpenFeign provides an equivalent `@SpringQueryMap` annotation, which
@@ -730,6 +734,7 @@ public interface DemoTemplate {
730734

731735
If you need more control over the generated query parameter map, you can implement a custom `QueryMapEncoder` bean.
732736

737+
[[hateoas-support]]
733738
=== HATEOAS support
734739

735740
Spring provides some APIs to create REST representations that follow the https://en.wikipedia.org/wiki/HATEOAS[HATEOAS] principle, https://spring.io/projects/spring-hateoas[Spring Hateoas] and https://spring.io/projects/spring-data-rest[Spring Data REST].
@@ -750,6 +755,7 @@ public interface DemoTemplate {
750755
}
751756
----
752757

758+
[[spring-matrixvariable-support]]
753759
=== Spring @MatrixVariable Support
754760

755761
Spring Cloud OpenFeign provides support for the Spring `@MatrixVariable` annotation.
@@ -780,6 +786,7 @@ public interface DemoTemplate {
780786
}
781787
----
782788

789+
[[feign-collectionformat-support]]
783790
=== Feign `CollectionFormat` support
784791
We support `feign.CollectionFormat` by providing the `@CollectionFormat` annotation.
785792
You can annotate a Feign client method (or the whole class to affect all methods) with it by passing the desired `feign.CollectionFormat` as annotation value.
@@ -798,11 +805,13 @@ protected interface DemoFeignClient {
798805
}
799806
----
800807

808+
[[reactive-support]]
801809
=== Reactive Support
802810
As the https://github.com/OpenFeign/feign[OpenFeign project] does not currently support reactive clients, such as https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/reactive/function/client/WebClient.html[Spring WebClient], neither does Spring Cloud OpenFeign.We will add support for it here as soon as it becomes available in the core project.
803811

804812
Until that is done, we recommend using https://github.com/Playtika/feign-reactive[feign-reactive] for Spring WebClient support.
805813

814+
[[early-initialization-errors]]
806815
==== Early Initialization Errors
807816

808817
Depending on how you are using your Feign clients you may see initialization errors when starting your application.
@@ -814,6 +823,7 @@ To work around this problem you can use an `ObjectProvider` when autowiring your
814823
ObjectProvider<TestFeignClient> testFeignClient;
815824
----
816825

826+
[[spring-data-support]]
817827
=== Spring Data Support
818828

819829
If Jackson Databind and Spring Data Commons are on the classpath, converters for `org.springframework.data.domain.Page` and `org.springframework.data.domain.Sort` will be added automatically.
@@ -826,12 +836,13 @@ spring.cloud.openfeign.autoconfiguration.jackson.enabled=false
826836

827837
See `org.springframework.cloud.openfeign.FeignAutoConfiguration.FeignJacksonConfiguration` for details.
828838

839+
[[spring-refreshscope-support]]
829840
=== Spring `@RefreshScope` Support
830841
If Feign client refresh is enabled, each Feign client is created with:
831842

832843
* `feign.Request.Options` as a refresh-scoped bean. This means properties such as `connectTimeout` and `readTimeout` can be refreshed against any Feign client instance.
833844
* A url wrapped under `org.springframework.cloud.openfeign.RefreshableUrl`. This means the URL of Feign client, if defined
834-
with `spring.cloud.openfeign.client.config.{feignName}.url` property, can be refreshed against any Feign client instance.
845+
with `spring.cloud.openfeign.client.config.\{feignName}.url` property, can be refreshed against any Feign client instance.
835846

836847
You can refresh these properties through `POST /actuator/refresh`.
837848

@@ -842,6 +853,7 @@ spring.cloud.openfeign.client.refresh-enabled=true
842853
----
843854
TIP: DO NOT annotate the `@FeignClient` interface with the `@RefreshScope` annotation.
844855

856+
[[oauth2-support]]
845857
=== OAuth2 Support
846858
OAuth2 support can be enabled by setting following flag:
847859
----
@@ -854,6 +866,7 @@ TIP:: Using the `serviceId` as OAuth2 client registrationId is convenient for lo
854866

855867
TIP:: If you do not want to use the default setup for the `OAuth2AuthorizedClientManager`, you can just instantiate a bean of this type in your configuration.
856868

869+
[[transform-the-load-balanced-http-request]]
857870
=== Transform the load-balanced HTTP request
858871

859872
You can use the selected `ServiceInstance` to transform the load-balanced HTTP Request.
@@ -881,6 +894,7 @@ For `Request`, you need to implement and define `LoadBalancerFeignRequestTransfo
881894
If multiple transformers are defined, they are applied in the order in which beans are defined.
882895
Alternatively, you can use `LoadBalancerFeignRequestTransformer.DEFAULT_ORDER` to specify the order.
883896

897+
[[x-forwarded-headers-support]]
884898
=== X-Forwarded Headers Support
885899

886900
`X-Forwarded-Host` and `X-Forwarded-Proto` support can be enabled by setting following flag:
@@ -890,6 +904,7 @@ Alternatively, you can use `LoadBalancerFeignRequestTransformer.DEFAULT_ORDER` t
890904
spring.cloud.loadbalancer.x-forwarded.enabled=true
891905
----
892906

907+
[[supported-ways-to-provide-url-to-a-feign-client]]
893908
=== Supported Ways To Provide URL To A Feign Client
894909
You can provide a URL to a Feign client in any of the following ways:
895910

@@ -919,9 +934,10 @@ The URL provided in the configuration properties remains unused.
919934

920935
|===
921936

937+
[[aot-and-native-image-support]]
922938
=== AOT and Native Image Support
923939

924-
Spring Cloud OpenFeign supports Spring AOT transformations and native images, however, only with refresh mode disabled, Feign clients refresh disabled (default setting) and <<attribute-resolution-mode,lazy `@FeignClient` attribute resolution>> disabled (default setting).
940+
Spring Cloud OpenFeign supports Spring AOT transformations and native images, however, only with refresh mode disabled, Feign clients refresh disabled (default setting) and xref:spring-cloud-openfeign.adoc#attribute-resolution-mode[lazy `@FeignClient` attribute resolution] disabled (default setting).
925941

926942
WARNING: If you want to run Spring Cloud OpenFeign clients in AOT or native image modes, make sure to set `spring.cloud.refresh.enabled` to `false`.
927943

@@ -931,6 +947,7 @@ TIP: If you want to run Spring Cloud OpenFeign clients in AOT or native image mo
931947

932948
TIP: However, if you set the `url` value via properties, it is possible to override the `@FeignClient` `url` value by running the image with `-Dspring.cloud.openfeign.client.config.[clientId].url=[url]` flag. In order to enable overriding, a `url` value also has to be set via properties and not `@FeignClient` attribute during buildtime.
933949

950+
[[configuration-properties]]
934951
== Configuration properties
935952

936953
To see the list of all Spring Cloud OpenFeign related configuration properties please check link:appendix.html[the Appendix page].
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:sc-ext: java
2+
:project-full-name: Spring Cloud OpenFeign
3+
:all: {asterisk}{asterisk}

0 commit comments

Comments
 (0)