-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--redeploy ignores -D system prooperties #1960
Comments
It's because the redeploy use a forked process. To pass parameters to the application in redeploy mode, use |
Ok that works, maybe it can be mentioned in the redeployment docs? Btw -conf doesn't need to be part --java-opts This works... run { |
You are absolutely right. I was pretty sure it was documented, about a closer look just broken my "dreams". Gonna open a PR immediately. Please keep this issue open as I'm going to use it to track progress. |
@javadevmtl can you review #1961 and tell me if it gives enough details? |
Done. |
Thanks @javadevmtl ! |
Just curious. There's a main java process that receives the properties and then forks a process. Can those properties not be passed to it instead of using --java-opts? |
On 8 May 2017, at 15:16, javadevmtl ***@***.***> wrote:
Just curious. There's a main java process that receives the properties and then forks a process. Can those properties not be passed to it instead of using --java-opts?
It’s hard to find which properties need to be passed to the child process. However, system properties passed using -D (as command line parameter, so after the “run” command) should be propagated to the child process.
For instance:
```
java -cp target/hello-1.0-SNAPSHOT.jar io.vertx.hello.MyLauncher run io.vertx.hello.HelloVerticle --redeploy="src/main/java/**/*" -DPROP="hello" --conf=conf.json ….
```
This command propagates the `conf` param and the `PROP` system property to the child process.
However, this won’t work:
java -DPROP=“hello” -cp target/hello-1.0-SNAPSHOT.jar io.vertx.hello.MyLauncher run io.vertx.hello.HelloVerticle --redeploy="src/main/java/**/*" -DPROP="hello" --conf=conf.json ….
… —
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#1960 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAYjfTm9T4Q6WHScbJI_lG-SdYkBO3iNks5r3xWZgaJpZM4NNO_m>.
|
Fixed in #1961 |
Using vertx 3.4.1 see my thread here: https://groups.google.com/forum/?fromgroups=#!topic/vertx/fjlsWFqMiJk
I looked around: https://github.com/eclipse/vert.x/blob/65a1050b0922de38329cdbe90c5ecd8094a93a04/src/main/java/io/vertx/core/impl/launcher/commands/RunCommand.java
If I understand it correctly...
If --redeploy then initializeRedeployment() which calls startAsBackgroundApplication
There's a check here
But It seems that the properties are null at this point...
Calling System.getProperties().list(System.out); in our own verticle the passed in -D properties are gone only the java one show up. Removing --redeploy everything works as expected.
The text was updated successfully, but these errors were encountered: