autosleep icon indicating copy to clipboard operation
autosleep copied to clipboard

Sample manifest uses env vs JAVA_OPTS in demo video

Open drnic opened this issue 9 years ago • 2 comments

In the demo video, the manifest.tmpl.yml specifies all the properties via JAVA_OPTS:

screen shot 2017-01-08 at 3 05 18 pm

But in the https://github.com/cloudfoundry-community/autosleep/blob/develop/manifest.tmpl.yml the configuration is via env variables.

Is this either/or? Or is JAVA_OPTS preferred?

If we change configuration, do we cf restart or cf restage?

drnic avatar Jan 08 '17 23:01 drnic

I guess the manifest was updated to not use the JAVA_OPTS after the cf summit demo. It would be better to stick to the env variables rather than the JAVA_OPTS variable. However, both work for me.

pradyutsarma avatar Jan 09 '17 07:01 pradyutsarma

@drnic

See related background on why we originally tried to avoid the . syntax in https://github.com/cloudfoundry-community/autosleep/pull/270#issuecomment-272848089

The JAVA_OPTS option allowed to still use the dot syntax (which allow for convenient copy/paste between the spring java source code and documentation), and not convert it to the snake case format (with underscores as separators).

Is this either/or? Or is JAVA_OPTS preferred?

I'd suggest to pick one of the syntax and stick to it.

There is a spring precedence order documented at https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-external-config (JAVA_OPTS is converted by java buildpack into JVM arguments which with the -D prefix translate into java system properties)

If we change configuration, do we cf restart or cf restage?

As any environment variables changes in CF, you have to restage. This may be optimized with restart only so speed up, I'm not sure (not specific to autosleep though).

gberche-orange avatar Jan 16 '17 12:01 gberche-orange