-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add file with implicit call to blocking method
Reproducer for this fix: quarkusio/quarkus#40721
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
http/rest-client-reactive/src/main/java/com/redhat/BrokenBlockingApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.redhat; // this bug can not be reproduced in io.io.quarkus package | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
import io.quarkus.rest.client.reactive.ClientExceptionMapper; | ||
import io.smallrye.common.annotation.Blocking; | ||
|
||
@RegisterRestClient | ||
public interface BrokenBlockingApi { | ||
@GET | ||
@Path("/") | ||
String request(); | ||
|
||
@Blocking | ||
@ClientExceptionMapper | ||
static RuntimeException toException(Response response) { | ||
String entity = response.readEntity(String.class).isEmpty() | ||
? response.getStatusInfo().getReasonPhrase() | ||
: response.readEntity(String.class); | ||
return new RuntimeException(entity); | ||
} | ||
} |