提交 9faf401a authored 作者: 陈世营's avatar 陈世营

【修改】 添加配置 leaf-namespace

上级 2db3fcb4
...@@ -127,7 +127,7 @@ public final class LeafSegmentKeyGenerator implements LeafKeyGenerator { ...@@ -127,7 +127,7 @@ public final class LeafSegmentKeyGenerator implements LeafKeyGenerator {
private RegistryCenterConfiguration getRegistryCenterConfiguration() { private RegistryCenterConfiguration getRegistryCenterConfiguration() {
RegistryCenterConfiguration result = new RegistryCenterConfiguration(getRegistryCenterType(), properties); RegistryCenterConfiguration result = new RegistryCenterConfiguration(getRegistryCenterType(), properties);
result.setNamespace(DEFAULT_NAMESPACE); result.setNamespace(properties.getProperty("leaf.namespace", DEFAULT_NAMESPACE));
result.setServerLists(getServerList()); result.setServerLists(getServerList());
result.setDigest(getDigest()); result.setDigest(getDigest());
return result; return result;
......
...@@ -33,6 +33,7 @@ public final class LeafSegmentKeyGeneratorTest { ...@@ -33,6 +33,7 @@ public final class LeafSegmentKeyGeneratorTest {
@Test @Test
public void assertGenerateKeyWithSingleThread() { public void assertGenerateKeyWithSingleThread() {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty("leaf.namespace","leaf-segment-loit-test");
properties.setProperty("server.list", "127.0.0.1:2181"); properties.setProperty("server.list", "127.0.0.1:2181");
properties.setProperty("leaf.segment.id.initial.value", "100001"); properties.setProperty("leaf.segment.id.initial.value", "100001");
properties.setProperty("leaf.segment.step", "5"); properties.setProperty("leaf.segment.step", "5");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论