forked from quarkiverse/quarkus-cxf
-
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.
Context propagation not working in async calls fix quarkiverse#947
- Loading branch information
Showing
22 changed files
with
653 additions
and
7 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
23 changes: 23 additions & 0 deletions
23
...ions/core/deployment/src/main/java/io/quarkiverse/cxf/deployment/RuntimeBusBuildItem.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,23 @@ | ||
package io.quarkiverse.cxf.deployment; | ||
|
||
import org.apache.cxf.Bus; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
import io.quarkus.runtime.RuntimeValue; | ||
|
||
/** | ||
* Holds the runtime {@link Bus} reference. | ||
*/ | ||
public final class RuntimeBusBuildItem extends SimpleBuildItem { | ||
private final RuntimeValue<Bus> bus; | ||
|
||
public RuntimeValue<Bus> getBus() { | ||
return bus; | ||
} | ||
|
||
public RuntimeBusBuildItem(RuntimeValue<Bus> bus) { | ||
super(); | ||
this.bus = bus; | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...deployment/src/main/java/io/quarkiverse/cxf/deployment/RuntimeBusCustomizerBuildItem.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,25 @@ | ||
package io.quarkiverse.cxf.deployment; | ||
|
||
import java.util.function.Consumer; | ||
|
||
import org.apache.cxf.Bus; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
import io.quarkus.runtime.RuntimeValue; | ||
|
||
/** | ||
* Holds a {@link Consumer} that will be used to customize the runtime {@link Bus} right after its creation. | ||
*/ | ||
public final class RuntimeBusCustomizerBuildItem extends MultiBuildItem { | ||
private final RuntimeValue<Consumer<Bus>> customizer; | ||
|
||
public RuntimeBusCustomizerBuildItem(RuntimeValue<Consumer<Bus>> customizer) { | ||
super(); | ||
this.customizer = customizer; | ||
} | ||
|
||
public RuntimeValue<Consumer<Bus>> getCustomizer() { | ||
return customizer; | ||
} | ||
|
||
} |
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
30 changes: 30 additions & 0 deletions
30
...rts-http-hc5/runtime/src/main/java/io/quarkiverse/cxf/transport/http/hc5/Hc5Recorder.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,30 @@ | ||
package io.quarkiverse.cxf.transport.http.hc5; | ||
|
||
import java.util.function.Consumer; | ||
|
||
import org.apache.cxf.Bus; | ||
import org.apache.cxf.transport.http.HTTPConduitFactory; | ||
import org.apache.cxf.workqueue.WorkQueueManager; | ||
|
||
import io.quarkus.runtime.RuntimeValue; | ||
import io.quarkus.runtime.annotations.Recorder; | ||
|
||
@Recorder | ||
public class Hc5Recorder { | ||
|
||
/** | ||
* Customize the runtime {@link Bus} by adding a custom work queue for {@code http-conduit} and a custom | ||
* {@link HTTPConduitFactory}. Both are there to enable context propagation for async clients. | ||
* | ||
* @return a new {@link RuntimeValue} holding a {@link Consumer} to customize the runtime {@link Bus} | ||
*/ | ||
public RuntimeValue<Consumer<Bus>> customizeBus() { | ||
|
||
return new RuntimeValue<>(bus -> { | ||
final WorkQueueManager wqm = bus.getExtension(WorkQueueManager.class); | ||
wqm.addNamedWorkQueue("http-conduit", new QuarkusWorkQueueImpl("http-conduit")); | ||
|
||
bus.setExtension(new QuarkusAsyncHTTPConduitFactory(bus), HTTPConduitFactory.class); | ||
}); | ||
} | ||
} |
Oops, something went wrong.