- 
                Notifications
    
You must be signed in to change notification settings  - Fork 119
 
Store routing rules in database #635
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
Conversation
40bb455    to
    bfa07f5      
    Compare
  
    | <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <configuration> | ||
| <argLine>-Djol.skipHotspotSAAttach=true</argLine> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need this for local testing - I will revert before merging
| 
               | 
          ||
| import java.util.List; | ||
| 
               | 
          ||
| public interface IRoutingRulesManager | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rename this to RoutingRulesManager once reviews are complete. I have not renamed yet because I renamed the existing RoutingRulesManager to FileBasedRoutingRulesManager, and made changes to the file. Git cannot track a name change followed by creating a new file with the old name, so performing both in the same commit makes the diffs useless.
Add API methods for creating and deleting rules.
bfa07f5    to
    a286173      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good to me.
Might be worth adding a TODO or creating an issue to add Oracle tests for these once we figure out how to run Oracle tests on arm?
          
 
  | 
    
| @Path("/createRoutingRule") | ||
| public Response createRoutingRule(RoutingRule routingRule) | ||
| { | ||
| routingRulesManager.createRoutingRule(routingRule); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now this is revealed to the outside world through the API, it might be helpful to add validation for easier debugging by consumers and more predictability.
| 
               | 
          ||
| @Override | ||
| public List<RoutingRule> getRoutingRules() | ||
| { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how often this gets executed during the gateway lifetime, and how many rules are there on average but in certain conditions it could save some round trips to the db to cache the list of rules here (invalidate on update/delete)
| 
           @yaelselig30 could you provide details on your approval .. did you test this? Did you review the code?  | 
    
          
  | 
    
Description
Store rules in the backend database. This simplifies running a cluster of gateways and CRUD operations on the rule set.
This also adds API methods for creating and deleting rules. UI support for create and delete is not included.
Additional context and related issues
Store routing rules in the database. A rule is defined as a name, description, priority, condition and list of actions, with an additional field for identifying the rule evaluation engine.
MVELis currently the only supported engine, however we anticipate supporting more in the future. The engine field is added at this time to avoid future database schema migrations.Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x ) Release notes are required, with the following suggested text:
* Store routing rules in the database