Skip to content

Commit 78ea08d

Browse files
authored
Merge pull request #57 from chuntaojun/dubbo-3.2.x
fix:修复token的设置&调整metareport的逻辑
2 parents e8b4b2f + fdf00ba commit 78ea08d

File tree

21 files changed

+207
-52
lines changed

21 files changed

+207
-52
lines changed

dubbo/dubbo-examples/dubbo-router-example/dubbo-backend-example/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@
102102
<artifactId>junit</artifactId>
103103
<scope>test</scope>
104104
</dependency>
105+
<dependency>
106+
<groupId>com.tencent.polaris</groupId>
107+
<artifactId>dubbo-api-example</artifactId>
108+
<version>0.2.0-3.2.7</version>
109+
<scope>compile</scope>
110+
</dependency>
105111
</dependencies>
106112

107113
<build>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Configuration status="WARN">
2+
<Appenders>
3+
<Console name="Console" target="SYSTEM_OUT" follow="true">
4+
<PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
5+
</Console>
6+
</Appenders>
7+
<Loggers>
8+
<Root level="info">
9+
<AppenderRef ref="Console"/>
10+
</Root>
11+
</Loggers>
12+
</Configuration>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
dubbo.application.name=dubbo-router-backend
2-
dubbo.application.register-mode=all
2+
dubbo.application.register-mode=instance
3+
dubbo.application.metadata-type=remote
4+
dubbo.application.qosEnable=false
35
dubbo.registry.address=polaris://${POLARIS_DISCOVERY_ADDR}
46
dubbo.config-center.address=polaris://${CONFIG_CENTER_ADDR}
57
dubbo.metadata-report.address=polaris://${METADATA_REPORT_ADDR}
68
dubbo.protocol.name=dubbo
7-
dubbo.protocol.port=27000
8-
dubbo.provider.filter=polaris_router
9+
dubbo.protocol.port=${DUBBO_PORT}

dubbo/dubbo-examples/dubbo-router-example/dubbo-front-example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<version>${revision}</version>
8585
</dependency>
8686

87-
<!-- 引入 polaris 限流能力 -->
87+
<!-- 引入 polaris 路由能力 -->
8888
<dependency>
8989
<groupId>com.tencent.polaris</groupId>
9090
<artifactId>dubbo-router-polaris</artifactId>

dubbo/dubbo-examples/dubbo-router-example/dubbo-front-example/src/main/java/com/tencent/polaris/dubbo/router/front/example/MiddleConsumer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ public class MiddleConsumer {
2929
private MiddleService middleService;
3030

3131
public String sayHello(String name) {
32-
RpcContext.getClientAttachment().setAttachment("name", name);
32+
RpcContext.getClientAttachment().setAttachment("user", name);
3333
String ret = middleService.sayHello(name);
3434
return "[FrontService] sayHello, " + name + " -> " + ret;
3535
}
3636

3737
public String sayHi(String name) {
38-
RpcContext.getClientAttachment().setAttachment("name", name);
38+
RpcContext.getClientAttachment().setAttachment("user", name);
3939
String ret = middleService.sayHello(name);
4040
return "[FrontService] sayHi, " + name + " -> " + ret;
4141
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Configuration status="WARN">
2+
<Appenders>
3+
<Console name="Console" target="SYSTEM_OUT" follow="true">
4+
<PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
5+
</Console>
6+
</Appenders>
7+
<Loggers>
8+
<Root level="info">
9+
<AppenderRef ref="Console"/>
10+
</Root>
11+
</Loggers>
12+
</Configuration>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
dubbo.application.name=dubbo-router-front
2-
dubbo.application.register-mode=all
2+
dubbo.application.register-mode=instance
3+
dubbo.application.metadata-type=remote
4+
dubbo.application.qosEnable=false
35
dubbo.registry.address=polaris://${POLARIS_DISCOVERY_ADDR}
46
dubbo.config-center.address=polaris://${CONFIG_CENTER_ADDR}
57
dubbo.metadata-report.address=polaris://${METADATA_REPORT_ADDR}
68
dubbo.protocol.name=dubbo
7-
dubbo.protocol.port=25000
8-
dubbo.provider.filter=polaris_router
9+
dubbo.protocol.port=${DUBBO_PORT}

dubbo/dubbo-examples/dubbo-router-example/dubbo-middle-example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<version>${revision}</version>
8585
</dependency>
8686

87-
<!-- 引入 polaris 限流能力 -->
87+
<!-- 引入 polaris 路由能力 -->
8888
<dependency>
8989
<groupId>com.tencent.polaris</groupId>
9090
<artifactId>dubbo-router-polaris</artifactId>

dubbo/dubbo-examples/dubbo-router-example/dubbo-middle-example/src/main/java/com/tencent/polaris/dubbo/router/middle/example/MiddleServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public class MiddleServiceImpl implements MiddleService {
3131

3232
@Override
3333
public String sayHello(String name) {
34-
RpcContext.getClientAttachment().setAttachment("name", name);
34+
RpcContext.getClientAttachment().setAttachment("user", name);
3535
String ret = backendService.sayHello(name);
3636
return "[MiddleService-" + System.getenv("ENV") + "] sayHello, " + name + " -> " + ret;
3737
}
3838

3939
@Override
4040
public String sayHi(String name) {
41-
RpcContext.getClientAttachment().setAttachment("name", name);
41+
RpcContext.getClientAttachment().setAttachment("user", name);
4242
String ret = backendService.sayHello(name);
4343
return "[MiddleService-" + System.getenv("ENV") + "] sayHi, " + name + " -> " + ret;
4444
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Configuration status="WARN">
2+
<Appenders>
3+
<Console name="Console" target="SYSTEM_OUT" follow="true">
4+
<PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
5+
</Console>
6+
</Appenders>
7+
<Loggers>
8+
<Root level="info">
9+
<AppenderRef ref="Console"/>
10+
</Root>
11+
</Loggers>
12+
</Configuration>

0 commit comments

Comments
 (0)