-
Notifications
You must be signed in to change notification settings - Fork 103
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 multiple config files #84
Comments
I am not sure if you saw (which also may not be super explicit), but the main config file can refer to other files: https://github.com/azagniotov/stubby4j#file . That said, i can see how pointing |
Now that you pointed out, I see the line above. However. it is not clear at all how to do this "split". |
I will rephrase the documentation as it is indeed not clear. The idea of
I will try to clarify the above In general, I do like the idea of pointing |
I see. We can have both. If |
Btw, you can have a look at: https://github.com/azagniotov/stubby4j/blob/master/README.md#file & https://github.com/azagniotov/stubby4j/blob/master/README.md#file-1 I tried to clarify a little the supported split concept. |
Looks good to me, although it's not the same thing as I ask for in this ticket. One thing though - you may want to mention that the |
The Yes, it is not the same thing as you asked: making a |
I already implemented this behavior so can easily make a PR. However, if we go down the route as I propose in #85 (comment), it may change how the server is started. |
I think, we can take small steps and improve incrementally. For now, feel free to export a PR with an implemented behavior, without addressing the idea in #85 (comment) (for now). Thoughts? |
Sounds good. The refactor I proposed is major, so if I get to it, I can always submit a PR for further review and discussion. |
@asarkar Regarding this big refactoring, let's think about it a little more. I would not want you to spend time on something which takes a lot of effort/time, but does not have a pressing urgency. |
That said, of course I really appreciate your good intent! |
I understand, and it’s not like I’m looking to do things to waste my time. That said, if I need to implement metrics for my use case, the current design won’t do. My choices would then become A) create a fork B) don’t use it |
I am curious, why do you require metrics for stubby4j, which is a 3rd party library for you? What I mean is - how often do we find ourselves having to instrument metrics for a 3rd party library? i am not against it, just trying to understand the use case better. Also, whatever time it takes to match the incoming response against the stubs, should be negligible since it is all in-process calls. The |
The complete requirement for metrics is not clear to me yet. I’ll update the relevant ticket once the know what exactly is being asked for |
Sure. Thank you for that. Looking forward to the config directory PR. |
@azagniotov I can't get IntelliJ to compile the project, although it compiles successfully from command line. It appears that because of the non-standard directory structure, IntelliJ is confused. Is there a particular reason to not use the conventional source directories and redefining |
@asarkar it is a multi-module Gradle project structure with conventional source directories in each sub-module. I am not sure what version of Gradle you are running on your machine, but try renerate IDEA configuration files using Gradle: https://docs.gradle.org/current/userguide/idea_plugin.html |
Also, did you try creating |
I know how to work with a Gradle project :) There’s something going on with the project structure here, but I don’t have the time to find out the root cause. I’ve the MR ready, but sadly my internet went down. Should be able to push it later today. |
I just used IntelliJ which did not have stubby4j configured, to The project format selected in IDE was |
PR is ready. Regarding IntelliJ, I think the problem might be that you're not using the standard structure |
The This is also the directory structure for each of the project modules: The I hope this helps. |
Also, I am closing this ticket because the discussions going on here are not related to the original inquiry & you already exported a PR |
Will keep ticket open until the PR is going to be merged |
For large projects, it is not practical to have a single config file.
As soon as the files are split up, there arises a need to have placeholders in them to avoid duplication. For example, if we want to introduce a latency, instead of copy-pasting the value in 25 files, we will want to have a${latency}
(see proposal 2 below).I'm suggesting that:
--data
value is not a directory, this will be a no-op.2. Introduce a filtering functionality like Maven where placeholders in the YAML files are replaced during merging.Both of these changes are backward compatible so existing users will not be impacted.
This can happen in the
Main
class as shown below.Edit:
I realized that filtering can be done as part of the build, and we don't need to write additional code. Simply support for config directory will be sufficient.
The text was updated successfully, but these errors were encountered: