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

[IDEA] Read properties from a "local" mirth.properties file after the default, stock mirth.properties file #5500

Open
ChristopherSchultz opened this issue Oct 29, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@ChristopherSchultz
Copy link
Contributor

Similar to #5436, upgrades are often a hassle when trying to migrate changes to mirth.properties in the old version to the new version. Most of the time, you only want to customize a few things (e.g. keystore password, database URL and credentials, etc.) and everything else should be left alone.

With everything in a single file, you have to basically read the whole file every time and re-apply all changes separately.

If there were another file e.g. mirth.local.properties that was read immediately after mirth.properties – allowing you to override any of the default settings – it would make upgrades easier, and possibly allow automation.

@ChristopherSchultz ChristopherSchultz added the enhancement New feature or request label Oct 29, 2022
@ChristopherSchultz
Copy link
Contributor Author

There are a number of places in the code wheremirth.properties is loaded. I would recommend having a utility method to "load the configuration" and have all those places call the unified "load configuration" method, which can then be expanded to load an extra configuration file.

@ChristopherSchultz
Copy link
Contributor Author

Maybe DefaultConfigurationController is already that place?

@ChristopherSchultz
Copy link
Contributor Author

Hmm. Mirth has code paths that appear to update the on-disk properties file which may make this request essentially impossible.

@NoraTheExplorer
Copy link

I like this idea. This would make migrations and updates much more comfortable.

@ChristopherSchultz
Copy link
Contributor Author

Based upon my previous comment, I was thinking (a) maybe I can just concatenate my "custom properties" onto mirth.properties and (b) any re-writing done by Mirth would just take that into account.

Unfortunately, what really happens is that Mirth re-writes the properties file and randomly re-orders the default and overridden properties so that you get a combination of default and overridden ones taking effect. They must be using line-by-line parsing of properties instead of just using Properties.load() which would normally just use last-one-read-wins semantics.

So I'm not really sure whether there are any options other than requesting a feature such as this directly from Mirth.

I guess that means "yeah, I still want this."

@pacmano1
Copy link
Collaborator

pacmano1 commented Nov 2, 2022

It's a great idea IMHO. Much like linux does include files for lots of services.

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

No branches or pull requests

3 participants