Skip to content

Commit

Permalink
Reinitialize ActiveMQ IdGenerator at runtime to ensure generated id u…
Browse files Browse the repository at this point in the history
…niqueness

Fixes #3807
  • Loading branch information
jamesnetherton committed May 24, 2022
1 parent 1b15891 commit f117bde
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem;
import org.apache.activemq.util.IdGenerator;

class ActiveMQProcessor {

Expand Down Expand Up @@ -88,6 +90,11 @@ void registerServiceProviders(BuildProducer<ReflectiveClassBuildItem> reflective
nativeImage.produce(new NativeImageResourceBuildItem(servicePaths));
}

@BuildStep
void runtimeReinitializedClasses(BuildProducer<RuntimeReinitializedClassBuildItem> runtimeReInitializedClass) {
runtimeReInitializedClass.produce(new RuntimeReinitializedClassBuildItem(IdGenerator.class.getName()));
}

private String getServiceClass(String servicePath) {
try (InputStream resource = ActiveMQProcessor.class.getClassLoader().getResourceAsStream(servicePath)) {
Properties properties = new Properties();
Expand Down

0 comments on commit f117bde

Please sign in to comment.