-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use merged ocelot.json
directly from memory instead of from file
#1216
Comments
I really believe that this issue is very important. I'm experimenting this issue when deploying to an App Service in Azure. I have different microservices and ocelot.json is overridden every time. Of course, I'm getting |
Eirik, I believe this feature will be a great enhancement of Ocelot core. My opinion, it would be better to introduce a feature switch between non-virtual and virtual environments to control file system and config merging. And, right, merging in a memory will be an option, for sure. Also, pay attention we have some PRs which are similar to your one, because they solve the same problematic by merging in a memory. See the following: Let's discuss more... |
Hi Pablo! I'm not sure about DB usage here for this issue. But you are welcome to create new PR to present real implementation which will use DB decoupling by interface. And, yes, in any virtual environment (all cloud providers) we have virtual file system, and finally we get the exception you've mentioned. Your opinion here? |
+ Accepted ...due to ready PR #1227 |
@ebjornset @pablo0219 |
ocelot.json
directly from memory instead of from file
… configuration files to memory (#1227) * Added new ConfigurationBuilderExtensions.AddOcelot overload to support merging of configuration files to memory * Fix warnings * File-scoped namespaces * Update configuration.rst Use '^' for subsubsections. Sections: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#sections * Review the code after merge and refactor * Remove and sort usings * Fix warnings * Tried to fix * A small but funny refactoring * Update configuration.rst * More refactoring: add overloaded extensions * Review helpers of unit tests * Add `FileUnitTest` and full rewrite of config tests * Refactor `DiskFileConfigurationRepository` class. Make unit tests parallel, independent, and thread safe * some minor changes * Review and update docs of the Configuration feature * Review and update docs of the `Dependency Injection` feature * Check references for `Dependency Injection` feature aka `ref:` and `doc:` * Update configuration.rst Replace "kind" with "type" --------- Co-authored-by: Raman Maksimchuk <[email protected]> Co-authored-by: Guillaume Gnaegi <[email protected]>
New Feature
The
ConfigurationBuilderExtensions.AddOcelot
method merges the ocelot.*.json files into one ocelot.json file that is written back to disk and then added to theIConfigurationBuilder
.Would it be possible to make another
AddOcelot
method that adds the merged JSON directly from memory into theIConfigurationBuilder
usingbuilder.AddJsonStream
instead?Motivation for New Feature
From time to time we experience a problem at startup where something prevents the server process from writing the merged ocelot.json back to disk. When this happens we get an
UnauthorizedAccessException
(example below) at startup and the process must be killed.We have not been able to see a consistent pattern in the behavior, and we don't have access to the server since IT operation is outsourced, so this is very hard to debug.
Exception System.UnauthorizedAccessException
Access to the path
C:\Octopus\Applications\Dev\Xxxxxxxx\20200429.1_5\ocelot.json
is denied.The text was updated successfully, but these errors were encountered: