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

Support for environment Variables in quartz.properties and/or job.xml's #963

Open
CxVercility opened this issue Sep 19, 2023 · 2 comments
Open

Comments

@CxVercility
Copy link

CxVercility commented Sep 19, 2023

Hi there,
I was wondering if it was possible to add support for environment variables in said files. (i havent found a way to do so, if there actually is one please enlighten me, the @ syntax seems to only work for variables of the properties files itself)

The specific use case for me is that I need to specify URL Targets and cron-expressions according to the system my scheduler is running on.

My current solution is to dynamically set the xml' fileName by overriding XMLSchedulingDataProcessorPlugin.initialize

public void initialize(String name, Scheduler scheduler, ClassLoadHelper schedulerFactoryClassLoadHelper) throws SchedulerException {
        String stage = System.getenv("ENV");
        this.setFileNames(stage + ".xml");
        super.initialize(name, scheduler, schedulerFactoryClassLoadHelper);
    }

This however still means that I need to provide 4 XML's which is kinda whack and also prevents me from maintaining these in the helm chart of my image.

I'd be happy to provide the code changes in a PR myself, if i can get confirmation that it would be accepted.
Greets

@jhouserizer
Copy link
Contributor

Seems reasonable to support.

@bcode2
Copy link
Contributor

bcode2 commented Oct 25, 2024

Why not loading the cron-expressions, job group, name, etc directly from the database?. This is how I currently do it

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

No branches or pull requests

3 participants