107 Commits

Author SHA1 Message Date
杨翊 SionYang 709bd78ab6 [ISSUE #15475] Integrate environment plugin pre-context configuration (#15590)
* [ISSUE #15475] Integrate environment plugin pre-context configuration

Unify environment plugin discovery, static configuration apply, and startup handoff through PRE_CONTEXT initialization.

Assisted-by: Claude Code

* Fix environment plugin initialization test

Assisted-by: Claude Code
2026-07-27 19:49:53 +08:00
杨翊 SionYang 70cb7290aa Use Nacos self-hosted runners for CI workflows. (#15480)
* Use Nacos self-hosted runners for CI workflows.

* Stabilize IPv6 preference tests in CI

Assisted-by: Claude Code
2026-07-09 13:29:15 +08:00
杨翊 SionYang 1f9f6ccc8e Remove confirmed unused Java code (#15358)
* Remove confirmed unused Java code

Remove validated unused helpers, constants, classes, and matching dedicated tests across Java modules.

Deprecate currently unused datasource mapper methods so downstream plugin usage can be confirmed before removal.

Validation:

- mvn spotless:check

- mvn -B clean compile apache-rat:check checkstyle:check spotbugs:check spotless:check -DskipTests

- mvn -B '-Prelease-nacos,!dev' clean install -Drat.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -DskipTests=false

- mvn -B clean install -Prelease-nacos -DskipTests=true

- mvn -B clean verify -Pintegration-test

- mvn -B -pl test/java-sdk-test clean verify -Pjava-sdk-integration-test -DskipTests=false

- mvn -B -pl test/maintainer-sdk-test clean verify -Pmaintainer-sdk-integration-test -DskipTests=false

Assisted-by: Codex

* Fix flaky unit test setup

Reuse the same version 0.2.0 tar.gz fixture bytes for digest validation and HTTP response payloads, and initialize EnvUtil in GlobalExecutorTest when the test runs without suite-level environment setup.

Assisted-by: Codex

* Fix config test isolation

Assisted-by: Claude Code

* Fix flaky failover reactor test

Assisted-by: Claude Code
2026-06-16 00:12:23 +08:00
杨翊 SionYang be6c0378fa test(sys): raise sys module line coverage to 99.59% (#15137)
* test(sys): raise sys module line coverage to 99.59%

Adds 38 unit tests covering previously-untested branches in DiskUtils,
EnvUtil, InetUtils, PropertiesUtil, TimerContext, ModuleStateHolder, and
WatchFileCenter, lifting sys module line coverage from ~91.4% to 99.59%.

The 4 lines still uncovered are documented as unreachable or impractical
to cover: UTF-8 decoder trailing flush in DiskUtils, IBM-JDK fallback in
OperatingSystemBeanManager static init, and the WatchDirJob constructor
catch (would require swapping a static final FileSystem reference).

Assisted-by: Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* style(sys): apply Spotless formatting to new coverage tests

Run mvn spotless:apply on sys module to fix the format violations
flagged by CI on the previous commit.

Assisted-by: Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 14:39:36 +08:00
cxhello 7dee0e036e [ISSUE #14815] build(style): apply Spotless formatting to copilot and sys modules (#15116)
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-05-09 18:01:16 +08:00
杨翊 SionYang 5dd475b15e Merge pull request #15030 from xuxiaowei-com-cn/xuxiaowei/function_mode
feat: add microservice/ai function mode, support disabling AI registry in console, and add Makefile for rapid development
2026-05-08 19:07:25 +08:00
Guimu ccbd6167f5 fix(sys): make DiskUtils.readFile correct for multi-byte UTF-8 (#15068)
DiskUtils.readFile streams the file in 4096-byte chunks and feeds each
chunk to a CharsetDecoder. The current implementation has two related
correctness bugs that show up the moment a Nacos artifact contains
non-ASCII content:

1. The decoder is a process-wide `static final CharsetDecoder DECODER`.
   `CharsetDecoder` is documented as not safe for concurrent use, and
   it carries internal state across decode invocations. Sharing one
   instance across every caller violates both invariants.
2. After draining the chars from each chunk the loop calls
   `buffer.clear()`. When a multi-byte UTF-8 character straddles the
   4096-byte boundary the decoder reports UNDERFLOW and leaves the
   leading bytes of that character in the buffer; clear() then
   discards them. The next read starts on an orphaned UTF-8
   continuation byte, the decoder reports malformed input, and the
   rest of the file is silently truncated.

Concretely, a file laid out as 4094 ASCII bytes + '中' (3-byte CJK,
E4 B8 AD) + 200 ASCII bytes round-trips back as just 4094 ASCII chars
with the trailing '中' and 200 ASCII bytes lost.

Fix both at the same time, since they are two halves of "stream UTF-8
correctly" inside the same loop:

- Allocate a fresh `CharsetDecoder` per call.
- Replace `buffer.clear()` with `buffer.compact()` so unconsumed
  trailing bytes survive into the next read.
- After EOF, finalize the stream with `decoder.decode(buffer, ..., true)`
  + `decoder.flush(...)` so any tail bytes the decoder is still
  holding are flushed into the output.

Tests in DiskUtilsTest:

- testReadFileWithMultiByteUtf8AcrossChunkBoundary builds the file
  layout above, asserts the byte indices of '中' against the buffer
  boundary, and asserts the exact round-trip. It fails
  deterministically against the previous code (the trailing 200
  bytes vanish) and passes after the fix.
- testReadFileWithSmallMultiByteUtf8Content covers the single-chunk
  non-ASCII regression.
- testReadFileSequentialCallsAreIndependent guards the decoder-state
  isolation that the per-call allocation buys.

This addresses the same anti-pattern as #15065 / #15073 in the sys
copy of DiskUtils. Multiple production callers (NacosCoreStartUp,
DerbySnapshotOperation, DistributedDatabaseOperateImpl,
PluginStateSnapshotOperation, AbstractServerStateHandler,
SwitchManager via readFileBytes, …) go through this readFile.

Assisted-by: Claude Code
2026-05-08 19:01:41 +08:00
徐晓伟 4baa7eb6e5 feat: add AI function mode support across all modules 2026-05-07 17:35:38 +08:00
徐晓伟 2bcdf7bd38 refactor(core): rename function mode from simple to microservice
- Update Makefile targets: simple -> microservice
- Rename FunctionMode.SIMPLE to FunctionMode.MICROSERVICE
- Update ConditionFunctionEnabled to use new mode name
- Adjust startup scripts and configuration references
- Code formatting improvements in filter classes
2026-05-07 15:10:55 +08:00
徐晓伟 bb3f3df225 feat(core): add simple function mode and Makefile for development
- Add FUNCTION_MODE_SIMPLE constant to support simple mode
- Update ConditionFunctionEnabled to enable both config and naming in simple mode
- Add unit tests for simple mode functionality
- Add Makefile with build and run targets for different function modes
- Update startup script and UI components to support simple mode

Simple mode enables both config and naming services simultaneously, providing
a convenient option for development and testing scenarios.
2026-05-06 02:33:19 +08:00
杨翊 SionYang c6af9bd9e4 test(sys): add unit tests to improve coverage for missing lines (#14991)
* test(sys): add unit tests to improve coverage for missing lines

* fix(sys): correct test compilation errors

- AbstractModuleStateBuilderTest: add moduleName parameter to ModuleState constructor
- DeploymentTypeTest: fix getTypeName assertion (server_with_mcp -> serverWithMcp)
2026-04-28 14:28:32 +08:00
杨翊 SionYang 3f9d890465 chore(config): remove default property files and enable servlet encoding. (#14854)
chore(config): enable and configure UTF-8 servlet encoding.
2026-04-03 17:38:24 +08:00
cxhello 8edc805a64 refactor(build): use targeted SpotBugs exclusions instead of @SuppressFBWarnings (#14532)
Replace @SuppressFBWarnings annotations with class-level exclusions in
spotbugs-exclude.xml for LruCache and ApplicationUtils, as suggested
in code review.

Fixes https://github.com/alibaba/nacos/issues/14511

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-03-04 19:00:07 +08:00
cxhello e46f4f5b27 fix(common): add explicit charset to avoid platform-dependent encoding (#14533) (#14535)
Add explicit StandardCharsets.UTF_8 to all DM_DEFAULT_ENCODING
occurrences reported by SpotBugs under threshold=High, and remove
the global exclusion from spotbugs-exclude.xml.

Affected modules: client-basic, client, common, config, core,
k8s-sync, naming, sys.

Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-03-04 16:52:48 +08:00
codez 0b49892744 Refactor: Remove obsolete p3c-pmd plugin and cleanup annotations (#14455) (#14461) 2026-02-11 13:34:53 +08:00
cxhello ea494b0712 feat: grpc server startup support listen on specified ip (#13592)
* feat: grpc server startup support listen on specified ip

* feat: grpc server startup support listen on specified ip

* feat: grpc server startup support listen on specified ip

* feat: grpc server startup support listen on specified ip
2025-07-16 16:00:24 +08:00
杨翊 SionYang c49d5bcd60 For #13377, merge mcp registry and mcp api changed to develop. (#13398)
* Feat support mcp registry api (#13376)

* Support tag fuzzy search  (#13387)

* support tag fuzzy search

* support tag fuzzy search

* Merge pull request #13391 from luoxiner/support-mcp-multi-version

Feat Support Mcp Registry

* Add copyright for mcp-adapter pom.

* Support version in ai maintainer sdk and fix some errors when build (#13401)

* add version for ai maintainer sdk and support display mcp server config

* fix pmd errors

* fix empty endpoint

* remote publish api

* fix tag fuzzy search sql unit test (#13402)

* Fix unit test.

---------

Co-authored-by: Xin Luo <65529035+luoxiner@users.noreply.github.com>
Co-authored-by: Sunrisea <49605583+Sunrisea@users.noreply.github.com>
Co-authored-by: luoxin.luo <luoxin.luo@alibaba-inc.com>
2025-05-21 15:27:33 +08:00
KomachiSion 67313bfe50 Merge remote-tracking branch 'refs/remotes/upstream/develop' into v3.0-develop-sync-develop
# Conflicts:
#	api/src/main/java/com/alibaba/nacos/api/model/v2/ErrorCode.java
#	bootstrap/src/main/resources/application.properties
#	client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java
#	client/src/main/java/com/alibaba/nacos/client/naming/remote/gprc/NamingGrpcClientProxy.java
#	config/src/main/java/com/alibaba/nacos/config/server/aspect/CapacityManagementAspect.java
#	config/src/main/java/com/alibaba/nacos/config/server/aspect/ConfigChangeAspect.java
#	config/src/main/java/com/alibaba/nacos/config/server/aspect/RequestLogAspect.java
#	config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java
#	config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java
#	config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandler.java
#	config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigRemoveRequestHandler.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/ConfigGrayModelMigrateService.java
#	config/src/test/java/com/alibaba/nacos/config/server/aspect/ConfigChangeAspectTest.java
#	config/src/test/java/com/alibaba/nacos/config/server/controller/ConfigControllerTest.java
#	config/src/test/java/com/alibaba/nacos/config/server/controller/v2/ConfigControllerV2Test.java
#	config/src/test/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandlerTest.java
#	core/src/main/java/com/alibaba/nacos/core/remote/grpc/GrpcBiStreamRequestAcceptor.java
#	naming/src/main/java/com/alibaba/nacos/naming/controllers/v2/ClientInfoControllerV2.java
#	naming/src/test/java/com/alibaba/nacos/naming/controllers/ServiceControllerTest.java
#	plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysqlTest.java
#	pom.xml
#	sys/src/test/java/com/alibaba/nacos/sys/env/EnvUtilTest.java
2025-03-10 10:16:34 +08:00
杨翊 SionYang bcc298f2c6 Fix 3.0 cluster mode some problem. (#13158)
* Fix cluster mode deployment can't change the server port problem.

* Fix cluster mode can't get service subscribers in console.

* Fix cluster mode can't get config listener in console.
2025-03-07 10:02:49 +08:00
杨翊 SionYang 07c293a53c Refactor nacos default auth plugin to inject HTTP API by AutoConfiguration. (#13142)
* Support refresh nacos server member in console model.

* Mark old NamingMaintainService as deprecated.

* Use Import replace directly build Nacos Auth plugin bean in console.

* Using AutoConfiguration to inject nacos default auth plugin HTTP API.
2025-02-27 19:09:54 +08:00
杨翊 SionYang 2c025e20ec V3.0 develop console mode (#13134)
* Use Page to replace List result for some maintainer api.

* Support namespace page.

* uniform Namespace model to api。

* Support console get server state from nacos-server

* Fix update namespace invalid problem.

* console support setting admin password.

* Add Console maintainer client auth plugin to support identity request.

* Support Nacos Console get users info from nacos server.

* Support Nacos Console get role and permission info from nacos server.

* Fix NPE by AuthConfig loading Circular Dependencies.
2025-02-25 18:27:01 +08:00
杨翊 SionYang 8de4e36d7e Support nacos console deployment independent: PR 1 (#13072)
* Support start up with console only mode: step1 - basic start up.

* Support start up with console only mode: step2 - solve server state to fix console ui loading.
2025-01-24 17:53:53 +08:00
杨翊 SionYang 2d78d1c7d9 Upgrade 2.5.0 and bump console-ui dependencies by npm audix. (#13035)
* Upgrade to 2.5.0.

* Bump ui dependencies by npm audix.

* Fix unit test.

* Ignore DumpAllProcessorTest Tmp.
2025-01-13 17:38:44 +08:00
KomachiSion 7ccf2fbf53 Fix Unit test problem. 2025-01-10 14:35:50 +08:00
KomachiSion 87382160df Merge branch 'refs/heads/v3.0-develop' into summer-ospp#12028-sync-develop
# Conflicts:
#	auth/src/test/java/com/alibaba/nacos/auth/config/AuthConfigsTest.java
#	config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java
#	config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigPublishRequestHandler.java
#	config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandler.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/ConfigOperationService.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpChangeConfigWorker.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpConfigHandler.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpService.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/dump/processor/DumpAllProcessor.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/merge/MergeDatumService.java
#	config/src/test/java/com/alibaba/nacos/config/server/controller/v2/ConfigControllerV2Test.java
#	console/pom.xml
#	console/src/main/java/com/alibaba/nacos/console/config/ConsoleConfig.java
#	core/src/main/java/com/alibaba/nacos/core/auth/AuthFilter.java
#	core/src/main/java/com/alibaba/nacos/core/cluster/ServerMemberManager.java
#	core/src/main/java/com/alibaba/nacos/core/listener/StartingApplicationListener.java
#	core/src/main/resources/META-INF/logback/nacos.xml
#	core/src/test/java/com/alibaba/nacos/core/auth/AuthFilterTest.java
#	core/src/test/java/com/alibaba/nacos/core/cluster/ServerMemberManagerTest.java
#	distribution/conf/nacos-logback.xml
#	plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/NacosAuthConfig.java
#	plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/NacosAuthManager.java
#	plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/authenticate/AuthenticationManagerDelegator.java
#	plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/filter/JwtAuthenticationTokenFilter.java
#	pom.xml
#	prometheus/src/main/java/com/alibaba/nacos/prometheus/conf/PrometheusSecurityConfiguration.java
2025-01-08 11:19:35 +08:00
Moritz Arena b16b90048a Upgrade to SpringBoot 3 and support GraalVM packaging (#13020)
Upgrade to SpringBoot 3, JDK 17 and support GraalVM
2025-01-08 09:49:56 +08:00
杨翊 SionYang 05362b0b90 V3.0 develop starting listening enhance & fix console auth invalid problem. (#13001)
* Enhance StartingApplicationListener to reduce duplicate operation.

* Fix console auth invalid problem.
2024-12-30 17:51:49 +08:00
杨翊 SionYang 8478fd7204 Enhance to reuse duplicate spring beans to reduce memory usage. (#12990) 2024-12-25 15:17:06 +08:00
杨翊 SionYang 1609df97df [Nacos 3.0] Nacos support console and server start with different web container and port. (#12959)
* Support console and server api with depend port.

* enhance banners and support only start server mode.
2024-12-17 15:33:47 +08:00
杨翊 SionYang 255d269434 Fix unit test for v3.0. (#12896) 2024-11-26 15:06:51 +08:00
杨翊 SionYang a0fdc42ce5 Enhance Disk operation for DiskUtils (#12756)
* Add some check in DiskUtil and add unit test.

* simply DiskUtils in control plugin.
2024-10-17 16:08:42 +08:00
杨翊 SionYang 2bef3ad8f5 Develop sys ut (#12728)
* Add unit test for sys module.

* Add unit test for sys module.

* Fix unit test.

* Make unit test more stable.

* Make unit test more stable.
2024-10-14 15:48:13 +08:00
杨翊 SionYang a9a0df206e Add test logback configuration to remove spring debug log. (#12537) 2024-08-22 15:58:50 +08:00
kangzhao 3967c91d1a 修复mem计算逻辑 (#12401)
* 修复mem计算逻辑

* 修复mem计算逻辑单测

* fix ci
2024-07-31 14:29:25 +08:00
shalk(xiao kun) 2aa9fc51bc fix unexpect exception from NetworkInterface.ifUp (#12325) 2024-07-10 16:52:23 +08:00
shalk(xiao kun) 8034da88e5 [ISSUE #12016] upgrade to junit5 and remove junit4 (#12280)
* clean junit4

* clean junit4

* clean some test dep; fix scope

* fix test compile
2024-06-26 17:39:08 +08:00
hth 992f10a1d6 [ISSUE #11957] AuthModule add admin exist (#12066)
* AuthModule add admin exist

* test fix

* fix state

* add state cache

* rename to auth_admin_request

* test fix

* auth_admin_request default value fix

* fix admin request
2024-05-24 10:14:40 +08:00
shalk(xiao kun) 67b672251e upgrade module naocs-sys from junit4 to junit5 (#12107) 2024-05-16 09:40:12 +08:00
阿魁 5169f06654 Support TLS Grpc communication between clusters. (#11549)
* Fix exception code error.(#10925)

* [ISSUE #11456]Add RpcClusterClientTlsConfig.java.

* [ISSUE #11456]Add cluster rpc tls config.

* [ISSUE #11456]Add RpcClusterClientTlsConfig UT.

* [ISSUE #11456]Add cluster server tls.

* [ISSUE #11456]Remove supportCommunicationTypes.

* [ISSUE #11456]Fix unit testing and indentation handling

* [ISSUE #11456]Indentation handling

* [ISSUE #11456]Fix unit test and rpc constants.

* [ISSUE #11456]Fix unit test.

* [ISSUE #11456]Optimize code.

* [ISSUE #11456]Fix check style.

* [ISSUE #11456]Add unit test.

* [ISSUE #11456]Fix check style.

* [ISSUE #11456]Update unit test.

* [ISSUE #11456]Fix unit test.

* [ISSUE #11456]Add License.

* [ISSUE #11456]Fix unit test.

* [ISSUE #11456]Fix unit test.

* [ISSUE #11456]Rename class.

* [ISSUE #11456]Optimize code.

* [ISSUE #11456]Handling indentation issues.

* [ISSUE #11456]Handling indentation issues.

* [ISSUE #11456]Handling indentation issues.

* [ISSUE #11456]Optimize code.

* [ISSUE #11456]Fix unit test.

* [ISSUE #11456]Fix unit testing and compatibility handling.

* [ISSUE #11456]Support TLS GRPC communication between clusters.

* [ISSUE #11456] Fix bugs.

* [ISSUE #11456]Fix bugs.

* [ISSUE #11456]Adjusting parameter names (compatibility considerations).

* [ISSUE #11456]Resolve conflict.

* [ISSUE #11456]Remove ProtocolNegotiatorBuilderManager and abstract ProtocolNegotiatorBuilderSingleton.

* [ISSUE #11456]Remove CommunicationType.java.

* [ISSUE #11456]Optimize code.

* [ISSUE #11456]Revert author.

* Splitting RpcTlsConfigFactory.

* Split RpcConstants.

* Divided RpcTlsConfigFactory, adjusted cluster parameters to "nacos.remote.peer.rpc.tls".

* check style.

* check style.

* unit test.
2024-05-15 11:13:29 +08:00
nov.lzf c70a86820d config module coverage (#11592)
* coverage

* coverage

* coverage up tp 80% ,fix checkstyle pmd

* coverage up tp 80% ,fix checkstyle pmd

* fix checkstyle

* optmize grpc connection push

* testcase

* grp connection coverage
2024-01-08 14:25:15 +08:00
杨翊 SionYang 03987330a4 Upgrade dependency to reduce conflicts and add leak UT coverage files. (#11396)
* Remove custom jackson version and jackson-core-asl.

* Upgrade protobuf relative version to reduce conflict with grpc.

* 补充提交遗漏单测覆盖率的模块。
2023-11-17 17:56:50 +08:00
zhanghong a935fa1092 [ISSUE #11343] Simplified validation logic (#11345)
* 优化节点显示,添加mode

* Simplified validation logic

* add license

* fix unit test

* add config,console,naming unit test and rename annotation

* add config,console,naming unit test and rename annotation

* fix EnvUtils test

* fix EnvUtils test

* fix ParamExtractorFilterTest

* fix ParamExtractorFilterTest

* fix ParamExtractorFilterTest

* fix ParamExtractorFilterTest

* fix ParamExtractorFilterTest
2023-11-15 15:25:00 +08:00
阿魁 d85e3f7f31 [ISSUE #11231]Optimize the handleSpringBinder method in PropertiesUtil. (#11240) 2023-10-11 09:23:31 +08:00
ZhangShenao 043510b2f8 Fix Word Spelling (#10714) 2023-07-03 14:16:31 +08:00
KomachiSion 0555619b05 Merge remote-tracking branch 'upstream/develop' into develop#10361
# Conflicts:
#	config/src/main/java/com/alibaba/nacos/config/server/constant/Constants.java
2023-05-09 15:50:12 +08:00
zhanghong 5cf5829253 add configModuleState/raftModuleState/distroModuleState in branch develop#10153 (#10288)
* add configModuleState/raftModuleState/distroModuleState

* add configModuleState/raftModuleState/distroModuleState

* update TEST

* 修复test bug

* 移除ip暴露风险
2023-05-08 18:05:34 +08:00
KomachiSion 576225485e Move TimerContext to sys module and add new one single thread to snapshot for derby. 2023-04-25 14:46:38 +08:00
KomachiSion 802bacafbe Add module enabled packages scan filter. 2023-04-23 15:57:46 +08:00
杨翊 SionYang 0e0a73e025 Revert "[issue #10148]Replace sync forward request with async request (#10158)" (#10358)
This reverts commit a273705b8d.
2023-04-20 20:12:33 +08:00
Zhaohui Yu a273705b8d [issue #10148]Replace sync forward request with async request (#10158)
* Replace sync forward request with async request in DistroFilter. issue #10148

* extract method for config default headers

* add env switch for async distro forward.

* Fixed code review problems:
1. Move async forward switch from sys module to naming module.
2. use nacos code style to format code.

* Fixed nacos code checkstyle:
1. one import per Class
2. add javadoc

* In order to avoid additional overhead, move switch from GlobalConfig to ClientConfig and cache the env switch.

* Move switch from ClientConfig to DistroConfig.

* Removed unused import.

* Add test for async forward for DistroFilter

* Add license

* rename test method name

* Should enable async forward

* fixed test

* set async forward request switch to true in test

* fixed test: create and set property with MockEnvironment

* fixed check style

* move MockEnvironment init to BeforeClass

* add setter for asyncForwardRequest switch
2023-04-20 20:10:26 +08:00