Skip to content
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

Closed
javadevmtl opened this issue May 1, 2017 · 9 comments
Closed

--redeploy ignores -D system prooperties #1960

javadevmtl opened this issue May 1, 2017 · 9 comments

Comments

@javadevmtl
Copy link

javadevmtl commented May 1, 2017

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

if (systemProperties != null) {
      args.addAll(systemProperties.stream().map(s -> "-D" + s).collect(Collectors.toList()));
    }

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.

@cescoffier
Copy link
Contributor

It's because the redeploy use a forked process. To pass parameters to the application in redeploy mode, use --java-opts="-conf=... -Dfoo-bar

@javadevmtl
Copy link
Author

javadevmtl commented May 1, 2017

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 {
args = [
'run', mainVerticleName,
"--redeploy=$watchForChange",
"--launcher-class=$mainClassName",
"--java-opts=-Dfoo=bar",
"--on-redeploy=$doOnChange",
'-conf', 'src/main/conf/config.json'
]
}

@cescoffier
Copy link
Contributor

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.

@cescoffier
Copy link
Contributor

@javadevmtl can you review #1961 and tell me if it gives enough details?

@javadevmtl
Copy link
Author

Done.

@cescoffier
Copy link
Contributor

Thanks @javadevmtl !

@javadevmtl
Copy link
Author

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?

@cescoffier
Copy link
Contributor

cescoffier commented May 8, 2017 via email

@cescoffier
Copy link
Contributor

Fixed in #1961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants