googleapis / google-auth-library-java

Open source Auth client library for Java
https://developers.google.com/identity
BSD 3-Clause "New" or "Revised" License
409 stars 224 forks source link

Add reactor Bindings #1296

Open gkatzioura opened 1 year ago

gkatzioura commented 1 year ago

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

brianmaresca commented 1 year ago

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.

TimurSadykov commented 1 year ago

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

gkatzioura commented 1 year ago

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