Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sermant-springboot-registry): 添加 Nacos 注册中心支持 #1688

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/backend_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,3 @@ jobs:
uses: ./.github/actions/scenarios/backend/config
- name: start hot plugging test
uses: ./.github/actions/scenarios/backend/hot-plugging


20 changes: 20 additions & 0 deletions sermant-plugins/sermant-springboot-registry/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ sermant.springboot.registry:
realmName: www.domain.com
# Whether to enable traffic statistics, after it is enabled, the traffic entering the plug-in will be printed every time
enableRequestCount: false
# The type of the registry center, currently supports NACOS and ZOOKEEPER
registryCenterType: ZOOKEEPER

sermant.springboot.registry.lb:
# The load balancer type currently supports RoundRobin、Random、WeightedResponseTime、
Expand All @@ -28,3 +30,21 @@ sermant.springboot.registry.lb:
# For retry scenarios, for {@link java.util.concurrent.TimeoutException}, whether you need to retry, which is enabled
# by default, and this timeout is mostly used in asynchronous scenarios, such as Future, MinimalHttpAsyncClient
enableTimeoutExRetry: true

nacos.config:
# Whether to enable authentication
enableAuth: false
# nacos verifies accounts
username: ""
# nacos verifies password need encrypts
password: ""
# Specify the AES privateKey that encrypts and decrypts the password
privateKey: ""
# Namespace, the nacos configuration creates the id value of the namespace
namespace: ""
# Service instance weight value
weight: 1
# Cluster name
clusterName: DEFAULT
# Whether it is a temporary node. The value can be true or false
ephemeral: true
lilai23 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public class DiscoveryPluginConfig implements PluginConfig {
*/
private boolean enableRegistry = true;

/**
* Registry type, currently supports NACOS and ZOOKEEPER;
*/
private RegisterType registerType = RegisterType.ZOOKEEPER;

public boolean isEnableRegistry() {
return enableRegistry;
}
Expand All @@ -65,4 +70,12 @@ public boolean isEnableRequestCount() {
public void setEnableRequestCount(boolean enableRequestCount) {
this.enableRequestCount = enableRequestCount;
}

public RegisterType getRegisterType() {
return registerType;
}

public void setRegisterType(RegisterType registerType) {
this.registerType = registerType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ public class LbConfig implements PluginConfig {
*/
private String registryAddress = "127.0.0.1:2181";

/**
* Registry type, currently only ZK is supported
*/
private String registryCenterType = "Zookeeper";

/**
* When it is enabled, if other registries are the same as the registries of this plugin and are registered to the
* registry at the same time, the registries that are not registered by the plugin will be automatically excluded
Expand Down Expand Up @@ -309,14 +304,6 @@ public void setOnlyCurRegisterInstances(boolean onlyCurRegisterInstances) {
this.onlyCurRegisterInstances = onlyCurRegisterInstances;
}

public String getRegistryCenterType() {
return registryCenterType;
}

public void setRegistryCenterType(String registryCenterType) {
this.registryCenterType = registryCenterType;
}

public String getZkServerVersion() {
return zkServerVersion;
}
Expand Down
Loading
Loading