Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix documentation for providing custom bean scenario #1546

Merged
merged 6 commits into from
Dec 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions riptide-spring-boot-autoconfigure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,16 +575,25 @@ 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 cannot use your client name in the method name (e.g. your client name is `my-client`):
fatroom marked this conversation as resolved.
Show resolved Hide resolved
@Bean(name = "my-clientCircuitBreakerExecutorService")
fatroom marked this conversation as resolved.
Show resolved Hide resolved
public ClientHttpMessageConverters httpMessageConverters() {
return new ClientHttpMessageConverters(singletonList(new Jaxb2RootElementHttpMessageConverter()));
}
```
As you can see, any method name can be used in the second case.

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

| Bean Name | Bean Type |
Expand Down
Loading