File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
spring-cloud-tencent-plugin-starters/spring-cloud-tencent-unit-plugin/src/main/java/com/tencent/cloud/plugin/unit Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 88- [ fix: replace with string inside @ConditionalOnClass .] ( https://github.com/Tencent/spring-cloud-tencent/pull/1750 )
99- [ feat: support TagUtils, ContextToHeaderInterceptor in TSF.] ( https://github.com/Tencent/spring-cloud-tencent/pull/1754 )
1010- [ deps: upgrade to spring boot 3.4.12.] ( https://github.com/Tencent/spring-cloud-tencent/pull/1756 )
11+ - [ fix: send unit header in tsf gw.] ( https://github.com/Tencent/spring-cloud-tencent/pull/1758 )
Original file line number Diff line number Diff line change 1818package com .tencent .cloud .plugin .unit .config ;
1919
2020import com .tencent .cloud .common .tsf .ConditionalOnOnlyTsfConsulEnabled ;
21+ import com .tencent .cloud .plugin .unit .plugin .UnitScgEnhancedPlugin ;
2122import com .tencent .tsf .unit .core .GatewayUnitArchCallback ;
2223import com .tencent .tsf .unit .core .TencentUnitManager ;
2324import com .tencent .tsf .unit .core .TsfZoneFilterUnitCallback ;
2627
2728import org .springframework .beans .factory .annotation .Value ;
2829import org .springframework .boot .autoconfigure .condition .ConditionalOnClass ;
30+ import org .springframework .context .annotation .Bean ;
2931import org .springframework .context .annotation .Configuration ;
3032
3133
@@ -44,6 +46,11 @@ static class GatewayUnitEnable {
4446 private String applicationName ;
4547
4648
49+ @ Bean
50+ public UnitScgEnhancedPlugin unitScgEnhancedPlugin () {
51+ return new UnitScgEnhancedPlugin ();
52+ }
53+
4754 @ PostConstruct
4855 public void init () {
4956 TencentUnitManager .addArchCallback (new GatewayUnitArchCallback (applicationName ));
Original file line number Diff line number Diff line change 2727import com .tencent .cloud .rpc .enhancement .plugin .EnhancedPluginType ;
2828import com .tencent .cloud .rpc .enhancement .plugin .PluginOrderConstant ;
2929import com .tencent .tsf .unit .core .TencentUnitContext ;
30+ import com .tencent .tsf .unit .core .TencentUnitManager ;
3031import shade .polaris .com .google .common .collect .ImmutableMap ;
3132
3233import org .springframework .http .server .reactive .ServerHttpRequest ;
@@ -50,6 +51,10 @@ public void run(EnhancedPluginContext context) throws Throwable {
5051 return ;
5152 }
5253
54+ if (!TencentUnitManager .isEnable ()) {
55+ return ;
56+ }
57+
5358 // get request builder
5459 ServerHttpRequest .Builder builder = exchange .getRequest ().mutate ();
5560
You can’t perform that action at this time.
0 commit comments