0

How feasible/practical is it to set system properties at runtime in production environments explicitly? What if there is a web service, that would update system properties - flags mainly. These flags in turn can be used to turn on/off the log-level etc.

The operation would be along these lines:

  1. Set up a web service in the live prod application
  2. access web service [restrict access to specific users] - this would present a UI that would update system properties
  3. application would use the updated system properties going forward

Any suggestion on this approach? Or is it already common occurrence?

0

2 Answers 2

1

I don't see why it wouldn't work, except if your application is clustered across several JVMs. In this case, you'd better store the configuration in a central database or propagate the change to all the other JVMs using a JMS topic, for example.

If you want to make these system properties persistent after a restart, you'd bette store them in a database as well.

Sign up to request clarification or add additional context in comments.

1 Comment

ah..clustering that was a miss....thanks for pointing that out. The idea is to make it dynamic, so persistence may not be the way out.
0

The idea makes some people cringe but does have some appeal... you could store your properties in svn or git and just send out "refresh your config" notifications to the servers via JMS Topic as JB Nizet suggests.

Some nice aspects:

  • all configuration becomes versioned and can be reverted (full edit history)
  • easy to maintain several versions and tell specific servers to "upgrade"
  • someone broke the config! ... svn blame theconfig.properties

The fact that times and names are associated with every edit can make a nice way to know whose cell phone to set on fire.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.