AtomicReference for Multi Stream #852
Unanswered
stefanwendelmann
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Does your code work? (you did not mention that). Quick remark: .onItem().transformToUni( userSetting ->
Uni.createFrom().item(userSetting.getKeycloakId())
.onItem().transformToUni(uid -> keycloakAdminService.getUserInfo(uid)) Why do you create an intermediate .onItem().transformToUni(userSettings -> keycloakAdminService.getUserInfo(userSettings.getKeycloakId()) Note that I have no idea if the Keycloack APIs you are using are blocking or not. If they are blocking you might use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey together 😊,
i am new to reactive programming and new to mutiny so pls be gentle.
First i would like to thank the mutiny team for the good work and @cescoffier for the good presentations on yt and so on.
I am working on a API build on Quarkus (2.7.1) where i strictly go the reactive route.
What i need to do is to write a scheduled method wich reads all UserSettings for the DB and check Keycloak if there was any change to the Users Email, then write the Email back to the mongo.
Since there is no Support for co-existing
quarkus-keycloak-admin-client
andquarkus-rest-client-reactive
(see quarkusio/quarkus#20505 ) i needed to use the bare Keycloak Admin REST API with thequarkus-rest-client-reactive
.My Problem is, that i first need to get a Service Access Token (SAT) and then use this token for all requests on the User Details.
Problem: But the token gets recreated for each request, which is imho not that performat.
My approach was to use
.onFailure().
if the token is not valid, recreate it and try it again, because the failure of the 401 lead to it.My Code:
SettingsService.java
KEycloakAdminService.java
Beta Was this translation helpful? Give feedback.
All reactions