Skip to content

Commit

Permalink
RESTEasy Reactive thread fixes
Browse files Browse the repository at this point in the history
Relates to quarkusio#18977

There are still issues though, as the vert.x pool is not enforcing
affinity.
  • Loading branch information
stuartwdouglas committed Aug 5, 2021
1 parent bf3fdd0 commit eb009f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void handle(Throwable event) {
future.onSuccess(new Handler<HttpClientRequest>() {
@Override
public void handle(HttpClientRequest httpClientRequest) {
requestContext.setHttpClientRequest(httpClientRequest);
Future<HttpClientResponse> sent;
if (requestContext.isMultipart()) {
Promise<HttpClientRequest> requestPromise = Promise.promise();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.net.impl.ConnectionBase;
import io.vertx.ext.web.multipart.MultipartForm;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -154,6 +156,17 @@ public ClientResponseContextImpl getOrCreateClientResponseContext() {
return clientResponseContext;
}

@Override
protected Executor getContextExecutor() {
if (httpClientRequest != null) {
return ((ConnectionBase) httpClientRequest.connection()).getContext().nettyEventLoop();
}
if (Context.isOnEventLoopThread()) {
return ((ContextInternal) restClient.getVertx().getOrCreateContext()).nettyEventLoop();
}
return null;
}

public ClientRequestContextImpl getOrCreateClientRequestContext() {
if (clientRequestContext == null) {
clientRequestContext = new ClientRequestContextImpl(this, this.getRestClient(), this.getConfiguration());
Expand Down

0 comments on commit eb009f3

Please sign in to comment.