Change http root-path of a quarkus application in runtime

Viewed 538

Is it possible to set the root-path of a Quarkus service in runtime?

When I set quarkus.http.root-path in runtime I see the following error:

[io.qua.run.ConfigChangeRecorder] (main) Build time property cannot be changed at runtime. quarkus.http.root-path was /{old-context-path} at build time and is now /{new-context-path}

1 Answers

Changing the root path of a running application is impossible, or at least hard to do. Using Vert.x, it would be possible but that requires some coordination since you would need to deploy/undeploy components (Verticles) in the runtime.

What you still can do: Start another instance (process) of your Quarkus application with the new root path (for example -Dquarkus.http.root-path=<newroot>), then shutdown the existing instance.

This will, however, make the old root path unavailable to all clients which rely on it.

Related