Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detected use of the reactive Session from a different Thread than the one which was used to open the reactive Session - this suggests an invalid integration; original thread [151]: 'vert.x-eventloop-thread-5' current Thread [553]: 'sdk-async-response-6-0' #373

Closed
paomian opened this issue Nov 16, 2022 · 5 comments
Labels
enhancement New feature or request never stale

Comments

@paomian
Copy link

paomian commented Nov 16, 2022

use ses send email after query some in reactive env will cause this error

@Singleton
public class AWSEmailService implements EmailService {
  @Inject SesAsyncClient sesAsyncClient;

  @Override
  public Uni<Boolean> sendMail(String email, String subject, String content) {
    var body = Templates.welcome(content).render();
    var x =
        sesAsyncClient.sendEmail(
            req ->
                req.source("[email protected]")
                    .destination(d -> d.toAddresses(email))
                    .message(
                        msg ->
                            msg.subject(subj -> subj.data("subject"))
                                .body(b -> b.html(html -> html.data(body)))));
    return Uni.createFrom()
        .completionStage(x)
        .onItem()
        .transform(sendEmailResponse -> sendEmailResponse.sdkHttpResponse().isSuccessful());
  }
}
  @GET
  @Path("/gaga")
  @ReactiveTransactional
  public Uni<Boolean> gagaga() {
    return Uni.createFrom()
        .item("[email protected]")
        .flatMap(email -> awsEmailService.sendMail(email, "test", "test"));
  }

will cause this error

@paomian
Copy link
Author

paomian commented Nov 16, 2022

maybe related quarkusio/quarkus#23324

@paomian
Copy link
Author

paomian commented Nov 17, 2022

Maybe not same issue.
It seems to sesAsyncClient have they own executor.
So how do i set sesAsyncClient use the executor which quarkus used?

@paomian
Copy link
Author

paomian commented Nov 17, 2022

It's a problem about @ReactiveTransactional
It will check thread when commit i guess.

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label May 17, 2023
@scrocquesel scrocquesel added enhancement New feature or request never stale and removed stale labels May 19, 2023
@scrocquesel
Copy link
Member

Closing as I guess it's not related to this extension. and is a general issue with the quarkus annotation ReactiveTransactional. This may have been fixed. Open an issue at quarkus if it's still happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request never stale
Projects
None yet
Development

No branches or pull requests

2 participants