Skip to content

Commit

Permalink
Delay FT class init at runtime so CP is initialised
Browse files Browse the repository at this point in the history
  • Loading branch information
FroMage committed Apr 9, 2024
1 parent ad06f24 commit b9cc3c2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.deployment.metrics.MetricsCapabilityBuildItem;
import io.quarkus.deployment.recording.RecorderContext;
Expand Down Expand Up @@ -87,14 +88,17 @@ public void build(BuildProducer<AnnotationsTransformerBuildItem> annotationsTran
CombinedIndexBuildItem combinedIndexBuildItem,
BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<ReflectiveMethodBuildItem> reflectiveMethod,
BuildProducer<RunTimeConfigurationDefaultBuildItem> config) {
BuildProducer<RunTimeConfigurationDefaultBuildItem> config,
BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitializedClassBuildItems) {

feature.produce(new FeatureBuildItem(Feature.SMALLRYE_FAULT_TOLERANCE));

serviceProvider.produce(new ServiceProviderBuildItem(RequestContextControllerProvider.class.getName(),
ContextPropagationRequestContextControllerProvider.class.getName()));
serviceProvider.produce(new ServiceProviderBuildItem(RunnableWrapper.class.getName(),
ContextPropagationRunnableWrapper.class.getName()));
// make sure this is initialised at runtime, otherwise it will get a non-initialised ContextPropagationManager
runtimeInitializedClassBuildItems.produce(new RuntimeInitializedClassBuildItem(RunnableWrapper.class.getName()));

IndexView index = combinedIndexBuildItem.getIndex();

Expand Down

0 comments on commit b9cc3c2

Please sign in to comment.