Skip to content

Using async implementation with CxfMutinyUtils.toUni result in using an executor thread downstream #1820

@s4iko

Description

@s4iko

Hello,

I use the implementation recommended in the documentation:

CxfMutinyUtils.<MyResponse>toUni(handler -> soapService.get(myRequest, handler))

The following code is executed on an executor thread (probably the one used by CXF) even if it is called from an eventloop thread.
This may fails the reactive stream if some code downstream need an eventloop thread (for example, Hibernate Reactive or Smallrye Reactive Messaging).

I use the following workaround, it seems to fix the issue:

CxfMutinyUtils.<MyResponse>toUni(handler -> soapService.get(myRequest, handler))
.emitOn(MutinyHelper.executor(vertx.getOrCreateContext()))

but it is still a bit annoying and may be difficult to spot and fix.

May it be possible to move back to the original thread by default or is there any reason for this ?

Thanks.

Quarkus: 3.22.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions