Reactive Claims injection? keeps throwing blocking errors :( #33068
Answered
by
Ladicek
NinekoTheCat
asked this question in
Q&A
-
The current thread cannot be blocked: vert.x-eventloop-thread-2 it for some reason isn't reactive? I don't understand @Path("/hoard/items")
@RequestScoped
public class HoardItems {
@Inject
LoginHelper loginHelper;
@Inject
@Claim(standard = Claims.sub)
String openUserId;
@Inject
@Claim(standard = Claims.upn)
String userName;
@Inject
HoardItemService hoardItemService;
@GET
@Authenticated
public Uni<List<HoardItemId>> list() {
return Uni.createFrom().emitter(uniEmitter -> {
List<HoardItemId> items = loginHelper.loginUser(userName, openUserId)
.onItem()
.transformToUni(hoardItemService::getHoardItemsForUser)
.await()
.indefinitely();
uniEmitter.complete(items);
});
}
} @ApplicationScoped
public class LoginHelper {
@Inject
UserService service;
public Uni<UserId> loginUser(@NonNull String userName, @NonNull String openUserId) {
return service.login(User
.builder()
.id(UserId.builder().openid(openUserId).build())
.username(userName)
.build());
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
Ladicek
May 3, 2023
Replies: 2 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
This has nothing to do with ArC, removing the label. The public Uni<List<HoardItemId>> list() {
return loginHelper.loginUser(userName, openUserId)
.flatMap(hoardItemService::getHoardItemsForUser);
} ? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's likely some other blocking operation down there, then. All the code shown above seems to refer to your own classes, so can't really help, sorry.