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 custom startup parameters for extensions #2579

Open
tomakehurst opened this issue Jan 16, 2024 · 5 comments
Open

Support custom startup parameters for extensions #2579

tomakehurst opened this issue Jan 16, 2024 · 5 comments

Comments

@tomakehurst
Copy link
Member

Proposal

Allow extensions to register and consume their own startup configuration options so that e.g. WireMock standalone can be started with extra parameters like --my-extension-parameter=123

e.g. we could add an extra method to the Extension interface like:

List<OptionDefinition> getCustomStartupOptions();

And one to Options for retrieval:

Optional<OptionValue> getOptionValue(String key);

This should build on top of #2578.

References

No response

@tomakehurst
Copy link
Member Author

@dirkbolte as we discussed last week

@dirkbolte
Copy link
Contributor

Can/should we scope them to avoid conflicts between different extensions/wiremock core? Thinking about adapting something like spring's externalized configuration: --extensions.<extensionName>.<parameter>=<value> . Same scheme could also be stored in a properties/yaml/json file.

@tomakehurst
Copy link
Member Author

I've wondered about that, then wondered if it's overkill. Not sure how likely it is that collisions will occur, but maybe I'm lacking imagination...

@dirkbolte
Copy link
Contributor

My hope would be that this would not bloat the whole topic when it's added now - while it would be a breaking change when added later. If there would be at any time two extensions with conflicts, there's practically no way for a user to mitigate it and neither for the extension developers to adapt it with another breaking change.

I can imagine one use case where we might run into conflicts relatively fast: when having extensions for subsystems like Store. I can assume that the parameters for stores might be very similar (timings, URLs, credentials).

I would hope that users are very familiar with this notation, so this should hopefully not cause any usage issues.

@tomakehurst
Copy link
Member Author

OK, agree playing it safe might be a good idea. How about just --ext.<extensionName>.<parameter>=<value> so it's not quite as many keystrokes?

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

2 participants