8000 #651 Merge custom JSON properties across multiple `ocelot.X.json` configuration files using Newtonsoft's `JToken` merge functionality by jlukawska · Pull Request #1183 · ThreeMammals/Ocelot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

#651 Merge custom JSON properties across multiple ocelot.X.json configuration files using Newtonsoft's JToken merge functionality #1183

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

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

jlukawska
Copy link
Contributor
@jlukawska jlukawska commented Apr 7, 2020

Closes #651

Proposed Changes

  • The whole sections of config files (with custom properties) are merged.

@raman-m raman-m changed the title Feature/651 merge custom properties of config file #651 Merge custom properties of config file Jul 20, 2023
@raman-m raman-m changed the base branch from master to develop July 20, 2023 15:24
@raman-m raman-m self-requested a review July 20, 2023 16:05
@raman-m raman-m added the feature A new feature label Jul 20, 2023
@raman-m raman-m force-pushed the feature/651-merge-custom-properties branch from 4eb4482 to 9ec4b8d Compare July 26, 2023 14:36
@raman-m
Copy link
Member
raman-m commented Jul 26, 2023

Congrats, @jlukawska ! 🎉
Your feature branch has been rebased onto ThreeMammals:develop.

We can go with code review now...

@raman-m raman-m added the needs feedback Issue is waiting on feedback before acceptance label Jul 26, 2023
@raman-m
Copy link
Member
raman-m commented Aug 3, 2023

@nurhat
As the #651 issue author, could you review this solution please?
Will the solution be useful and helpful for your daily gateway development?

@raman-m
Copy link
Member
raman-m commented Aug 3, 2023

@RaynaldM @wast
You are great approvers! 🥇
Seems like @jlukawska is making breaking changes and you've approved them. 🤣
I am not sure about changes that they're breaking on 100%, but I will review the code thoroughly. 👇

Copy link
Member
@raman-m raman-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlukawska
Could you fix the issues please?

How to read CustomStrategyProperty value of the route in run-time?


fileConfiguration.Aggregates.AddRange(config.Aggregates);
fileConfiguration.Routes.AddRange(config.Routes);
MergeConfig(fileConfiguration, config, isGlobal);
Copy link
Member
@raman-m raman-m Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆗 Merged config JSON goes to primaryConfigFile. And it will be serialized to ocelot.json file.
And the primary config will be attached to IConfigurationBuilder object by AddJsonFile method.

Could you show me a case how can I read this custom property inside of extension-methods for IConfigurationBuilder interface?

@raman-m
Copy link
Member
raman-m commented Aug 3, 2023

@nurhat @jlukawska
I would like to understand, how useful this feature for real world user scenarios.

User case 1

Change behavior of PollyQoSProvider

Given, I wish to override behavior of the Quality of Service feature by changes in PollyQoSProvider and/or AddPolly and/or PollyCircuitBreakingDelegatingHandler classes.
And, I will define custom property of the route for custom QoS overriding in a ocelot.xservices.json file.
And, I will read the custom property from DownstreamRoute object after merging all configs.
When, I read the custom property from DownstreamRoute object.
Then, I get stuck! 😉

Question:

  • How to read custom property from DownstreamRoute object?
  • How and what interface do I need to inject to a service class to be able to read custom property from DownstreamRoute object?

@raman-m raman-m force-pushed the feature/651-merge-custom-properties branch from 04debe6 to 7f61d01 Compare October 12, 2023 12:16
@raman-m raman-m force-pushed the develop branch 8 times, most recently from c216cdf to b458f0f Compare April 7, 2025 16:13
@raman-m raman-m force-pushed the develop branch 22 times, most recently from 908d84f to 0678e7a Compare April 19, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Configuration Ocelot feature: Configuration feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extending Route configuration
4 participants
0