From 1c4942632bca4cbe4166af41bd702ee10cfac490 Mon Sep 17 00:00:00 2001 From: Olga Semernitskaia Date: Tue, 5 Dec 2023 17:50:42 +0200 Subject: [PATCH 1/5] fix documentation for providing custom bean scenario --- riptide-spring-boot-autoconfigure/README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/riptide-spring-boot-autoconfigure/README.md b/riptide-spring-boot-autoconfigure/README.md index 806d8ccdf..0a5b809fb 100644 --- a/riptide-spring-boot-autoconfigure/README.md +++ b/riptide-spring-boot-autoconfigure/README.md @@ -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`): +@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 case. + The following table shows all beans with their respective name (for the `example` client) and type: | Bean Name | Bean Type | From 2194c68fec6161de9ec9f6a262421e3a94e0fa01 Mon Sep 17 00:00:00 2001 From: Olga Semernitskaia Date: Tue, 5 Dec 2023 18:03:47 +0200 Subject: [PATCH 2/5] fix documentation for providing custom bean scenario --- riptide-spring-boot-autoconfigure/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riptide-spring-boot-autoconfigure/README.md b/riptide-spring-boot-autoconfigure/README.md index 0a5b809fb..0e680f2ea 100644 --- a/riptide-spring-boot-autoconfigure/README.md +++ b/riptide-spring-boot-autoconfigure/README.md @@ -586,13 +586,13 @@ public ClientHttpMessageConverters exampleHttpMessageConverters() { } ``` -The following code can be used if cannot use your client name in the method name (e.g. your client name is `my-client`): +The following code can be used if your client name cannot be used in the method name (e.g. your client name is `my-client`): @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 case. +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: From c0b2a837d72f17a5c9945ec146673346f62f5c79 Mon Sep 17 00:00:00 2001 From: Olga Semernitskaia Date: Tue, 5 Dec 2023 18:05:32 +0200 Subject: [PATCH 3/5] fix documentation for providing custom bean scenario --- riptide-spring-boot-autoconfigure/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riptide-spring-boot-autoconfigure/README.md b/riptide-spring-boot-autoconfigure/README.md index 0e680f2ea..6b6959a7c 100644 --- a/riptide-spring-boot-autoconfigure/README.md +++ b/riptide-spring-boot-autoconfigure/README.md @@ -586,7 +586,7 @@ public ClientHttpMessageConverters exampleHttpMessageConverters() { } ``` -The following code can be used if your client name cannot be used in the method name (e.g. your client name is `my-client`): +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`): @Bean(name = "my-clientCircuitBreakerExecutorService") public ClientHttpMessageConverters httpMessageConverters() { return new ClientHttpMessageConverters(singletonList(new Jaxb2RootElementHttpMessageConverter())); From 1fc8b8b6f7e04be11b18cb91480a755462562506 Mon Sep 17 00:00:00 2001 From: Olga Semernitskaia Date: Tue, 5 Dec 2023 18:23:55 +0200 Subject: [PATCH 4/5] fix documentation for providing custom bean scenario --- riptide-spring-boot-autoconfigure/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/riptide-spring-boot-autoconfigure/README.md b/riptide-spring-boot-autoconfigure/README.md index 6b6959a7c..b22bd441e 100644 --- a/riptide-spring-boot-autoconfigure/README.md +++ b/riptide-spring-boot-autoconfigure/README.md @@ -587,6 +587,7 @@ public ClientHttpMessageConverters exampleHttpMessageConverters() { ``` 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`): +``` @Bean(name = "my-clientCircuitBreakerExecutorService") public ClientHttpMessageConverters httpMessageConverters() { return new ClientHttpMessageConverters(singletonList(new Jaxb2RootElementHttpMessageConverter())); From 9c5ba6d60517216734d3a26707287c36ca2ef514 Mon Sep 17 00:00:00 2001 From: Roman Romanchuk Date: Tue, 5 Dec 2023 18:02:00 +0100 Subject: [PATCH 5/5] Update riptide-spring-boot-autoconfigure/README.md --- riptide-spring-boot-autoconfigure/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riptide-spring-boot-autoconfigure/README.md b/riptide-spring-boot-autoconfigure/README.md index b22bd441e..bbf38c671 100644 --- a/riptide-spring-boot-autoconfigure/README.md +++ b/riptide-spring-boot-autoconfigure/README.md @@ -587,7 +587,7 @@ public ClientHttpMessageConverters exampleHttpMessageConverters() { ``` 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()));