Commit Graph

923 Commits

Author SHA1 Message Date
blake.qiu
910c2059b7
fix(#10831): When using the deregisterInstance method to remove one of multiple instances registered by batchRegisterInstance, all instances registered by batchRegisterInstance will be removed. (#10836) 2023-07-28 09:47:09 +08:00
huhongjie2014
149c50f417
[ISSUE #10792]When nacos client use endpoint, the registration center should support configuring context-path and cluster-name like the configuration center (#10793) 2023-07-25 09:43:15 +08:00
blake.qiu
556e4ccd58
fix(#10585): selectInstances and selectOneHealthyInstance methods, if the parameter subscribe is true. Subscription is required when clientProxy.isSubscribe() is false. (#10805) 2023-07-17 10:55:54 +08:00
杨翊 SionYang
9069730a04
Refactor grpc tls (#10759)
* Move Tls negotiator to GrpcSdkServer.

* use protocol negotiator builder replace directly create.

* use SPI load negotiator and set tls as default negotiator.

* Remove tlsconfig in BaseRpcServer.

* Add some ut.

* For checkstyle.
2023-07-11 19:10:00 +08:00
Daydreamer-ia
d4e9b836d2 fix checkstyle and fix bug 2023-06-22 17:08:04 +08:00
Daydreamer-ia
fc3bb2f42c Merge branch 'develop' into asoc#8458.t
# Conflicts:
#	client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java
#	common/src/main/java/com/alibaba/nacos/common/remote/client/ConnectionEventListener.java
#	common/src/main/java/com/alibaba/nacos/common/remote/client/RpcClient.java
#	common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClient.java
#	common/src/test/java/com/alibaba/nacos/common/remote/client/grpc/GrpcClientTest.java
#	core/src/main/java/com/alibaba/nacos/core/cluster/ServerMemberManager.java
#	core/src/main/java/com/alibaba/nacos/core/remote/grpc/GrpcBiStreamRequestAcceptor.java
#	core/src/main/java/com/alibaba/nacos/core/remote/grpc/GrpcRequestAcceptor.java
2023-06-22 15:33:05 +08:00
nov.lzf
0ba772658d
replace nacos cache with guava cache (#10674)
* replace nacos cache with
guava cache tt fix memory leak

* checkstyle
2023-06-20 13:34:20 +08:00
Darren Luo
f40e5937ec
提交 native-image 的 Reachability Metadata (#10634) 2023-06-19 10:45:09 +08:00
1em0n9527
4de440d3f7
[ISSUE #10598] Fix nacos-client get the wrong index of the nacos server list when use nacos-address endpoint (#10599)
* fix nacos clent get the random index of nacos server list bug

* Update ServerListManager.java
2023-06-14 10:56:24 +08:00
nov.lzf
a8a43af837
fix naming memory leak (#10606)
* fix  naming memory leak

* fix test case

* fix test case
2023-06-07 13:28:08 +08:00
nov.lzf
83ee4c8e2c
1. notify thread change to one thread to avoid potential ClassLoader switch exception (#10555)
2. optimize current notify ,add receiveNotifyChanged flag
3. add notify block log for over 60s
4. add notify error & block stack trace
5. fix shutdown client worker memory leak  of server list change subscriber
6. use multi thread for different  task id  for sync with server to speed up config sync.
7. fix exception when request with 0 or negative timeouts.
8. simply local snapshot path  when env name over 50 chars
9. add a random sleep in health check for avoid health check syntony.
2023-05-26 17:01:06 +08:00
杨翊 SionYang
b3b5236cd4
Develop synced from 2.2.2 (#10307)
* Fix dynamic change token to illegal value will use old token.

* Add description in pom for release.

* Upgrade to 2.2.2

* Upgrade to 2.3.0-SNAPSHOT
2023-04-11 17:34:06 +08:00
杨翊 SionYang
e26dc2fb23
Merge pull request #10277 from alibaba/develop#10153
Develop#10153
2023-04-06 17:25:18 +08:00
chenyiqin
34cdb0890f
Expose way to add config filter (#10236)
* expose way to add config filter

* add @since

* fix since time
2023-04-06 15:21:21 +08:00
云野
06a2ea7004
failover file path should be like {user.home}/naming/{group}/failover/00-00---000-VIPSRV_FAILOVER_SWITCH-000---00-00. (#10272) 2023-04-06 15:07:16 +08:00
yuhaowin
c1e5446733
[ISSUE #10210] init NamingGrpcClientProxy Configure appName label. (#10234)
* For #10210, init NamingGrpcClientProxy Configure appName label.

* For #10210, format code
2023-04-03 12:16:20 +08:00
varyuan
2dde125a51
clean code (#10180)
* clean code

* clean code

* clean code

* clean code
2023-03-29 14:25:22 +08:00
杨翊 SionYang
7ae2f0a22c
[ISSUE#10208] Remove DefaultSettingPropertySource.java and add some unit test for I… (#10211)
* Remove DefaultSettingPropertySource.java and add some unit test for InitUtils

* For pmd
2023-03-28 22:39:40 +08:00
杨翊 SionYang
5fffde5bde
[ISSUE#10153] Add auth state into /state api and add announcement api. (#10203)
* Add ModuleState and use ModuleState replace ServerStateController.

* Add AuthModuleStateBuilder

* state接口使用ModuleState.

* Add announcement api.

* skip rat scan for announcement.conf

* default plugin open login page when auth.enabled=true.
2023-03-27 19:00:22 +08:00
githubcheng2978
214e0c9077
nacos grpc connection supports TLS Encryption (#9980)
support tls encryption on grpc transport on client and server side

---------

Co-authored-by: githubcheng2978 <yeliang.cheng@freemud.com>
2023-03-15 09:41:25 +08:00
杨翊 SionYang
81dda26709
Upgrade snakeYaml to 2.0 (#10092)
* Upgrade snakeYaml to 2.0

* Fix unit.
2023-03-14 13:15:51 +08:00
杨翊 SionYang
34a29e71dd
Use async appender to print log for nacos-client. (#10085) 2023-03-13 19:05:46 +08:00
杨翊 SionYang
383287c616
[ISSUE#10062] Naming support aliyun STS auth. (#10063)
* Naming support aliyun STS auth.

* Add UT for sts auth.

* Fix UT stability.
2023-03-10 09:18:41 +08:00
毛文超
f9695957fa
[ISSUES #10014] clear confused logic about namespace properties (#10023)
* [ISSUES #10014] clear confused logic about namespace properties

- add getPropertyFrom method
- optimize some code logic

Close #10014

* fix ci error
2023-03-09 10:05:37 +08:00
云野
62ef024da4
[ISSUE #10038]load failover file. (#10048)
* load failover file.

* fix text unit error.
2023-03-09 09:57:20 +08:00
毛文超
ec9e281f16
[ISSUES #10029] optimize SearchableProperties building code (#10030)
Close #10029
2023-03-02 10:08:52 +08:00
WangLiang/王良
a397c10a54
Optimize the nacos-client/pom.xml for exclude google/**/*.proto (#9982)
* Optimize the pom.xml of the nacos-client

* optimize pom

* exclude `google/**/*.proto`

* tab

* Remove dependency `io.grpc:protoc-gen-grpc-java:${version}:pom`

* revert indent

* revert native-image
2023-03-01 09:42:15 +08:00
胡俊
579571ceb3
[ISSUE #9860] abstract the nacos logback configurator to solve the problem between different version (#9934)
* logback update

* update comment

* ident update

* comment update

* judge version

* remove logback-adapter
2023-02-22 11:20:46 +08:00
ZhangShenao
882c6edb64
code optimization for ConfigChangeHandler (#9923) 2023-02-10 09:41:04 +08:00
MajorHe1
30954dc612
[ISSUE #9816] check expected final state before remove redo data. (#9907)
* [ISSUE #9816] check expected final state before remove redo data.

* check expected final state before remove subscriber redo data.

* update NamingGrpcRedoServiceTest when test remove

* update NamingGrpcRedoService, set expect register status to false when subscribers deregister
2023-02-08 09:38:37 +08:00
杨翊 SionYang
4db3e8c28f
[ISSUE #9816] Add expected final state for redo data. (#9893)
* Fix #9816, add expected final state to make redo task execute right finally.

* Upgrade version to 2.2.1-SNAPSHOT.
2023-02-03 14:13:08 +08:00
gongzhongqiang
708387c277
fix:replace nacos website url to https. (#9797) 2023-01-10 09:47:52 +08:00
云野
aa6ce2eadf
fix config auth failed. (#9807) 2023-01-09 13:16:01 +08:00
vivid
42d928264a
[ISSUE alibaba#9734] fix http login url ,add default port. (#9735) 2022-12-27 14:26:54 +08:00
nov.lzf
69047073c6
修改长连接request response 类注册逻辑,由类扫描改成手动注册 (#9738)
* 修改request response 类加载逻辑,有类扫描改成手动注册

* 优化注册方式,直接SPI注册payload
2022-12-21 19:56:21 +08:00
Weizhan Yun
c7bdc6a21e
增加检查服务端健康状态的功能。 (#9639) 2022-12-21 10:39:57 +08:00
陈浩 Nineteen
a7a5ced21a
fix no dataSet when nacos server started (#9677)
* Close Comment

* runci

* check style
2022-12-08 15:18:21 +08:00
chengyj1986xxx
f36e8dbd2a
fixed the issue of client get same server (#9616) 2022-11-25 14:47:09 +08:00
RapperCL
ba9b30da8e
[ISSUE #9391] Chooser optimization (#9392)
* Chooser use optimization

* codeStyle edit

* Array initial capacity optimization

* Constructor enhancements

* update

* empty

* update

* update
2022-11-09 09:49:36 +08:00
RapperCL
9b6a993622
[ISSUE #9478] fix the chooser bug when all instances have a zero weight (#9479)
* fix bug and add test

* code style

* code style

* code style

* Revert "code style"

This reverts commit c7c204ac0a7d93be3913a75f1ea51708af7e73f9.

* add license
2022-11-09 09:48:29 +08:00
Maksim-lk
c8c64a1c52
fix ClientWorker NullPointer judement order (#9461) 2022-11-04 14:14:23 +08:00
毛文超
82c2deae6c
[ISSUE #8622] sub pr of 9356 - config and naming module (#9455)
* [ISSUE #8622] resolve conflict

* [ISSUE #8622] fix unit test error
2022-11-04 14:03:51 +08:00
毛文超
46e6318809
[ISSUE #8622] sub pr of 9356 - logging module (#9450)
* [ISSUE #8622] sub pr of 9356 - logging module

- Replace system.getProperties and system.getEnv with  NacosClientProperties
- log4j and logback support reading properties from NacosClientProperties

relate #9356

* [ISSUE #8622] add unit tests for logging
2022-11-04 14:01:43 +08:00
毛文超
bd2b026bb4
[ISSUE #8622] sub pr of 9356 - util module (#9453)
- Replace system.getProperties and system.getEnv with NacosClientProperties

relate #9356
2022-11-03 13:54:41 +08:00
毛文超
645cd4a69a
[ISSUE #8622] sub pr of 9356 - auth module (#9447)
* [ISSUE #8622] sub pr of 9356 - auth module

- Replace system.getProperties and system.getEnv with  NacosClientProperties
- remove address server controller IT

relate #9356

* [ISSUE #8622] rollback about app name

* [ISSUE #8622] remove unused import

* [ISSUE #8622] retry ci
2022-11-03 13:48:59 +08:00
Karson
2596ff346c
optimize InstancesChangeNotifier. (#9416) 2022-10-31 11:07:34 +08:00
Maksim-lk
3ee357295b
fix NotifySubscriberRequest name (#9417) 2022-10-31 11:06:20 +08:00
陈浩 Nineteen
afa73fd4a3
fix batch Deregister Common (#9419) 2022-10-31 11:04:46 +08:00
KomachiSion
0428fe98a3 Make default naming async query subscribe as false. 2022-10-26 16:51:01 +08:00
杨翊 SionYang
0293af3329
Remove upd and beat codes in nacos-client. (#9394) 2022-10-25 17:22:47 +08:00
KomachiSion
696d489423 Merge remote-tracking branch 'upstream/2.2.0' into 2.2.0-summer#8312
# Conflicts:
#	plugin/pom.xml
2022-10-24 15:37:47 +08:00
陈浩 Nineteen
308d772a9a
feat/support Batch DeRegister (#9330)
* support Batch DeRegister

* Adjust the de registration method

* use batchRegisterService
2022-10-24 10:01:06 +08:00
杨翊 SionYang
7a23c56822
[ISSUE#7930] 2.2.0 remove some deprecated codes (#9368)
* Remove double write switch and upgrade from 1.X switch.

* Remove IFilterConfig.java

* Remove some deprecated constants and methods

* Remove some deprecated classes in nacos-core

* Remove some deprecated config

* Remove some deprecated codes in naming module

* Remove some deprecated codes in sys module

* Fix unit test

* Try to make UdpConnectorTest pass more easier.
2022-10-21 17:44:26 +08:00
杨翊 SionYang
0bfd75252b
Add switch for naming async query. (#9325) 2022-10-14 14:01:01 +08:00
nov.lzf
0fdda8c3fc
[ISSUE#7929] minijar pom update ,to reduce nacos-client jar size (#9299)
* minijar

* minijar,add google shaded

* fix naming response miss

* not shaded promethus snakeyaml

* release-sign-artifacts minijar
2022-10-12 14:13:28 +08:00
nov.lzf
c4d7c33b98
fix cache removed when listeneradd delay (#9311)
* fix listener  miss

* fixed cache remove on add listener delay
2022-10-12 14:08:19 +08:00
MajorHe1
8aa2e0a746
[ISSUE #9305] fix bug in ClientWorker.resourceBuild (#9306) 2022-10-12 09:22:26 +08:00
MajorHe1
1a1ef02754
Merge pull request #9293 from KomachiSion/develop-issue#9091
[ISSUE#9091] build pure nacos-client when release.
2022-10-11 14:19:08 +08:00
KomachiSion
a1b705406a build pure nacos-client when release. 2022-10-10 15:36:49 +08:00
RapperCL
c3b38a0a87
remove redundant judgment (#9284) 2022-10-10 14:54:46 +08:00
onewe
6278e7eadb
[ISSUE #8622] 移除 environment 概念 (#8991)
* [ISSUE #8622] 移除 environment 概念

* [ISSUE #8622] 使用尾递归优化循环

- SYS更名为ENV
- SHARED更改为PROTOTYPE

* [ISSUE #8622] rename lookingForProperties

* [ISSUE #8622] NProperties is renamed SearchableProperties and add some comments

* [ISSUE #8622] update some comments
2022-09-22 09:26:51 +08:00
Daydreamer-ia
5ec1d1f8b5 Change the format of ability table key to string, less time for format conversion when saving. 2022-09-20 15:24:46 +08:00
Daydreamer-ia
a8c3b847c0 Add the api to judge ability, add junit test. 2022-09-10 20:08:15 +08:00
Daydreamer-ia
2571bb6ca7 Combine junit test 2022-09-10 15:03:02 +08:00
Daydreamer-ia
12e447e690 Add the connection arg to ServerRequestHandler in order to get ability easily. 2022-09-10 14:46:30 +08:00
Daydreamer-ia
e3a3139c33 Save the ability table to Connection. 2022-09-10 13:53:48 +08:00
Karson
b36e6a50ab
[ISSUE #9013] Enhance Rpc config related to one RpcClientConfig (#9093)
* enhance rpc config related to one RpcClientConfig

* modify rpcclient unit test

* modify rpcclient unit test

* modify rpcclient unit test

* add RpcClient constructor with properties.

* modify some unit test
2022-09-07 09:43:45 +08:00
Daydreamer-ia
ac2523ab7d Add the priority to AbilityControlManager. 2022-09-03 14:11:55 +08:00
Daydreamer-ia
182b821938 Remove the component listening to cluster ability, disable the cluster capability table when the connected server does not support capability negotiation. 2022-09-02 21:56:03 +08:00
Daydreamer-ia
41d278d6f1 Add junit test 2022-09-01 20:31:48 +08:00
Daydreamer-ia
118cde52e7 Separate client capability and server capability: ClientAbilities and ServerAbilities. 2022-09-01 19:33:08 +08:00
liqipeng
30794c4b89
fix unsubscribe bug (#9062) 2022-09-01 09:59:51 +08:00
Daydreamer-ia
a47f052c90 Remove the AbilityHandlePreProcessor and AbilityStatus. Change the way to get or remove AbilityTable for RpcClient. 2022-08-30 21:36:24 +08:00
wuwen
aba8819bb6
Fix ServerListMgr is not shutdown. (#9048) 2022-08-30 10:20:15 +08:00
Daydreamer-ia
de9e113e24 Fix checkstyle 2022-08-28 19:10:55 +08:00
Daydreamer-ia
838c3d0ded Adapt the support of new ability control. 2022-08-28 18:20:35 +08:00
Daydreamer-ia
4275358975 Add the default implements for client and server. 2022-08-28 17:40:08 +08:00
Weizhan Yun
0ac96e1602
[ISSUE #9014] performance optimization--refacte TpsMonitorPoint (#9021)
* performance optimization

* fix check style

* fix test unit

* fix test unit for `getTimeFormatOfSecond` method.

* fix unit test  for LimiterTest.

* fix error usage case for asserEquals method;eliminate interactions between test methods
2022-08-26 09:57:34 +08:00
杨翊 SionYang
f1c95a8fb4
Fix grpc push data not filter by cluster. (#9019) 2022-08-24 09:56:37 +08:00
hujun3
861e8c5233 judge endpoint 2022-08-12 18:21:46 +08:00
onewe
8f8a1f3a2e
[ISSUE #8925] fix that the replaceAll operation is invalid (#8929)
Close #8925
2022-08-12 16:49:23 +08:00
onewe
493b99b726
[ISSUE #8925] fix that the value of hasQueryString is always false (#8927)
Close #8925
2022-08-11 14:31:09 +08:00
胡俊
65244c5de4
judge endpoint (#8933) 2022-08-11 14:16:59 +08:00
chenhao26
de5ec356cc
import config file auth fail (#8844)
* import config file auth fail

* run ci

* run ci2
2022-08-01 16:48:55 +08:00
liqipeng
e97b695db2
[ISSUE #8345] Check cluster name in server-side when registerInstance (#8724)
* Check cluster name in server-side when register ephemeral instance

* Check cluster name in server-side when register persistent instance

* add unit test for register instance

* add unit test for NamingHttpClientProxy

* remove catching NacosException to throw NacosRuntimeException
2022-07-25 09:57:43 +08:00
Cherish 蔡梦缘
837b1c13d9
[ISSUE #7039] Temporary fix encryptedContent bug. (#8463)
* fix(#7039): Temporary fix encryptedContent bug.

* fix(#7039): optimization the 2.x Temporary fix.

* cr(#7039): getConfigAndSignListener get a decryptContent.

* test(#7039): fix getConfigAndSignListener test.
2022-07-19 13:11:19 +08:00
ZhangShenao
e1ef9839e0
Remove Duplicated Check in Method com.alibaba.nacos.client.naming.cache.ServiceInfoHolder#isChangedServiceInfo (#8746)
* Use Fail-Fast in Method `com.alibaba.nacos.naming.core.ServiceManager#createServiceIfAbsent`

* Modify Comments

* Remove Duplicated Check in com.alibaba.nacos.client.naming.cache.ServiceInfoHolder#isChangedServiceInfo
2022-07-19 10:28:38 +08:00
onewe
704210e0c4
[ISSUES #8622] Add NacosEnvironment and add some unit tests (#8680)
* [ISSUES #8622] Add NacosEnvironment and add some unit tests

- remove magic number
- refactor all of them
- add some unit tests for env
- modify search rule and reformat
- fix search order
- fix p3c error

* fix ci error

* add some type converters

- enhance search method
- default_setting.properties is renamed nacos_default_setting.properties

* the property key of system environment replace dot with underscore

* add some default values and enhance SystemEnvPropertySource

* add the copyright information
2022-07-11 10:05:33 +08:00
chenhao26
b52fc22d37
batch register add some unit tests (#8702)
* add some junit for batch register

* code syle
2022-07-08 11:53:58 +08:00
MajorHe1
68b521679c
[ISSUE #8709] check serverList size before reconnect to server (#8710)
* [ISSUE #8709] check serverList size before reconnect to server

* use CollectionUtils.isEmpty to judge whether server list  is empty

Co-authored-by: Oliver <wqdyxnbd@163.com>

Co-authored-by: Oliver <wqdyxnbd@163.com>
2022-07-08 11:52:11 +08:00
chenhao26
073f9e09ed
[ISSUE#5863]add nacos client batchRegitserInstance request (#8675)
* add nacos client batchRegitserInstance request

* adjustment code

* fix word and do not remove indent
2022-07-07 10:56:22 +08:00
liqipeng
ff7bebac53
[ISSUE #8345] Check cluster name in client when registerInstance (#8618)
* Check cluster name in client when registerInstance

* Use `Pattern.compile` to check number to avoid performance lost.
2022-07-01 11:07:55 +08:00
liqipeng
b53827bcb9
fix typo (#8591) 2022-06-20 10:16:49 +08:00
Oliver
01fb64fb58
Fix typo (#8567) 2022-06-17 11:06:43 +08:00
Cherish 蔡梦缘
703925a84f
feat(#8472): [Dependency Governance] Remove useless dependencies. (#8472) (#8473) 2022-06-13 10:31:11 +08:00
david6969xin
b8b34b81cc
[ISSUE#8533] remove redundant signHeaders empty judgment (#8534) 2022-06-10 09:58:56 +08:00
david6969xin
ce41075de6
[ISSUE#8485] (module-client) replace the type specification in this constructor call with the diamond operator ("<>") (#8498) 2022-06-06 10:35:14 +08:00
Sivyer
e66a1903f3
optimize. config request monitor collect right request code. (#7770)
Co-authored-by: wangdong <wangdong@cdfinance.com.cn>
2022-06-04 14:25:57 +08:00
liqipeng
f7a28105b2
[ISSUE #8428] fix naming subscribe bug when multiple NamingService (#8433) 2022-05-27 14:05:05 +08:00
胡俊
e9094835cb
Solve the problem of adding logback listener repeatedly. (#8454) 2022-05-27 13:36:28 +08:00