google-auth-library-java icon indicating copy to clipboard operation
google-auth-library-java copied to clipboard

Add reactor Bindings

Open gkatzioura opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. In order to integrate with reactive apps, you have to either execute blocking calls using Mono.fromCallable or create an implementation based on WebClient.

Describe the solution you'd like A reactive binding of google-auth-library based on WebClient. The implementation would be re-usable for other cloud component's apis. The authentication token generation and the api call creation could be used to make more functionalities reactive.

Describe alternatives you've considered quarkus

Additional context This is related to an issue and PR on the spring-cloud-gcp projec https://github.com/GoogleCloudPlatform/spring-cloud-gcp/issues/2027 https://github.com/GoogleCloudPlatform/spring-cloud-gcp/pull/2028

gkatzioura avatar Oct 05 '23 06:10 gkatzioura

Figured I would add this to further emphasize how valuable I believe this issue/request is. From the cloud run docs https://cloud.google.com/run/docs/tips/java#write_non-blocking_reactive_code_to_optimize_memory_and_startup: To truly reduce the number of threads, consider adopting a non-blocking reactive programming model, so that the number of threads can be significantly reduced while handling more concurrent requests. Application frameworks like Spring Boot with Webflux, Micronaut, and Quarkus support reactive web applications.

This is ironic to me - the docs themselves suggest using reactive code yet there is very little reactive support across the java google libraries.

brianmaresca avatar Oct 05 '23 19:10 brianmaresca

@gkatzioura @brianmaresca Thanks for raising the issue and proposal. We will take a look.

TimurSadykov avatar Oct 05 '23 23:10 TimurSadykov

Relevant pr https://github.com/googleapis/google-auth-library-java/pull/1297

gkatzioura avatar Oct 06 '23 08:10 gkatzioura