-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
70 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
rpcman-core/src/main/java/cn/ipman/rpc/core/config/RegistryCenterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package cn.ipman.rpc.core.config; | ||
|
||
import cn.ipman.rpc.core.api.RegistryCenter; | ||
import cn.ipman.rpc.core.registry.ipman.IpManRegistryCenter; | ||
import cn.ipman.rpc.core.registry.zk.ZkRegistryCenter; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* Description for this class | ||
* | ||
* @Author IpMan | ||
* @Date 2024/4/21 20:39 | ||
*/ | ||
@Configuration | ||
public class RegistryCenterConfig { | ||
|
||
/** | ||
* 创建注册中心实例,默认为ZkRegistryCenter。 | ||
* @return RegistryCenter 注册中心实例 | ||
*/ | ||
@Bean(initMethod = "start", destroyMethod = "stop") | ||
@ConditionalOnMissingBean | ||
@ConditionalOnProperty(prefix = "rpcman.zk", value = "enabled", havingValue = "true") | ||
public RegistryCenter zkRc() { | ||
return new ZkRegistryCenter(); | ||
} | ||
|
||
|
||
@Bean(initMethod = "start", destroyMethod = "stop") | ||
@ConditionalOnProperty(prefix = "registry-ipman", value = "enabled", havingValue = "true") | ||
public RegistryCenter ipManRc() { | ||
return new IpManRegistryCenter(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ server: | |
|
||
rpcman: | ||
zk: | ||
enabled: false | ||
zkServer: localhost:2181 | ||
zkRoot: rpcman | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters