Skip to content

Commit

Permalink
Merge pull request #1546 from Semernitskaya/fix_docs
Browse files Browse the repository at this point in the history
fix documentation for providing custom bean scenario
  • Loading branch information
fatroom authored Dec 6, 2023
2 parents 7061bc0 + 5a0fd0d commit 51d708c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions riptide-spring-boot-autoconfigure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,16 +575,26 @@ For every client that is defined in your configuration the following beans will
[![Client Dependency Graph](../docs/interceptors.png)](../docs/interceptors.png)

Every single bean in the graph can optionally be replaced by your own, custom version of it. Beans can only be
overridden by name, **not** by type. As an example, the following code would add XML support to the `example` client:
overridden by name, **not** by type. You can define bean name by using an appropriate method name or specify it explicitly via `@Bean(name = "...")`,
you cannot use `@Qualifier("...")` annotation since it doesn't change an actual bean name.
As an example, the following code would add XML support to the `example` client:

```java
@Bean
@Qualifier("example")
public ClientHttpMessageConverters exampleHttpMessageConverters() {
return new ClientHttpMessageConverters(singletonList(new Jaxb2RootElementHttpMessageConverter()));
}
```

The following code can be used if you cannot use your client name in the method name (e.g. your client name is `my-client`):
```java
@Bean(name = "my-clientCircuitBreakerExecutorService")
public ClientHttpMessageConverters httpMessageConverters() {
return new ClientHttpMessageConverters(singletonList(new Jaxb2RootElementHttpMessageConverter()));
}
```
As you can see, any method name can be used in the second example, since bean name is provided explicitly in the annotation.

The following table shows all beans with their respective name (for the `example` client) and type:

| Bean Name | Bean Type |
Expand Down

0 comments on commit 51d708c

Please sign in to comment.