Spring / Spring CredHub Interview questions
How do you enable reactive support in Spring CredHub?
Add spring-boot-starter-webflux to the project alongside the existing spring-credhub-starter dependency:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </dependency>
With WebFlux on the classpath, Spring CredHub's auto-configuration additionally registers a ReactiveCredHubOperations bean, backed by ReactiveCredHubTemplate, using the same spring.credhub.* properties that configure the blocking client — there's no separate reactive-specific configuration to add.
An app can then inject ReactiveCredHubOperations instead of CredHubOperations wherever it wants non-blocking calls, and both beans can coexist if some parts of the app are still using blocking code.
Nothing about spring.credhub.url or the authentication properties changes when reactive support is added — the same mutual TLS or OAuth2 setup that authenticates CredHubTemplate also authenticates ReactiveCredHubTemplate, since both are built from the same underlying properties at auto-configuration time.
More Related questions...