forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#24134 from cescoffier/rest-client-captur…
…e-and-propagate-context Properly captures and restores the vert.x context in the reactive REST Client
- Loading branch information
Showing
11 changed files
with
93 additions
and
37 deletions.
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
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
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
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
15 changes: 15 additions & 0 deletions
15
...ain/java/org/jboss/resteasy/reactive/client/spi/ResteasyReactiveClientRequestContext.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 |
---|---|---|
@@ -1,12 +1,27 @@ | ||
package org.jboss.resteasy.reactive.client.spi; | ||
|
||
import io.vertx.core.Context; | ||
import javax.ws.rs.client.ClientRequestContext; | ||
|
||
public interface ResteasyReactiveClientRequestContext extends ClientRequestContext { | ||
|
||
/** | ||
* The property used to store the (duplicated) vert.x context with the request. | ||
* This context is captured when the ResteasyReactiveClientRequestContext instance is created. | ||
* If, at that moment, there is no context, a new duplicated context is created. | ||
* If, we are executed on a root context, it creates a new duplicated context from it. | ||
* Otherwise, (we are already on a duplicated context), it captures it. | ||
*/ | ||
String VERTX_CONTEXT_PROPERTY = "__context"; | ||
|
||
void suspend(); | ||
|
||
void resume(); | ||
|
||
void resume(Throwable t); | ||
|
||
/** | ||
* @return the captured or created duplicated context. See {@link #VERTX_CONTEXT_PROPERTY} for details. | ||
*/ | ||
Context getContext(); | ||
} |
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
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