You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2020/12/28 07:02:51 UTC

[servicecomb-java-chassis] branch master updated: [SCB-2116]governance features based on traffic characteristics (#2167)

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new f6b0bde  [SCB-2116]governance features based on traffic characteristics (#2167)
f6b0bde is described below

commit f6b0bde6652c19ceb7f4d4d81a9bcba461f48128
Author: bao liu <bi...@qq.com>
AuthorDate: Mon Dec 28 15:02:41 2020 +0800

    [SCB-2116]governance features based on traffic characteristics (#2167)
    
    * [SCB-2116]governance features based on traffic characteristics
    
    * [SCB-2116]refactor reading properties
    
    * [SCB-2116]refactoring dynamic properties change and adding tests
    
    * [SCB-2116]renaming packages
    
    * [SCB-2116]update readme
---
 clients/README.md                                  |  14 ++
 coverage-reports/pom.xml                           |   6 +
 dependencies/bom/pom.xml                           |   8 +
 dependencies/default/pom.xml                       |  10 +-
 distribution/pom.xml                               |   6 +
 governance/README.md                               |  24 +++
 governance/pom.xml                                 |  81 +++++++
 .../apache/servicecomb/governance/GovManager.java  |  87 ++++++++
 .../servicecomb/governance/MatchersManager.java    |  52 +++++
 .../event/ConfigurationChangedEvent.java           |  32 +++
 .../servicecomb/governance/event/EventManager.java |  36 ++++
 .../exception/IllegalArgsOperatorException.java    |  26 +++
 .../governance/handler/AbstractGovHandler.java     |  48 +++++
 .../governance/handler/BulkheadHandler.java        |  62 ++++++
 .../governance/handler/CircuitBreakerHandler.java  |  79 +++++++
 .../servicecomb/governance/handler/GovHandler.java |  28 +++
 .../governance/handler/HandlerType.java            |  24 +++
 .../governance/handler/RateLimitingHandler.java    |  65 ++++++
 .../governance/handler/RetryHandler.java           |  83 ++++++++
 .../handler/ext/ClientRecoverPolicy.java           |  23 ++
 .../governance/handler/ext/RetryExtension.java     |  26 +++
 .../handler/ext/ServerRecoverPolicy.java           |  23 ++
 .../governance/marker/GovHttpRequest.java          |  52 +++++
 .../servicecomb/governance/marker/Matcher.java     |  64 ++++++
 .../governance/marker/RequestProcessor.java        |  61 ++++++
 .../governance/marker/TrafficMarker.java           |  42 ++++
 .../marker/operator/CompareOperator.java           |  97 +++++++++
 .../marker/operator/ContainsOperator.java          |  28 +++
 .../governance/marker/operator/ExactOperator.java  |  28 +++
 .../governance/marker/operator/MatchOperator.java  |  22 ++
 .../governance/marker/operator/RawOperator.java    |  23 ++
 .../governance/policy/AbstractPolicy.java          |  55 +++++
 .../governance/policy/BulkheadPolicy.java          |  60 ++++++
 .../governance/policy/CircuitBreakerPolicy.java    | 153 ++++++++++++++
 .../servicecomb/governance/policy/GovRule.java     |  41 ++++
 .../servicecomb/governance/policy/Policy.java      |  32 +++
 .../governance/policy/RateLimitingPolicy.java      |  85 ++++++++
 .../servicecomb/governance/policy/RetryPolicy.java | 121 +++++++++++
 .../governance/properties/BulkheadProperties.java  |  35 +++
 .../properties/CircuitBreakerProperties.java       |  34 +++
 .../governance/properties/GovProperties.java       | 168 +++++++++++++++
 .../governance/properties/MatchProperties.java     |  34 +++
 .../governance/properties/RateLimitProperties.java |  35 +++
 .../governance/properties/RetryProperties.java     |  34 +++
 .../governance/service/MatchersService.java        |  26 +++
 .../governance/service/PolicyService.java          |  26 +++
 .../governance/service/PolicyServiceImpl.java      |  83 ++++++++
 .../servicecomb/governance/GovPropertiesTest.java  | 235 +++++++++++++++++++++
 .../governance/MockMatchersService.java            |  33 +++
 .../servicecomb/governance/MockRetryExtension.java |  37 ++++
 .../src/test/resources/META-INF/spring/bean.xml    |  27 +++
 governance/src/test/resources/application.yaml     |  62 ++++++
 pom.xml                                            |   1 +
 53 files changed, 2676 insertions(+), 1 deletion(-)

diff --git a/clients/README.md b/clients/README.md
new file mode 100644
index 0000000..bdaaafb
--- /dev/null
+++ b/clients/README.md
@@ -0,0 +1,14 @@
+# About
+
+This module implements common http clients for servicecomb-service-center, servicecomb-kie and other
+3rd-party services. 
+
+This module is independent on servicecomb-java-chassis, and can be used in many other projects like 
+Spring Cloud, Dubbo, etc. 
+ 
+# 关于
+
+这个模块给 servicecomb-service-center, servicecomb-kie 以及其他第三方服务实现通用的 Http Client。 
+
+这个模块独立于 servicecomb-java-chassis, 可以用于 Spring Cloud, Dubbo 等项目。
+
diff --git a/coverage-reports/pom.xml b/coverage-reports/pom.xml
index 40719f3..c36ae69 100644
--- a/coverage-reports/pom.xml
+++ b/coverage-reports/pom.xml
@@ -151,6 +151,12 @@
       <artifactId>foundation-vertx</artifactId>
     </dependency>
 
+    <!-- governance -->
+    <dependency>
+      <groupId>org.apache.servicecomb</groupId>
+      <artifactId>servicecomb-governance</artifactId>
+    </dependency>
+
     <!-- handlers -->
     <dependency>
       <groupId>org.apache.servicecomb</groupId>
diff --git a/dependencies/bom/pom.xml b/dependencies/bom/pom.xml
index 8ac1524..56c7626 100644
--- a/dependencies/bom/pom.xml
+++ b/dependencies/bom/pom.xml
@@ -179,6 +179,14 @@
         <artifactId>foundation-vertx</artifactId>
         <version>${project.version}</version>
       </dependency>
+
+      <!-- ServiceComb:governance -->
+      <dependency>
+        <groupId>org.apache.servicecomb</groupId>
+        <artifactId>servicecomb-governance</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+
       <!-- ServiceComb: handlers -->
       <dependency>
         <groupId>org.apache.servicecomb</groupId>
diff --git a/dependencies/default/pom.xml b/dependencies/default/pom.xml
index c2b3b19..62837d3 100644
--- a/dependencies/default/pom.xml
+++ b/dependencies/default/pom.xml
@@ -111,7 +111,7 @@
     <zipkin-reporter.version>2.7.13</zipkin-reporter.version>
     <zookeeper.version>3.4.14</zookeeper.version>
     <nacos-client.version>1.1.4</nacos-client.version>
-
+    <resilience4j.versioin>1.5.0</resilience4j.versioin>
     <!-- Base dir of main -->
     <main.basedir>${basedir}/../..</main.basedir>
   </properties>
@@ -866,6 +866,14 @@
       </dependency>
 
       <dependency>
+        <groupId>io.github.resilience4j</groupId>
+        <artifactId>resilience4j-bom</artifactId>
+        <version>${resilience4j.versioin}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+
+      <dependency>
         <groupId>org.apache.servicecomb</groupId>
         <artifactId>java-chassis-bom</artifactId>
         <version>${project.version}</version>
diff --git a/distribution/pom.xml b/distribution/pom.xml
index ab4fbfb..9b070d2 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -149,6 +149,12 @@
       <artifactId>foundation-vertx</artifactId>
     </dependency>
 
+    <!-- governance -->
+    <dependency>
+      <groupId>org.apache.servicecomb</groupId>
+      <artifactId>servicecomb-governance</artifactId>
+    </dependency>
+
     <!-- handlers -->
     <dependency>
       <groupId>org.apache.servicecomb</groupId>
diff --git a/governance/README.md b/governance/README.md
new file mode 100644
index 0000000..8680692
--- /dev/null
+++ b/governance/README.md
@@ -0,0 +1,24 @@
+# About Deployment Module
+
+Governance module provides an abstraction on how to describe governance instructions for commonly used
+different microservice frameworks, like Java Chassis, Go Chassis, Spring Cloud, Dubbo, etc. 
+
+This abstraction is based on traffic marking, here is a configuration example.
+
+```yaml
+servicecomb:
+  matchGroup:
+    matchGroup0: |
+      matches:
+        - apiPath:
+            exact: "/hello"
+          name: match0
+  rateLimiting:
+    rateLimiting0: |
+      rules:
+        match: matchGroup0.match0
+      rate: 1
+```
+
+First define a traffic marking rule (match group) `servicecomb.matchGroup.matchGroup0` and detailed matches
+specification. Then define governance rules for any marking rule. Marking rule id is `matchGroup0.match0`. 
diff --git a/governance/pom.xml b/governance/pom.xml
new file mode 100644
index 0000000..2acc5a5
--- /dev/null
+++ b/governance/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <groupId>org.apache.servicecomb</groupId>
+    <artifactId>java-chassis-parent</artifactId>
+    <version>2.1.5-SNAPSHOT</version>
+    <relativePath>../parents/default</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>servicecomb-governance</artifactId>
+  <name>Java Chassis::Governance</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.github.resilience4j</groupId>
+      <artifactId>resilience4j-all</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjweaver</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjrt</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.yaml</groupId>
+      <artifactId>snakeyaml</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>failureaccess</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/GovManager.java b/governance/src/main/java/org/apache/servicecomb/governance/GovManager.java
new file mode 100644
index 0000000..e3752e3
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/GovManager.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.servicecomb.governance.handler.GovHandler;
+import org.apache.servicecomb.governance.handler.HandlerType;
+import org.apache.servicecomb.governance.handler.ext.ClientRecoverPolicy;
+import org.apache.servicecomb.governance.handler.ext.ServerRecoverPolicy;
+import org.apache.servicecomb.governance.policy.Policy;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import io.github.resilience4j.decorators.Decorators;
+import io.github.resilience4j.decorators.Decorators.DecorateCheckedSupplier;
+import io.vavr.CheckedFunction0;
+import io.vavr.control.Try;
+
+@Component
+public class GovManager {
+
+  @Autowired
+  Map<String, GovHandler> handlers;
+
+  @Autowired(required = false)
+  ServerRecoverPolicy<Object> serverRecoverPolicy;
+
+  @Autowired(required = false)
+  ClientRecoverPolicy<Object> clientRecoverPolicy;
+
+  public Object processServer(List<Policy> policies, CheckedFunction0<Object> supplier) {
+    DecorateCheckedSupplier<Object> ds = Decorators.ofCheckedSupplier(supplier);
+    for (Policy policy : policies) {
+      if (handlers.get(policy.handler()) == null ||
+          handlers.get(policy.handler()).type() == HandlerType.CLIENT) {
+        continue;
+      }
+      ds = handlers.get(policy.handler()).process(ds, policy);
+    }
+
+    Try<Object> of = Try.of(ds.decorate());
+    return of
+        .recover(throwable -> {
+          if (serverRecoverPolicy == null) {
+            throw (RuntimeException) throwable;
+          } else {
+            return serverRecoverPolicy.apply(throwable);
+          }
+        }).get();
+  }
+
+  public Object processClient(List<Policy> policies, CheckedFunction0<Object> supplier) {
+    DecorateCheckedSupplier<Object> ds = Decorators.ofCheckedSupplier(supplier);
+    for (Policy policy : policies) {
+      if (handlers.get(policy.handler()) == null ||
+          handlers.get(policy.handler()).type() == HandlerType.SERVER) {
+        continue;
+      }
+      ds = handlers.get(policy.handler()).process(ds, policy);
+    }
+    Try<Object> of = Try.of(ds.decorate());
+    return of
+        .recover(throwable -> {
+          if (clientRecoverPolicy == null) {
+            throw (RuntimeException) throwable;
+          } else {
+            return clientRecoverPolicy.apply(throwable);
+          }
+        }).get();
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/MatchersManager.java b/governance/src/main/java/org/apache/servicecomb/governance/MatchersManager.java
new file mode 100644
index 0000000..c35c1a1
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/MatchersManager.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.servicecomb.governance.policy.Policy;
+import org.apache.servicecomb.governance.service.MatchersService;
+import org.apache.servicecomb.governance.service.PolicyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.marker.GovHttpRequest;
+
+@Component
+public class MatchersManager {
+
+  @Autowired
+  private MatchersService matchersService;
+
+  @Autowired
+  private PolicyService policyService;
+
+  public MatchersManager() {
+  }
+
+  public Map<String, Policy> match(GovHttpRequest request) {
+    /**
+     * 1.获取该请求携带的marker
+     */
+    List<String> marks = matchersService.getMatchedNames(request);
+    /**
+     * 2.通过 marker获取到所有的policy
+     */
+    return policyService.getAllPolicies(marks);
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/event/ConfigurationChangedEvent.java b/governance/src/main/java/org/apache/servicecomb/governance/event/ConfigurationChangedEvent.java
new file mode 100644
index 0000000..1436540
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/event/ConfigurationChangedEvent.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.event;
+
+import java.util.List;
+
+public class ConfigurationChangedEvent {
+  private List<String> changedConfigurations;
+
+  public ConfigurationChangedEvent(List<String> changedConfigurations) {
+    this.changedConfigurations = changedConfigurations;
+  }
+
+  public List<String> getChangedConfigurations() {
+    return changedConfigurations;
+  }
+}
\ No newline at end of file
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/event/EventManager.java b/governance/src/main/java/org/apache/servicecomb/governance/event/EventManager.java
new file mode 100644
index 0000000..733d48b
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/event/EventManager.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.event;
+
+import com.google.common.eventbus.EventBus;
+
+public class EventManager {
+  private static EventBus eventBus = new EventBus();
+
+  public static EventBus getEventBus() {
+    return eventBus;
+  }
+
+  public static void post(Object event) {
+    eventBus.post(event);
+  }
+
+  public static void register(Object subscriber) {
+    eventBus.register(subscriber);
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/exception/IllegalArgsOperatorException.java b/governance/src/main/java/org/apache/servicecomb/governance/exception/IllegalArgsOperatorException.java
new file mode 100644
index 0000000..a00502b
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/exception/IllegalArgsOperatorException.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.exception;
+
+public class IllegalArgsOperatorException extends RuntimeException {
+  private static final long serialVersionUID = 793575987576638624L;
+
+  public IllegalArgsOperatorException(String message) {
+    super(message);
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/AbstractGovHandler.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/AbstractGovHandler.java
new file mode 100644
index 0000000..a6f008e
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/AbstractGovHandler.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.handler;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
+
+import com.google.common.eventbus.Subscribe;
+import org.apache.servicecomb.governance.event.ConfigurationChangedEvent;
+import org.apache.servicecomb.governance.event.EventManager;
+
+public abstract class AbstractGovHandler<PROCESSOR> implements GovHandler {
+  private Map<String, PROCESSOR> map = new ConcurrentHashMap<>();
+
+  protected AbstractGovHandler() {
+    EventManager.register(this);
+  }
+
+  protected <R> PROCESSOR getActuator(String key, R policy, Function<R, PROCESSOR> func) {
+    PROCESSOR processor = map.get(key);
+    if (processor == null) {
+      processor = func.apply(policy);
+      map.put(key, processor);
+    }
+    return processor;
+  }
+
+  @Subscribe
+  public void onDynamicConfigurationListener(ConfigurationChangedEvent event) {
+    event.getChangedConfigurations().forEach(v -> map.remove(v));
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/BulkheadHandler.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/BulkheadHandler.java
new file mode 100644
index 0000000..df99d93
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/BulkheadHandler.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.handler;
+
+import java.time.Duration;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.policy.BulkheadPolicy;
+import org.apache.servicecomb.governance.policy.Policy;
+
+import io.github.resilience4j.bulkhead.Bulkhead;
+import io.github.resilience4j.bulkhead.BulkheadConfig;
+import io.github.resilience4j.bulkhead.BulkheadRegistry;
+import io.github.resilience4j.decorators.Decorators.DecorateCheckedSupplier;
+
+@Component("BulkheadHandler")
+public class BulkheadHandler extends AbstractGovHandler<Bulkhead> {
+  private static final Logger LOGGER = LoggerFactory.getLogger(BulkheadHandler.class);
+
+  @Override
+  public <RESULT> DecorateCheckedSupplier<RESULT> process(DecorateCheckedSupplier<RESULT> supplier, Policy policy) {
+    Bulkhead bulkhead = getActuator("servicecomb.bulkhead." + policy.name(), (BulkheadPolicy) policy,
+        this::getBulkhead);
+    return supplier.withBulkhead(bulkhead);
+  }
+
+  @Override
+  public HandlerType type() {
+    return HandlerType.SERVER;
+  }
+
+  private Bulkhead getBulkhead(BulkheadPolicy policy) {
+    LOGGER.info("applying new policy: {}", policy.toString());
+
+    BulkheadConfig config = BulkheadConfig.custom()
+        .maxConcurrentCalls(policy.getMaxConcurrentCalls())
+        .maxWaitDuration(Duration.ofMillis(policy.getMaxWaitDuration()))
+        .build();
+
+    BulkheadRegistry registry = BulkheadRegistry.of(config);
+
+    return registry.bulkhead(policy.name());
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/CircuitBreakerHandler.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/CircuitBreakerHandler.java
new file mode 100644
index 0000000..91dfdf9
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/CircuitBreakerHandler.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.handler;
+
+import java.time.Duration;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.policy.CircuitBreakerPolicy;
+import org.apache.servicecomb.governance.policy.Policy;
+
+import io.github.resilience4j.circuitbreaker.CircuitBreaker;
+import io.github.resilience4j.circuitbreaker.CircuitBreakerConfig;
+import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry;
+import io.github.resilience4j.decorators.Decorators.DecorateCheckedSupplier;
+
+@Component("CircuitBreakerHandler")
+public class CircuitBreakerHandler extends AbstractGovHandler<CircuitBreaker> {
+  private static final Logger LOGGER = LoggerFactory.getLogger(CircuitBreakerHandler.class);
+
+  @Override
+  public <RESULT> DecorateCheckedSupplier<RESULT> process(DecorateCheckedSupplier<RESULT> supplier, Policy policy) {
+    CircuitBreaker circuitBreaker = getActuator("servicecomb.circuitBreaker." + policy.name(),
+        (CircuitBreakerPolicy) policy, this::getCircuitBreaker);
+    return supplier.withCircuitBreaker(circuitBreaker);
+  }
+
+  @Override
+  public HandlerType type() {
+    return HandlerType.SERVER;
+  }
+
+  /**
+   * todo: recordExceptions
+   *
+   * @param policy
+   * @return
+   */
+  private CircuitBreaker getCircuitBreaker(CircuitBreakerPolicy policy) {
+    LOGGER.info("applying new policy: {}", policy.toString());
+
+    CircuitBreakerConfig circuitBreakerConfig = CircuitBreakerConfig.custom()
+        //熔断 失败率(请求)百分比阈值
+        .failureRateThreshold(policy.getFailureRateThreshold())
+        //熔断 慢请求百分比阈值
+        .slowCallRateThreshold(policy.getSlowCallRateThreshold())
+        //从开过渡到半开的等待时间
+        .waitDurationInOpenState(Duration.ofMillis(policy.getWaitDurationInOpenState()))
+        //请求时间定义
+        .slowCallDurationThreshold(Duration.ofMillis(policy.getSlowCallDurationThreshold()))
+        //进入半开状态时 允许的请求数量
+        .permittedNumberOfCallsInHalfOpenState(policy.getPermittedNumberOfCallsInHalfOpenState())
+        //可以达到熔断条件的请求数量下限
+        .minimumNumberOfCalls(policy.getMinimumNumberOfCalls())
+        //可以选择基于时间的滑动窗口计数或者基于请求数量的滑动窗口计数
+        .slidingWindowType(policy.getSlidingWindowType())
+        //滑动窗口,单位可能是请求数或者秒
+        .slidingWindowSize(policy.getSlidingWindowSize())
+        .build();
+    CircuitBreakerRegistry circuitBreakerRegistry = CircuitBreakerRegistry.of(circuitBreakerConfig);
+    return circuitBreakerRegistry.circuitBreaker(policy.name(), circuitBreakerConfig);
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/GovHandler.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/GovHandler.java
new file mode 100644
index 0000000..81a9611
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/GovHandler.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.handler;
+
+import org.apache.servicecomb.governance.policy.Policy;
+
+import io.github.resilience4j.decorators.Decorators.DecorateCheckedSupplier;
+
+public interface GovHandler {
+
+  <RESULT> DecorateCheckedSupplier<RESULT> process(DecorateCheckedSupplier<RESULT> supplier, Policy policy);
+
+  HandlerType type();
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/HandlerType.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/HandlerType.java
new file mode 100644
index 0000000..5ae9b9d
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/HandlerType.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.handler;
+
+public enum HandlerType {
+  CLIENT,
+  SERVER,
+  BOTH
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/RateLimitingHandler.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/RateLimitingHandler.java
new file mode 100644
index 0000000..82a271a
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/RateLimitingHandler.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.handler;
+
+import java.time.Duration;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.policy.Policy;
+import org.apache.servicecomb.governance.policy.RateLimitingPolicy;
+
+import io.github.resilience4j.decorators.Decorators.DecorateCheckedSupplier;
+import io.github.resilience4j.ratelimiter.RateLimiter;
+import io.github.resilience4j.ratelimiter.RateLimiterConfig;
+import io.github.resilience4j.ratelimiter.RateLimiterRegistry;
+
+@Component("RateLimitingHandler")
+public class RateLimitingHandler extends AbstractGovHandler<RateLimiter> {
+  private static final Logger LOGGER = LoggerFactory.getLogger(RateLimitingHandler.class);
+
+  @Override
+  public <RESULT> DecorateCheckedSupplier<RESULT> process(DecorateCheckedSupplier<RESULT> supplier, Policy policy) {
+    RateLimiter rateLimiter = getActuator("servicecomb.rateLimiting." + policy.name(), (RateLimitingPolicy) policy,
+        this::getRateLimiter);
+    return supplier.withRateLimiter(rateLimiter);
+  }
+
+  @Override
+  public HandlerType type() {
+    return HandlerType.SERVER;
+  }
+
+  /**
+   * @param policy
+   * @return
+   */
+  private RateLimiter getRateLimiter(RateLimitingPolicy policy) {
+    LOGGER.info("applying new policy: {}", policy.toString());
+
+    RateLimiterConfig config;
+    config = RateLimiterConfig.custom()
+        .limitForPeriod(policy.getRate())
+        .limitRefreshPeriod(Duration.ofMillis(policy.getLimitRefreshPeriod()))
+        .timeoutDuration(Duration.ofMillis(policy.getTimeoutDuration()))
+        .build();
+    RateLimiterRegistry rateLimiterRegistry = RateLimiterRegistry.of(config);
+    return rateLimiterRegistry.rateLimiter(policy.name());
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/RetryHandler.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/RetryHandler.java
new file mode 100644
index 0000000..86b902d
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/RetryHandler.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.handler;
+
+import java.time.Duration;
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+import org.apache.servicecomb.governance.policy.Policy;
+import org.apache.servicecomb.governance.policy.RetryPolicy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.handler.ext.RetryExtension;
+
+import io.github.resilience4j.decorators.Decorators.DecorateCheckedSupplier;
+import io.github.resilience4j.retry.Retry;
+import io.github.resilience4j.retry.RetryConfig;
+import io.github.resilience4j.retry.RetryRegistry;
+
+@Component("RetryHandler")
+public class RetryHandler extends AbstractGovHandler<Retry> {
+
+  private static final Logger LOGGER = LoggerFactory.getLogger(RetryHandler.class);
+
+  @Autowired
+  private RetryExtension retryExtension;
+
+  /**
+   * @param supplier
+   * @param policy
+   * @return
+   */
+  @Override
+  public <RESULT> DecorateCheckedSupplier<RESULT> process(DecorateCheckedSupplier<RESULT> supplier, Policy policy) {
+    Retry retry = getActuator("servicecomb.retry." + policy.name(), (RetryPolicy) policy, this::getRetry);
+    return supplier.withRetry(retry);
+  }
+
+  @Override
+  public HandlerType type() {
+    return HandlerType.CLIENT;
+  }
+
+  private Retry getRetry(RetryPolicy retryPolicy) {
+    LOGGER.info("applying new policy: {}", retryPolicy.toString());
+
+    List<Integer> statusList = Arrays.stream(retryPolicy.getRetryOnResponseStatus().split(","))
+        .map(Integer::parseInt).collect(Collectors.toList());
+
+    RetryConfig config = RetryConfig.custom()
+        .maxAttempts(retryPolicy.getMaxAttempts())
+        .retryOnResult(getPredicate(statusList))
+        .retryExceptions(retryExtension.retryExceptions())
+        .waitDuration(Duration.ofMillis(retryPolicy.getWaitDuration()))
+        .build();
+
+    RetryRegistry registry = RetryRegistry.of(config);
+    return registry.retry(retryPolicy.name());
+  }
+
+  private Predicate<Object> getPredicate(List<Integer> statusList) {
+    return response -> retryExtension.isRetry(statusList, response);
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/ClientRecoverPolicy.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/ClientRecoverPolicy.java
new file mode 100644
index 0000000..fc8c86a
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/ClientRecoverPolicy.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.handler.ext;
+
+public interface ClientRecoverPolicy<T> {
+
+  T apply(Throwable th);
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/RetryExtension.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/RetryExtension.java
new file mode 100644
index 0000000..63f6866
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/RetryExtension.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.handler.ext;
+
+import java.util.List;
+
+public interface RetryExtension {
+  boolean isRetry(List<Integer> statusList, Object result);
+
+  Class<? extends Throwable>[] retryExceptions();
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/ServerRecoverPolicy.java b/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/ServerRecoverPolicy.java
new file mode 100644
index 0000000..4662c46
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/handler/ext/ServerRecoverPolicy.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.handler.ext;
+
+public interface ServerRecoverPolicy<T> {
+
+  T apply(Throwable th);
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/GovHttpRequest.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/GovHttpRequest.java
new file mode 100644
index 0000000..bc4d9ea
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/GovHttpRequest.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker;
+
+import java.util.Map;
+
+public class GovHttpRequest {
+
+  private Map<String, String> headers;
+
+  private String uri;
+
+  private String method;
+
+  public Map<String, String> getHeaders() {
+    return headers;
+  }
+
+  public void setHeaders(Map<String, String> headers) {
+    this.headers = headers;
+  }
+
+  public String getUri() {
+    return uri;
+  }
+
+  public void setUri(String uri) {
+    this.uri = uri;
+  }
+
+  public String getMethod() {
+    return method;
+  }
+
+  public void setMethod(String method) {
+    this.method = method;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/Matcher.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/Matcher.java
new file mode 100644
index 0000000..371460c
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/Matcher.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.servicecomb.governance.marker.operator.RawOperator;
+
+public class Matcher {
+  private Map<String, RawOperator> headers;
+
+  private RawOperator apiPath;
+
+  private List<String> method;
+
+  private String name;
+
+  public Map<String, RawOperator> getHeaders() {
+    return headers;
+  }
+
+  public void setHeaders(Map<String, RawOperator> headers) {
+    this.headers = headers;
+  }
+
+  public RawOperator getApiPath() {
+    return apiPath;
+  }
+
+  public void setApiPath(RawOperator apiPath) {
+    this.apiPath = apiPath;
+  }
+
+  public List<String> getMethod() {
+    return method;
+  }
+
+  public void setMethod(List<String> method) {
+    this.method = method;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/RequestProcessor.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/RequestProcessor.java
new file mode 100644
index 0000000..26d5acd
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/RequestProcessor.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker;
+
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.marker.operator.MatchOperator;
+import org.apache.servicecomb.governance.marker.operator.RawOperator;
+
+@Component
+public class RequestProcessor {
+
+  private static final String OPERATOR_SUFFIX = "Operator";
+
+  @Autowired
+  private Map<String, MatchOperator> operatorMap;
+
+  public boolean match(GovHttpRequest request, Matcher matcher) {
+    if ((matcher.getMethod() != null && !matcher.getMethod().contains(request.getMethod())) ||
+        (matcher.getApiPath() != null && !operatorMatch(request.getUri(), matcher.getApiPath()))) {
+      return false;
+    }
+    if (matcher.getHeaders() == null) {
+      return true;
+    }
+    for (Entry<String, RawOperator> entry : matcher.getHeaders().entrySet()) {
+      if (!request.getHeaders().containsKey(entry.getKey()) ||
+          !operatorMatch(request.getHeaders().get(entry.getKey()), entry.getValue())) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  private boolean operatorMatch(String str, RawOperator rawOperator) {
+    for (Entry<String, String> entry : rawOperator.entrySet()) {
+      if (!operatorMap.get(entry.getKey() + OPERATOR_SUFFIX).match(str, entry.getValue())) {
+        return false;
+      }
+    }
+    return true;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/TrafficMarker.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/TrafficMarker.java
new file mode 100644
index 0000000..ba4cbf7
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/TrafficMarker.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker;
+
+import java.util.List;
+
+public class TrafficMarker {
+
+  private String services;
+
+  private List<Matcher> matches;
+
+  public String getServices() {
+    return services;
+  }
+
+  public void setServices(String services) {
+    this.services = services;
+  }
+
+  public List<Matcher> getMatches() {
+    return matches;
+  }
+
+  public void setMatches(List<Matcher> matches) {
+    this.matches = matches;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/CompareOperator.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/CompareOperator.java
new file mode 100644
index 0000000..6750a9b
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/CompareOperator.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker.operator;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.exception.IllegalArgsOperatorException;
+
+
+@Component
+public class CompareOperator implements MatchOperator {
+
+  private Set<Character> charSet = new HashSet<>();
+
+  public CompareOperator() {
+    charSet.add('>');
+    charSet.add('<');
+    charSet.add('=');
+    charSet.add('!');
+  }
+
+  /**
+   * 支持 > < = >= <= ! 后面加数字
+   *
+   * @param targetStr
+   * @param patternStr
+   * @return
+   */
+  @Override
+  public boolean match(String targetStr, String patternStr) {
+    char[] chars = patternStr.toCharArray();
+    if (isLegalChar(chars[0]) && isLegalChar(chars[1])) {
+      return process(targetStr, patternStr.substring(0, 2), patternStr.substring(2));
+    } else if (isLegalChar(chars[0])) {
+      return process(targetStr, patternStr.substring(0, 1), patternStr.substring(1));
+    } else {
+      throw new IllegalArgsOperatorException("operator " + patternStr + " is illegal.");
+    }
+  }
+
+  private boolean process(String targetStr, String charStr, String numStr) {
+    double result;
+    double target;
+    try {
+      target = Double.parseDouble(targetStr);
+      if (numStr.startsWith("-")) {
+        result = -Double.parseDouble(numStr.substring(1));
+      } else {
+        result = Double.parseDouble(numStr);
+      }
+    } catch (NumberFormatException e) {
+      throw new IllegalArgsOperatorException("operator " + charStr + numStr + " is illegal.");
+    }
+    switch (charStr) {
+      case ">":
+        return target > result;
+      case "<":
+        return target < result;
+      case "=":
+        return doubleEquals(target, result);
+      case ">=":
+        return target >= result;
+      case "<=":
+        return target <= result;
+      case "!":
+      case "!=":
+        return !doubleEquals(target, result);
+      default:
+        throw new IllegalArgsOperatorException("operator " + charStr + numStr + " is illegal.");
+    }
+  }
+
+  private boolean isLegalChar(char c) {
+    return charSet.contains(c);
+  }
+
+  private boolean doubleEquals(double target, double result) {
+    return Math.abs(target - result) < 1e-6;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/ContainsOperator.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/ContainsOperator.java
new file mode 100644
index 0000000..8e83270
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/ContainsOperator.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker.operator;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class ContainsOperator implements MatchOperator {
+
+  @Override
+  public boolean match(String targetStr, String patternStr) {
+    return targetStr.contains(patternStr);
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/ExactOperator.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/ExactOperator.java
new file mode 100644
index 0000000..44d4c68
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/ExactOperator.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker.operator;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class ExactOperator implements MatchOperator {
+
+  @Override
+  public boolean match(String targetStr, String patternStr) {
+    return targetStr.equals(patternStr);
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/MatchOperator.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/MatchOperator.java
new file mode 100644
index 0000000..c4f157c
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/MatchOperator.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker.operator;
+
+public interface MatchOperator {
+
+  boolean match(String targetStr, String patternStr);
+}
\ No newline at end of file
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/RawOperator.java b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/RawOperator.java
new file mode 100644
index 0000000..48bd06d
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/marker/operator/RawOperator.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.marker.operator;
+
+import java.util.HashMap;
+
+public class RawOperator extends HashMap<String, String> {
+  private static final long serialVersionUID = 659728839992490564L;
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/policy/AbstractPolicy.java b/governance/src/main/java/org/apache/servicecomb/governance/policy/AbstractPolicy.java
new file mode 100644
index 0000000..ae47da3
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/policy/AbstractPolicy.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.policy;
+
+import java.util.Arrays;
+import java.util.List;
+
+public abstract class AbstractPolicy implements Policy {
+
+  private String name;
+
+  private GovRule rules;
+
+  public GovRule getRules() {
+    return rules;
+  }
+
+  public void setRules(GovRule rules) {
+    this.rules = rules;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  @Override
+  public boolean match(List<String> items) {
+    if (rules == null || rules.getMatch() == null) {
+      return false;
+    }
+
+    List<String> configuredItems = Arrays.asList(rules.getMatch().split(","));
+
+    return items.stream().anyMatch(item -> configuredItems.contains(item));
+  }
+
+  @Override
+  public String name() {
+    return name;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/policy/BulkheadPolicy.java b/governance/src/main/java/org/apache/servicecomb/governance/policy/BulkheadPolicy.java
new file mode 100644
index 0000000..e414e1d
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/policy/BulkheadPolicy.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.policy;
+
+import org.apache.servicecomb.governance.handler.BulkheadHandler;
+
+public class BulkheadPolicy extends AbstractPolicy {
+
+  public static final int DEFAULT_MAX_CONCURRENT_CALLS = 1000;
+
+  public static final int DEFAULT_MAX_WAIT_DURATION = 0;
+
+  private int maxConcurrentCalls = DEFAULT_MAX_CONCURRENT_CALLS;
+
+  private int maxWaitDuration = DEFAULT_MAX_WAIT_DURATION;
+
+  public int getMaxConcurrentCalls() {
+    return maxConcurrentCalls;
+  }
+
+  public void setMaxConcurrentCalls(int maxConcurrentCalls) {
+    this.maxConcurrentCalls = maxConcurrentCalls;
+  }
+
+  public int getMaxWaitDuration() {
+    return maxWaitDuration;
+  }
+
+  public void setMaxWaitDuration(int maxWaitDuration) {
+    this.maxWaitDuration = maxWaitDuration;
+  }
+
+  @Override
+  public String handler() {
+    return BulkheadHandler.class.getSimpleName();
+  }
+
+  @Override
+  public String toString() {
+    return "BulkheadPolicy{" +
+        "maxConcurrentCalls=" + maxConcurrentCalls +
+        ", maxWaitDuration=" + maxWaitDuration +
+        '}';
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/policy/CircuitBreakerPolicy.java b/governance/src/main/java/org/apache/servicecomb/governance/policy/CircuitBreakerPolicy.java
new file mode 100644
index 0000000..4353a25
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/policy/CircuitBreakerPolicy.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.policy;
+
+import org.apache.servicecomb.governance.handler.CircuitBreakerHandler;
+import org.springframework.util.StringUtils;
+
+import io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowType;
+
+public class CircuitBreakerPolicy extends AbstractPolicy {
+
+  public static final int DEFAULT_FAILURE_RATE_THRESHOLD = 50;
+
+  public static final int DEFAULT_SLOW_CALL_RATE_THRESHOLD = 100;
+
+  public static final int DEFAULT_WAIT_DURATION_IN_OPEN_STATUS = 60000;
+
+  //ms
+  public static final int DEFAULT_SLOW_CALL_DURATION_THRESHOLD = 60000;
+
+  // the number of permitted calls when the CircuitBreaker is half open.
+  public static final int DEFAULT_PERMITTED = 10;
+
+  public static final int DEFAULT_MINIMUM_NUMBER_CALLS = 100;
+
+  public static final int DEFAULT_SLIDING_WINDOW_SIZE = 100;
+
+  private int failureRateThreshold = DEFAULT_FAILURE_RATE_THRESHOLD;
+
+  private int slowCallRateThreshold = DEFAULT_SLOW_CALL_RATE_THRESHOLD;
+
+  private int waitDurationInOpenState = DEFAULT_WAIT_DURATION_IN_OPEN_STATUS;
+
+  private int slowCallDurationThreshold = DEFAULT_SLOW_CALL_DURATION_THRESHOLD;
+
+  private int permittedNumberOfCallsInHalfOpenState = DEFAULT_PERMITTED;
+
+  private int minimumNumberOfCalls = DEFAULT_MINIMUM_NUMBER_CALLS;
+
+  private String slidingWindowType;
+
+  private int slidingWindowSize = DEFAULT_SLIDING_WINDOW_SIZE;
+
+  public CircuitBreakerPolicy() {
+  }
+
+  public int getFailureRateThreshold() {
+    return failureRateThreshold;
+  }
+
+  public void setFailureRateThreshold(int failureRateThreshold) {
+    this.failureRateThreshold = failureRateThreshold;
+  }
+
+  public int getSlowCallRateThreshold() {
+    return slowCallRateThreshold;
+  }
+
+  public void setSlowCallRateThreshold(int slowCallRateThreshold) {
+    this.slowCallRateThreshold = slowCallRateThreshold;
+  }
+
+  public int getWaitDurationInOpenState() {
+    return waitDurationInOpenState;
+  }
+
+  public void setWaitDurationInOpenState(int waitDurationInOpenState) {
+    this.waitDurationInOpenState = waitDurationInOpenState;
+  }
+
+  public int getSlowCallDurationThreshold() {
+    return slowCallDurationThreshold;
+  }
+
+  public void setSlowCallDurationThreshold(int slowCallDurationThreshold) {
+    this.slowCallDurationThreshold = slowCallDurationThreshold;
+  }
+
+  public int getPermittedNumberOfCallsInHalfOpenState() {
+    return permittedNumberOfCallsInHalfOpenState;
+  }
+
+  public void setPermittedNumberOfCallsInHalfOpenState(int permittedNumberOfCallsInHalfOpenState) {
+    this.permittedNumberOfCallsInHalfOpenState = permittedNumberOfCallsInHalfOpenState;
+  }
+
+  public int getMinimumNumberOfCalls() {
+    return minimumNumberOfCalls;
+  }
+
+  public void setMinimumNumberOfCalls(int minimumNumberOfCalls) {
+    this.minimumNumberOfCalls = minimumNumberOfCalls;
+  }
+
+  public SlidingWindowType getSlidingWindowType() {
+    if (StringUtils.isEmpty(slidingWindowType)) {
+      slidingWindowType = "count";
+    }
+    switch (slidingWindowType) {
+      case "time":
+        return SlidingWindowType.TIME_BASED;
+      case "count":
+      default:
+        return SlidingWindowType.COUNT_BASED;
+    }
+  }
+
+  public void setSlidingWindowType(String slidingWindowType) {
+    this.slidingWindowType = slidingWindowType;
+  }
+
+  // time's unit is second
+  public int getSlidingWindowSize() {
+    return slidingWindowSize;
+  }
+
+  public void setSlidingWindowSize(int slidingWindowSize) {
+    this.slidingWindowSize = slidingWindowSize;
+  }
+
+  @Override
+  public String handler() {
+    return CircuitBreakerHandler.class.getSimpleName();
+  }
+
+  @Override
+  public String toString() {
+    return "CircuitBreakerPolicy{" +
+        "failureRateThreshold=" + failureRateThreshold +
+        ", slowCallRateThreshold=" + slowCallRateThreshold +
+        ", waitDurationInOpenState=" + waitDurationInOpenState +
+        ", slowCallDurationThreshold=" + slowCallDurationThreshold +
+        ", permittedNumberOfCallsInHalfOpenState=" + permittedNumberOfCallsInHalfOpenState +
+        ", minimumNumberOfCalls=" + minimumNumberOfCalls +
+        ", slidingWindowType='" + slidingWindowType + '\'' +
+        ", slidingWindowSize=" + slidingWindowSize +
+        '}';
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/policy/GovRule.java b/governance/src/main/java/org/apache/servicecomb/governance/policy/GovRule.java
new file mode 100644
index 0000000..58db001
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/policy/GovRule.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.policy;
+
+public class GovRule {
+
+  private String match;
+
+  private int precedence;
+
+  public String getMatch() {
+    return match;
+  }
+
+  public void setMatch(String match) {
+    this.match = match;
+  }
+
+  public int getPrecedence() {
+    return precedence;
+  }
+
+  public void setPrecedence(int precedence) {
+    this.precedence = precedence;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/policy/Policy.java b/governance/src/main/java/org/apache/servicecomb/governance/policy/Policy.java
new file mode 100644
index 0000000..968312d
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/policy/Policy.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.policy;
+
+import java.util.List;
+
+/**
+ * @Author GuoYl123
+ * @Date 2020/5/11
+ **/
+public interface Policy {
+
+  boolean match(List<String> strings);
+
+  String handler();
+
+  String name();
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/policy/RateLimitingPolicy.java b/governance/src/main/java/org/apache/servicecomb/governance/policy/RateLimitingPolicy.java
new file mode 100644
index 0000000..2d82d76
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/policy/RateLimitingPolicy.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.policy;
+
+import org.apache.servicecomb.governance.handler.RateLimitingHandler;
+
+/**
+ * resilience4j 采用类似令牌桶的思想,其原理:
+ * 每隔limitRefreshPeriod的时间会加入limitForPeriod个新许可
+ * 如果获取不到新的许可(已经触发限流),当前线程会park,最多等待timeoutDuration的时间
+ * 采用默认单位为ms
+ *
+ * @Author GuoYl123
+ * @Date 2020/5/11
+ **/
+public class RateLimitingPolicy extends AbstractPolicy {
+
+  public static final int DEFAULT_TIMEOUT_DURATION = 0;
+
+  public static final int DEFAULT_LIMIT_REFRESH_PERIOD = 1000;
+
+  public static final int DEFAULT_LIMIT_FOR_PERIOD = 1000;
+
+  private int timeoutDuration = DEFAULT_TIMEOUT_DURATION;
+
+  private int limitRefreshPeriod = DEFAULT_LIMIT_REFRESH_PERIOD;
+
+  // 配置项名称使用 rate, 对应于 resilience4j 的 limitForPeriod
+  private int rate = DEFAULT_LIMIT_FOR_PERIOD;
+
+  public int getTimeoutDuration() {
+    return timeoutDuration;
+  }
+
+  public void setTimeoutDuration(int timeoutDuration) {
+    this.timeoutDuration = timeoutDuration;
+  }
+
+  public int getLimitRefreshPeriod() {
+    return limitRefreshPeriod;
+  }
+
+  public void setLimitRefreshPeriod(int limitRefreshPeriod) {
+    this.limitRefreshPeriod = limitRefreshPeriod;
+  }
+
+  public int getRate() {
+    return rate;
+  }
+
+  public void setRate(int rate) {
+    this.rate = rate;
+  }
+
+  public RateLimitingPolicy() {
+  }
+
+  @Override
+  public String handler() {
+    return RateLimitingHandler.class.getSimpleName();
+  }
+
+  @Override
+  public String toString() {
+    return "RateLimitingPolicy{" +
+        "timeoutDuration=" + timeoutDuration +
+        ", limitRefreshPeriod=" + limitRefreshPeriod +
+        ", rate=" + rate + " req/s" +
+        '}';
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/policy/RetryPolicy.java b/governance/src/main/java/org/apache/servicecomb/governance/policy/RetryPolicy.java
new file mode 100644
index 0000000..4efd065
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/policy/RetryPolicy.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.policy;
+
+import org.springframework.util.StringUtils;
+
+import org.apache.servicecomb.governance.handler.RetryHandler;
+
+/**
+ *  intervalFunction  失败时可以更改等待时间的函数
+ *  retryOnResultPredicate  根据返回结果决定是否进行重试
+ *  retryOnExceptionPredicate  根据失败异常决定是否进行重试
+ *
+ */
+public class RetryPolicy extends AbstractPolicy {
+
+  public static final int DEFAULT_MAX_ATTEMPTS = 3;
+
+  public static final int DEFAULT_WAIT_DURATION = 0;
+
+  public static final String DEFAULT_RETRY_ON_RESPONSE_STATUS = "502";
+
+  //最多尝试次数
+  private int maxAttempts = DEFAULT_MAX_ATTEMPTS;
+
+  //每次重试尝试等待的时间,默认给0
+  private int waitDuration = DEFAULT_WAIT_DURATION;
+
+  //需要重试的http status, 逗号分隔
+  private String retryOnResponseStatus;
+
+  //TODO: 需要进行重试的异常列表,反射取异常
+  private String retryExceptions;
+
+  //TODO: 需要进行忽略的异常列表
+  private String ignoreExceptions;
+
+  private boolean onSame;
+
+  public String getRetryOnResponseStatus() {
+    if (StringUtils.isEmpty(retryOnResponseStatus)) {
+      retryOnResponseStatus = DEFAULT_RETRY_ON_RESPONSE_STATUS;
+    }
+    return retryOnResponseStatus;
+  }
+
+  public void setRetryOnResponseStatus(String retryOnResponseStatus) {
+    this.retryOnResponseStatus = retryOnResponseStatus;
+  }
+
+  public int getMaxAttempts() {
+    return maxAttempts;
+  }
+
+  public void setMaxAttempts(int maxAttempts) {
+    this.maxAttempts = maxAttempts;
+  }
+
+  public int getWaitDuration() {
+    return waitDuration;
+  }
+
+  public void setWaitDuration(int waitDuration) {
+    this.waitDuration = waitDuration;
+  }
+
+  public String getRetryExceptions() {
+    return retryExceptions;
+  }
+
+  public void setRetryExceptions(String retryExceptions) {
+    this.retryExceptions = retryExceptions;
+  }
+
+  public String getIgnoreExceptions() {
+    return ignoreExceptions;
+  }
+
+  public void setIgnoreExceptions(String ignoreExceptions) {
+    this.ignoreExceptions = ignoreExceptions;
+  }
+
+  public boolean isOnSame() {
+    return onSame;
+  }
+
+  public void setOnSame(boolean onSame) {
+    this.onSame = onSame;
+  }
+
+  @Override
+  public String handler() {
+    return RetryHandler.class.getSimpleName();
+  }
+
+  @Override
+  public String toString() {
+    return "RetryPolicy{" +
+        "maxAttempts=" + maxAttempts +
+        ", waitDuration=" + waitDuration +
+        ", retryOnResponseStatus='" + retryOnResponseStatus + '\'' +
+        ", retryExceptions='" + retryExceptions + '\'' +
+        ", ignoreExceptions='" + ignoreExceptions + '\'' +
+        ", onSame=" + onSame +
+        '}';
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/properties/BulkheadProperties.java b/governance/src/main/java/org/apache/servicecomb/governance/properties/BulkheadProperties.java
new file mode 100644
index 0000000..b61f4d3
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/properties/BulkheadProperties.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance.properties;
+
+import org.apache.servicecomb.governance.policy.BulkheadPolicy;
+import org.springframework.stereotype.Component;
+
+@Component
+public class BulkheadProperties extends GovProperties<BulkheadPolicy> {
+  public static final String MATCH_BULKHEAD__KEY = "servicecomb.bulkhead";
+
+  public BulkheadProperties() {
+    super(MATCH_BULKHEAD__KEY);
+  }
+
+  @Override
+  public Class<BulkheadPolicy> getEntityClass() {
+    return BulkheadPolicy.class;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/properties/CircuitBreakerProperties.java b/governance/src/main/java/org/apache/servicecomb/governance/properties/CircuitBreakerProperties.java
new file mode 100644
index 0000000..5465f66
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/properties/CircuitBreakerProperties.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.properties;
+
+import org.apache.servicecomb.governance.policy.CircuitBreakerPolicy;
+import org.springframework.stereotype.Component;
+
+@Component
+public class CircuitBreakerProperties extends GovProperties<CircuitBreakerPolicy> {
+  public static final String MATCH_CIRCUITBREAKER_KEY = "servicecomb.circuitBreaker";
+
+  public CircuitBreakerProperties() {
+    super(MATCH_CIRCUITBREAKER_KEY);
+  }
+
+  @Override
+  public Class<CircuitBreakerPolicy> getEntityClass() {
+    return CircuitBreakerPolicy.class;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/properties/GovProperties.java b/governance/src/main/java/org/apache/servicecomb/governance/properties/GovProperties.java
new file mode 100644
index 0000000..3a498e6
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/properties/GovProperties.java
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.properties;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.CompositePropertySource;
+import org.springframework.core.env.ConfigurableEnvironment;
+import org.springframework.core.env.EnumerablePropertySource;
+import org.springframework.core.env.Environment;
+import org.springframework.core.env.PropertySource;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+import org.yaml.snakeyaml.TypeDescription;
+import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.constructor.Constructor;
+import org.yaml.snakeyaml.error.YAMLException;
+import org.yaml.snakeyaml.representer.Representer;
+
+import com.google.common.eventbus.Subscribe;
+import org.apache.servicecomb.governance.event.ConfigurationChangedEvent;
+import org.apache.servicecomb.governance.event.EventManager;
+
+public abstract class GovProperties<T> implements InitializingBean {
+  private static final Logger LOGGER = LoggerFactory.getLogger(GovProperties.class);
+
+  private final Representer representer = new Representer();
+
+  private final String configKey;
+
+  @Autowired
+  protected Environment environment;
+
+  protected Map<String, T> parsedEntity;
+
+  protected Class<T> entityClass;
+
+  protected GovProperties(String key) {
+    configKey = key;
+    representer.getPropertyUtils().setSkipMissingProperties(true);
+    EventManager.register(this);
+    entityClass = getEntityClass();
+  }
+
+  @Override
+  public void afterPropertiesSet() {
+    parsedEntity = parseEntity(readPropertiesFromPrefix());
+  }
+
+  @Subscribe
+  public void onConfigurationChangedEvent(ConfigurationChangedEvent event) {
+    for (String key : event.getChangedConfigurations()) {
+      if (key.startsWith(configKey + ".")) {
+        // 删除的情况, 从配置文件读取配置。 需要保证 environment 已经刷新配置值。
+        T entityItem = parseEntityItem(environment.getProperty(key));
+        String mapKey = key.substring((configKey + ".").length());
+        if (entityItem == null) {
+          parsedEntity.remove(mapKey);
+        } else {
+          parsedEntity.put(mapKey, entityItem);
+        }
+      }
+    }
+  }
+
+  private Map<String, String> readPropertiesFromPrefix() {
+    Set<String> allKeys = getAllKeys(environment);
+    Map<String, String> result = new HashMap<>();
+    allKeys.forEach(key -> {
+      if (key.startsWith(configKey + ".")) {
+        result.put(key.substring(configKey.length() + 1), environment.getProperty(key));
+      }
+    });
+    return result;
+  }
+
+  private Set<String> getAllKeys(Environment environment) {
+    Set<String> allKeys = new HashSet<>();
+
+    if (!(environment instanceof ConfigurableEnvironment)) {
+      LOGGER.warn("None ConfigurableEnvironment is ignored in {}", this.getClass().getName());
+      return allKeys;
+    }
+
+    ConfigurableEnvironment configurableEnvironment = (ConfigurableEnvironment) environment;
+
+    for (PropertySource<?> propertySource : configurableEnvironment.getPropertySources()) {
+      getProperties(propertySource, allKeys);
+    }
+    return allKeys;
+  }
+
+  private void getProperties(PropertySource<?> propertySource,
+      Set<String> allKeys) {
+    if (propertySource instanceof CompositePropertySource) {
+      // recursively get EnumerablePropertySource
+      CompositePropertySource compositePropertySource = (CompositePropertySource) propertySource;
+      compositePropertySource.getPropertySources().forEach(ps -> getProperties(ps, allKeys));
+      return;
+    }
+    if (propertySource instanceof EnumerablePropertySource) {
+      EnumerablePropertySource<?> enumerablePropertySource = (EnumerablePropertySource<?>) propertySource;
+      Collections.addAll(allKeys, enumerablePropertySource.getPropertyNames());
+      return;
+    }
+
+    LOGGER.warn("None EnumerablePropertySource ignored in {}, propertySourceName = [{}]", this.getClass().getName(),
+        propertySource.getName());
+  }
+
+  public Map<String, T> getParsedEntity() {
+    return this.parsedEntity;
+  }
+
+  protected Map<String, T> parseEntity(Map<String, String> yamlEntity) {
+    if (CollectionUtils.isEmpty(yamlEntity)) {
+      return Collections.emptyMap();
+    }
+
+    Map<String, T> resultMap = new HashMap<>();
+    for (Entry<String, String> entry : yamlEntity.entrySet()) {
+      T marker = parseEntityItem(entry.getValue());
+      if (marker != null) {
+        resultMap.put(entry.getKey(), marker);
+      }
+    }
+    return resultMap;
+  }
+
+  protected abstract Class<T> getEntityClass();
+
+  protected T parseEntityItem(String value) {
+    if (StringUtils.isEmpty(value)) {
+      return null;
+    }
+
+    try {
+      Yaml entityParser = new Yaml(new Constructor(new TypeDescription(entityClass, entityClass)), representer);
+      return entityParser.loadAs(value, entityClass);
+    } catch (YAMLException e) {
+      LOGGER.error("governance config yaml is illegal : {}", e.getMessage());
+    }
+    return null;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/properties/MatchProperties.java b/governance/src/main/java/org/apache/servicecomb/governance/properties/MatchProperties.java
new file mode 100644
index 0000000..c910518
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/properties/MatchProperties.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.properties;
+
+import org.apache.servicecomb.governance.marker.TrafficMarker;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MatchProperties extends GovProperties<TrafficMarker> {
+  public static final String MATCH_POLICY_KEY = "servicecomb.matchGroup";
+
+  public MatchProperties() {
+    super(MATCH_POLICY_KEY);
+  }
+
+  @Override
+  public Class<TrafficMarker> getEntityClass() {
+    return TrafficMarker.class;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/properties/RateLimitProperties.java b/governance/src/main/java/org/apache/servicecomb/governance/properties/RateLimitProperties.java
new file mode 100644
index 0000000..e1a2653
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/properties/RateLimitProperties.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.properties;
+
+
+import org.apache.servicecomb.governance.policy.RateLimitingPolicy;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RateLimitProperties extends GovProperties<RateLimitingPolicy> {
+  public static final String MATCH_RATE_LIMIT_KEY = "servicecomb.rateLimiting";
+
+  public RateLimitProperties() {
+    super(MATCH_RATE_LIMIT_KEY);
+  }
+
+  @Override
+  public Class<RateLimitingPolicy> getEntityClass() {
+    return RateLimitingPolicy.class;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/properties/RetryProperties.java b/governance/src/main/java/org/apache/servicecomb/governance/properties/RetryProperties.java
new file mode 100644
index 0000000..9c87ba2
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/properties/RetryProperties.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.properties;
+
+import org.apache.servicecomb.governance.policy.RetryPolicy;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RetryProperties extends GovProperties<RetryPolicy> {
+  public static final String MATCH_RETRY_KEY = "servicecomb.retry";
+
+  public RetryProperties() {
+    super(MATCH_RETRY_KEY);
+  }
+
+  @Override
+  public Class<RetryPolicy> getEntityClass() {
+    return RetryPolicy.class;
+  }
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/service/MatchersService.java b/governance/src/main/java/org/apache/servicecomb/governance/service/MatchersService.java
new file mode 100644
index 0000000..265e632
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/service/MatchersService.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.service;
+
+import org.apache.servicecomb.governance.marker.GovHttpRequest;
+
+import java.util.List;
+
+public interface MatchersService {
+
+  List<String> getMatchedNames(GovHttpRequest govHttpRequest);
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/service/PolicyService.java b/governance/src/main/java/org/apache/servicecomb/governance/service/PolicyService.java
new file mode 100644
index 0000000..c1afeb3
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/service/PolicyService.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.service;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.servicecomb.governance.policy.Policy;
+
+public interface PolicyService {
+  Map<String, Policy> getAllPolicies(List<String> mark);
+}
diff --git a/governance/src/main/java/org/apache/servicecomb/governance/service/PolicyServiceImpl.java b/governance/src/main/java/org/apache/servicecomb/governance/service/PolicyServiceImpl.java
new file mode 100644
index 0000000..03f1a1b
--- /dev/null
+++ b/governance/src/main/java/org/apache/servicecomb/governance/service/PolicyServiceImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.governance.service;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.servicecomb.governance.policy.AbstractPolicy;
+import org.apache.servicecomb.governance.policy.Policy;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import org.apache.servicecomb.governance.properties.GovProperties;
+
+@Component
+public class PolicyServiceImpl implements PolicyService {
+
+  private static final String MATCH_NONE = "none";
+
+  @Autowired
+  private List<GovProperties<? extends AbstractPolicy>> propertiesList;
+
+  @Override
+  public Map<String, Policy> getAllPolicies(List<String> marks) {
+    Map<String, Policy> policies = new HashMap<>();
+
+    if (CollectionUtils.isEmpty(marks)) {
+      return policies;
+    }
+
+    for (GovProperties<? extends AbstractPolicy> properties : propertiesList) {
+      Policy policy = match(properties.getParsedEntity(), marks);
+      if (policy != null) {
+        policies.put(properties.getClass().getName(), policy);
+      }
+    }
+    return policies;
+  }
+
+  private <T extends AbstractPolicy> Policy match(Map<String, T> policies, List<String> marks) {
+    List<AbstractPolicy> policyList = new ArrayList<>();
+    AbstractPolicy defaultPolicy = null;
+    for (Entry<String, T> entry : policies.entrySet()) {
+      T policy = entry.getValue();
+
+      if (policy.getRules() != null && MATCH_NONE.equals(policy.getRules().getMatch())) {
+        defaultPolicy = entry.getValue();
+        defaultPolicy.setName(entry.getKey());
+      }
+
+      if (policy.match(marks)) {
+        AbstractPolicy policyResult;
+        policyResult = entry.getValue();
+        policyResult.setName(entry.getKey());
+        policyList.add(policyResult);
+      }
+    }
+    if (!policyList.isEmpty()) {
+      policyList.sort(Comparator.comparingInt(p -> p.getRules().getPrecedence()));
+      return policyList.get(0);
+    }
+    return defaultPolicy;
+  }
+}
diff --git a/governance/src/test/java/org/apache/servicecomb/governance/GovPropertiesTest.java b/governance/src/test/java/org/apache/servicecomb/governance/GovPropertiesTest.java
new file mode 100644
index 0000000..9b4d3c9
--- /dev/null
+++ b/governance/src/test/java/org/apache/servicecomb/governance/GovPropertiesTest.java
@@ -0,0 +1,235 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
+import org.springframework.core.env.ConfigurableEnvironment;
+import org.springframework.core.env.EnumerablePropertySource;
+import org.springframework.core.env.Environment;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import org.apache.servicecomb.governance.event.ConfigurationChangedEvent;
+import org.apache.servicecomb.governance.event.EventManager;
+import org.apache.servicecomb.governance.marker.Matcher;
+import org.apache.servicecomb.governance.marker.TrafficMarker;
+import org.apache.servicecomb.governance.policy.AbstractPolicy;
+import org.apache.servicecomb.governance.policy.BulkheadPolicy;
+import org.apache.servicecomb.governance.policy.CircuitBreakerPolicy;
+import org.apache.servicecomb.governance.policy.RateLimitingPolicy;
+import org.apache.servicecomb.governance.policy.RetryPolicy;
+import org.apache.servicecomb.governance.properties.BulkheadProperties;
+import org.apache.servicecomb.governance.properties.CircuitBreakerProperties;
+import org.apache.servicecomb.governance.properties.GovProperties;
+import org.apache.servicecomb.governance.properties.MatchProperties;
+import org.apache.servicecomb.governance.properties.RateLimitProperties;
+import org.apache.servicecomb.governance.properties.RetryProperties;
+
+@RunWith(SpringRunner.class)
+@ContextConfiguration(locations = "classpath:META-INF/spring/*.xml", initializers = ConfigFileApplicationContextInitializer.class)
+public class GovPropertiesTest {
+
+  @Autowired
+  private List<GovProperties<? extends AbstractPolicy>> propertiesList;
+
+  @Autowired
+  private MatchProperties matchProperties;
+
+  @Autowired
+  private BulkheadProperties bulkheadProperties;
+
+  @Autowired
+  private CircuitBreakerProperties circuitBreakerProperties;
+
+  @Autowired
+  private RateLimitProperties rateLimitProperties;
+
+  @Autowired
+  private RetryProperties retryProperties;
+
+  @Autowired
+  private Environment environment;
+
+  private Map<String, Object> dynamicValues = new HashMap<>();
+
+  public GovPropertiesTest() {
+    System.out.print(1);
+  }
+
+  @Before
+  public void setUp() {
+    ConfigurableEnvironment configurableEnvironment = (ConfigurableEnvironment) environment;
+
+    if (configurableEnvironment.getPropertySources().contains("testDynamicChange")) {
+      configurableEnvironment.getPropertySources().remove("testDynamicChange");
+    }
+
+    configurableEnvironment.getPropertySources()
+        .addFirst(new EnumerablePropertySource<Map<String, Object>>("testDynamicChange", dynamicValues) {
+          @Override
+          public Object getProperty(String s) {
+            return this.getSource().get(s);
+          }
+
+          @Override
+          public String[] getPropertyNames() {
+            return this.getSource().keySet().toArray(new String[0]);
+          }
+        });
+  }
+
+  @After
+  public void tearDown() {
+    Set<String> keys = dynamicValues.keySet();
+    keys.forEach(k -> dynamicValues.put(k, null));
+    EventManager.post(new ConfigurationChangedEvent(new ArrayList<>(dynamicValues.keySet())));
+  }
+
+  @Test
+  public void test_all_bean_is_loaded() {
+    Assert.assertEquals(4, propertiesList.size());
+  }
+
+  @Test
+  public void test_match_properties_successfully_loaded() {
+    Map<String, TrafficMarker> markers = matchProperties.getParsedEntity();
+    Assert.assertEquals(4, markers.size());
+    TrafficMarker demoRateLimiting = markers.get("demo-rateLimiting");
+    List<Matcher> matchers = demoRateLimiting.getMatches();
+    Assert.assertEquals(1, matchers.size());
+    Matcher matcher = matchers.get(0);
+    Assert.assertEquals("match0", matcher.getName());
+    Assert.assertEquals("/hello", matcher.getApiPath().get("exact"));
+  }
+
+  @Test
+  public void test_match_properties_changed() {
+    dynamicValues.put("servicecomb.matchGroup.demo-rateLimiting", "matches:\n"
+        + "  - apiPath:\n"
+        + "      exact: \"/hello2\"\n"
+        + "    name: match0");
+    dynamicValues.put("servicecomb.matchGroup.demo-rateLimiting2", "matches:\n"
+        + "  - apiPath:\n"
+        + "      exact: \"/hello2\"\n"
+        + "    name: match0");
+
+    EventManager.post(new ConfigurationChangedEvent(new ArrayList<>(dynamicValues.keySet())));
+
+    Map<String, TrafficMarker> markers = matchProperties.getParsedEntity();
+    Assert.assertEquals(5, markers.size());
+    TrafficMarker demoRateLimiting = markers.get("demo-rateLimiting");
+    List<Matcher> matchers = demoRateLimiting.getMatches();
+    Assert.assertEquals(1, matchers.size());
+    Matcher matcher = matchers.get(0);
+    Assert.assertEquals("match0", matcher.getName());
+    Assert.assertEquals("/hello2", matcher.getApiPath().get("exact"));
+
+    demoRateLimiting = markers.get("demo-rateLimiting2");
+    matchers = demoRateLimiting.getMatches();
+    Assert.assertEquals(1, matchers.size());
+    matcher = matchers.get(0);
+    Assert.assertEquals("match0", matcher.getName());
+    Assert.assertEquals("/hello2", matcher.getApiPath().get("exact"));
+  }
+
+  @Test
+  public void test_bulkhead_properties_changed() {
+    dynamicValues.put("servicecomb.bulkhead.bulkhead0", "rules:\n"
+        + "  match: demo-bulkhead.xx\n"
+        + "  precedence: 100\n"
+        + "maxConcurrentCalls: 2\n"
+        + "maxWaitDuration: 2000");
+    dynamicValues.put("servicecomb.bulkhead.bulkhead1", "rules:\n"
+        + "  match: demo-bulkhead.xx\n"
+        + "  precedence: 100\n"
+        + "maxConcurrentCalls: 3\n"
+        + "maxWaitDuration: 3000");
+
+    EventManager.post(new ConfigurationChangedEvent(new ArrayList<>(dynamicValues.keySet())));
+
+    Map<String, BulkheadPolicy> policies = bulkheadProperties.getParsedEntity();
+    Assert.assertEquals(2, policies.size());
+    BulkheadPolicy policy = policies.get("bulkhead0");
+    Assert.assertEquals(2, policy.getMaxConcurrentCalls());
+    Assert.assertEquals(2000, policy.getMaxWaitDuration());
+    Assert.assertEquals("demo-bulkhead.xx", policy.getRules().getMatch());
+    Assert.assertEquals(100, policy.getRules().getPrecedence());
+
+    policies = bulkheadProperties.getParsedEntity();
+    Assert.assertEquals(2, policies.size());
+    policy = policies.get("bulkhead1");
+    Assert.assertEquals(3, policy.getMaxConcurrentCalls());
+    Assert.assertEquals(3000, policy.getMaxWaitDuration());
+    Assert.assertEquals("demo-bulkhead.xx", policy.getRules().getMatch());
+    Assert.assertEquals(100, policy.getRules().getPrecedence());
+  }
+
+  @Test
+  public void test_bulkhead_properties_successfully_loaded() {
+    Map<String, BulkheadPolicy> policies = bulkheadProperties.getParsedEntity();
+    Assert.assertEquals(1, policies.size());
+    BulkheadPolicy policy = policies.get("bulkhead0");
+    Assert.assertEquals(1, policy.getMaxConcurrentCalls());
+    Assert.assertEquals(3000, policy.getMaxWaitDuration());
+    Assert.assertEquals("demo-bulkhead.xx", policy.getRules().getMatch());
+    Assert.assertEquals(100, policy.getRules().getPrecedence());
+  }
+
+  @Test
+  public void test_circuit_breaker_properties_successfully_loaded() {
+    Map<String, CircuitBreakerPolicy> policies = circuitBreakerProperties.getParsedEntity();
+    Assert.assertEquals(1, policies.size());
+    CircuitBreakerPolicy policy = policies.get("circuitBreaker0");
+    Assert.assertEquals(2, policy.getMinimumNumberOfCalls());
+    Assert.assertEquals(2, policy.getSlidingWindowSize());
+    Assert.assertEquals("demo-circuitBreaker.xx", policy.getRules().getMatch());
+    Assert.assertEquals(0, policy.getRules().getPrecedence());
+  }
+
+  @Test
+  public void test_rate_limit_properties_successfully_loaded() {
+    Map<String, RateLimitingPolicy> policies = rateLimitProperties.getParsedEntity();
+    Assert.assertEquals(1, policies.size());
+    RateLimitingPolicy policy = policies.get("rateLimiting0");
+    Assert.assertEquals(1, policy.getRate());
+    Assert.assertEquals("demo-rateLimiting.match0", policy.getRules().getMatch());
+    Assert.assertEquals(0, policy.getRules().getPrecedence());
+  }
+
+  @Test
+  public void test_retry_properties_successfully_loaded() {
+    Map<String, RetryPolicy> policies = retryProperties.getParsedEntity();
+    Assert.assertEquals(1, policies.size());
+    RetryPolicy policy = policies.get("retry0");
+    Assert.assertEquals(3, policy.getMaxAttempts());
+    Assert.assertEquals("demo-retry.xx", policy.getRules().getMatch());
+    Assert.assertEquals(0, policy.getRules().getPrecedence());
+  }
+}
diff --git a/governance/src/test/java/org/apache/servicecomb/governance/MockMatchersService.java b/governance/src/test/java/org/apache/servicecomb/governance/MockMatchersService.java
new file mode 100644
index 0000000..1387312
--- /dev/null
+++ b/governance/src/test/java/org/apache/servicecomb/governance/MockMatchersService.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance;
+
+import java.util.List;
+
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.marker.GovHttpRequest;
+import org.apache.servicecomb.governance.service.MatchersService;
+
+@Component
+public class MockMatchersService implements MatchersService {
+  @Override
+  public List<String> getMatchedNames(GovHttpRequest govHttpRequest) {
+    return null;
+  }
+}
diff --git a/governance/src/test/java/org/apache/servicecomb/governance/MockRetryExtension.java b/governance/src/test/java/org/apache/servicecomb/governance/MockRetryExtension.java
new file mode 100644
index 0000000..21a2527
--- /dev/null
+++ b/governance/src/test/java/org/apache/servicecomb/governance/MockRetryExtension.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.governance;
+
+import java.util.List;
+
+import org.springframework.stereotype.Component;
+
+import org.apache.servicecomb.governance.handler.ext.RetryExtension;
+
+@Component
+public class MockRetryExtension implements RetryExtension {
+  @Override
+  public boolean isRetry(List<Integer> statusList, Object result) {
+    return false;
+  }
+
+  @Override
+  public Class<? extends Throwable>[] retryExceptions() {
+    return null;
+  }
+}
diff --git a/governance/src/test/resources/META-INF/spring/bean.xml b/governance/src/test/resources/META-INF/spring/bean.xml
new file mode 100644
index 0000000..7d5c1b0
--- /dev/null
+++ b/governance/src/test/resources/META-INF/spring/bean.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:cse="http://www.huawei.com/schema/paas/cse/rpc"
+  xsi:schemaLocation="
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+
+  <context:component-scan base-package="com.huaweicloud.governance,org.apache.servicecomb.governance"/>
+</beans>
diff --git a/governance/src/test/resources/application.yaml b/governance/src/test/resources/application.yaml
new file mode 100644
index 0000000..69925df
--- /dev/null
+++ b/governance/src/test/resources/application.yaml
@@ -0,0 +1,62 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+servicecomb:
+  matchGroup:
+    demo-rateLimiting: |
+      matches:
+        - apiPath:
+            exact: "/hello"
+          name: match0
+    demo-retry: |
+      matches:
+        - apiPath:
+            exact: "/retry"
+          name: xx
+    demo-circuitBreaker: |
+      matches:
+        - apiPath:
+            exact: "/circuitBreaker"
+          name: xx
+    demo-bulkhead: |
+      matches:
+        - apiPath:
+            exact: "/bulkhead"
+          name: xx
+  rateLimiting:
+    rateLimiting0: |
+      rules:
+        match: demo-rateLimiting.match0
+      rate: 1
+  retry:
+    retry0: |
+      rules:
+        match: demo-retry.xx
+      maxAttempts: 3
+  circuitBreaker:
+    circuitBreaker0: |
+      rules:
+        match: demo-circuitBreaker.xx
+      minimumNumberOfCalls: 2
+      slidingWindowSize: 2
+  bulkhead:
+    bulkhead0: |
+      rules:
+        match: demo-bulkhead.xx
+        precedence: 100
+      maxConcurrentCalls: 1
+      maxWaitDuration: 3000
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 74455e6..28e172a 100755
--- a/pom.xml
+++ b/pom.xml
@@ -126,6 +126,7 @@
     <module>inspector</module>
     <module>solutions</module>
     <module>clients</module>
+    <module>governance</module>
     <module>huawei-cloud</module>
   </modules>