Spring / Spring CredHub Interview questions
What is the difference between CredHubOperations and ReactiveCredHubOperations?
Both expose the same shape of API — credentials(), permissions(), permissionsV2(), certificates(), interpolation(), info() — but their return types and underlying HTTP client differ completely.
CredHubOperations methods return values directly and block the calling thread, backed by CredHubTemplate using a RestTemplate; its escape hatch for custom calls is doWithRest(RestOperationsCallback). ReactiveCredHubOperations methods return Mono/Flux publishers and never block, backed by ReactiveCredHubTemplate using a WebClient; its escape hatch is doWithWebClient(...).
Which one to inject depends on the rest of the application: a traditional Spring MVC service should use CredHubOperations, while a WebFlux app already built around reactive pipelines should use ReactiveCredHubOperations so a blocking CredHub call doesn't tie up an event-loop thread.
More Related questions...