forked from quarkus-qe/quarkus-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cover bug with rest client hanging on malformed chunks
- Loading branch information
Showing
5 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
...client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/MalformedClient.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,24 @@ | ||
package io.quarkus.ts.http.restclient.reactive; | ||
|
||
import static java.time.temporal.ChronoUnit.SECONDS; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
import org.eclipse.microprofile.faulttolerance.Timeout; | ||
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
@RegisterRestClient | ||
@Path("/malformed") | ||
@RegisterClientHeaders | ||
@Timeout(value = 5, unit = SECONDS) | ||
public interface MalformedClient { | ||
|
||
@GET | ||
@Path("/") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
String get(); | ||
} |
26 changes: 26 additions & 0 deletions
26
...c/main/java/io/quarkus/ts/http/restclient/reactive/resources/MalformedClientResource.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 io.quarkus.ts.http.restclient.reactive.resources; | ||
|
||
import jakarta.inject.Inject; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
|
||
import org.eclipse.microprofile.rest.client.inject.RestClient; | ||
|
||
import io.quarkus.ts.http.restclient.reactive.MalformedClient; | ||
|
||
@Path("/client/malformed") | ||
public class MalformedClientResource { | ||
@Inject | ||
@RestClient | ||
MalformedClient client; | ||
|
||
@GET | ||
@Path("/") | ||
public String getMalformed() { | ||
try { | ||
return client.get(); | ||
} catch (Exception ex) { | ||
return ex.getClass().getName(); | ||
} | ||
} | ||
} |
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
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