This is an automated email from the ASF dual-hosted git repository.

liuhongyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 8f65ce0947 feat: add other infra module template (#6067)
8f65ce0947 is described below

commit 8f65ce09475dd41315b95428febc3baf4e927fad
Author: shown <[email protected]>
AuthorDate: Mon Jul 28 15:41:35 2025 +0800

    feat: add other infra module template (#6067)
    
    * feat: add other infra module template
    
    Signed-off-by: shown.Ji <[email protected]>
    
    * feat: add ut
    
    Signed-off-by: shown.Ji <[email protected]>
    
    ---------
    
    Signed-off-by: shown.Ji <[email protected]>
---
 shenyu-infra/pom.xml                               |   4 +
 shenyu-infra/{ => shenyu-infra-etcd}/pom.xml       |  10 +-
 .../shenyu/infra/etcd/config/EtcdConfig.java       | 117 ++++++++++++
 .../org/apache/shenyu/infra/etcd/EtcdTests.java    |  21 +++
 shenyu-infra/{ => shenyu-infra-nacos}/pom.xml      |  10 +-
 .../shenyu/infra/nacos/config/NacosACMConfig.java  | 164 +++++++++++++++++
 .../shenyu/infra/nacos/config/NacosConfig.java     | 188 +++++++++++++++++++
 .../org/apache/shenyu/infra/nacos/NacosTests.java  |  21 +++
 shenyu-infra/{ => shenyu-infra-x-module}/pom.xml   |  10 +-
 .../java/org/apache/shenyu/infra/x/XConfig.java    |  21 +++
 .../java/org/apache/shenyu/infra/x/XTests.java     |  21 +++
 shenyu-infra/{ => shenyu-infra-zookeeper}/pom.xml  |  10 +-
 .../shenyu/infra/zookeeper/ZookeeperConfig.java    | 200 +++++++++++++++++++++
 .../shenyu/infra/zookeeper/ZookeeperTests.java     |  21 +++
 14 files changed, 786 insertions(+), 32 deletions(-)

diff --git a/shenyu-infra/pom.xml b/shenyu-infra/pom.xml
index 5a7e6f2e93..878c6f42ad 100644
--- a/shenyu-infra/pom.xml
+++ b/shenyu-infra/pom.xml
@@ -27,7 +27,11 @@
     <packaging>pom</packaging>
 
     <modules>
+        <module>shenyu-infra-etcd</module>
+        <module>shenyu-infra-nacos</module>
         <module>shenyu-infra-redis</module>
+        <module>shenyu-infra-x-module</module>
+        <module>shenyu-infra-zookeeper</module>
     </modules>
 
 </project>
diff --git a/shenyu-infra/pom.xml b/shenyu-infra/shenyu-infra-etcd/pom.xml
similarity index 86%
copy from shenyu-infra/pom.xml
copy to shenyu-infra/shenyu-infra-etcd/pom.xml
index 5a7e6f2e93..b6919f00cd 100644
--- a/shenyu-infra/pom.xml
+++ b/shenyu-infra/shenyu-infra-etcd/pom.xml
@@ -19,15 +19,9 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
     <parent>
         <groupId>org.apache.shenyu</groupId>
-        <artifactId>shenyu</artifactId>
+        <artifactId>shenyu-infra</artifactId>
         <version>2.7.0.2-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>shenyu-infra</artifactId>
-    <packaging>pom</packaging>
-
-    <modules>
-        <module>shenyu-infra-redis</module>
-    </modules>
-
+    <artifactId>shenyu-infra-etcd</artifactId>
 </project>
diff --git 
a/shenyu-infra/shenyu-infra-etcd/src/main/java/org/apache/shenyu/infra/etcd/config/EtcdConfig.java
 
b/shenyu-infra/shenyu-infra-etcd/src/main/java/org/apache/shenyu/infra/etcd/config/EtcdConfig.java
new file mode 100644
index 0000000000..5b2c47080d
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-etcd/src/main/java/org/apache/shenyu/infra/etcd/config/EtcdConfig.java
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.etcd.config;
+
+import java.util.StringJoiner;
+
+/**
+ * The type etcd configuration.
+ */
+public class EtcdConfig {
+
+    private String url;
+
+    private Integer sessionTimeout;
+
+    private Integer connectionTimeout;
+
+    private String serializer;
+
+    /**
+     * Get url.
+     *
+     * @return url
+     */
+    public String getUrl() {
+        return url;
+    }
+
+    /**
+     * Set url.
+     *
+     * @param url url
+     */
+    public void setUrl(final String url) {
+        this.url = url;
+    }
+
+    /**
+     * Get sessionTimeout.
+     *
+     * @return sessionTimeout
+     */
+    public Integer getSessionTimeout() {
+        return sessionTimeout;
+    }
+
+    /**
+     * Set sessionTimeout.
+     *
+     * @param sessionTimeout sessionTimeout
+     */
+    public void setSessionTimeout(final Integer sessionTimeout) {
+        this.sessionTimeout = sessionTimeout;
+    }
+
+    /**
+     * Get connectionTimeout.
+     *
+     * @return connectionTimeout
+     */
+    public Integer getConnectionTimeout() {
+        return connectionTimeout;
+    }
+
+    /**
+     * Set connectionTimeout.
+     *
+     * @param connectionTimeout connectionTimeout
+     */
+    public void setConnectionTimeout(final Integer connectionTimeout) {
+        this.connectionTimeout = connectionTimeout;
+    }
+
+    /**
+     * Get serializer.
+     *
+     * @return serializer
+     */
+    public String getSerializer() {
+        return serializer;
+    }
+
+    /**
+     * Set serializer.
+     *
+     * @param serializer serializer
+     */
+    public void setSerializer(final String serializer) {
+        this.serializer = serializer;
+    }
+
+    @Override
+    public String toString() {
+        return new StringJoiner(", ", EtcdConfig.class.getSimpleName() + "[", 
"]")
+                .add("url='" + url + "'")
+                .add("sessionTimeout=" + sessionTimeout)
+                .add("connectionTimeout=" + connectionTimeout)
+                .add("serializer='" + serializer + "'")
+                .toString();
+    }
+
+}
diff --git 
a/shenyu-infra/shenyu-infra-etcd/src/test/java/org/apache/shenyu/infra/etcd/EtcdTests.java
 
b/shenyu-infra/shenyu-infra-etcd/src/test/java/org/apache/shenyu/infra/etcd/EtcdTests.java
new file mode 100644
index 0000000000..8ece8ca8b2
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-etcd/src/test/java/org/apache/shenyu/infra/etcd/EtcdTests.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.etcd;
+
+public class EtcdTests {
+}
diff --git a/shenyu-infra/pom.xml b/shenyu-infra/shenyu-infra-nacos/pom.xml
similarity index 86%
copy from shenyu-infra/pom.xml
copy to shenyu-infra/shenyu-infra-nacos/pom.xml
index 5a7e6f2e93..6d1fcdd835 100644
--- a/shenyu-infra/pom.xml
+++ b/shenyu-infra/shenyu-infra-nacos/pom.xml
@@ -19,15 +19,9 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
     <parent>
         <groupId>org.apache.shenyu</groupId>
-        <artifactId>shenyu</artifactId>
+        <artifactId>shenyu-infra</artifactId>
         <version>2.7.0.2-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>shenyu-infra</artifactId>
-    <packaging>pom</packaging>
-
-    <modules>
-        <module>shenyu-infra-redis</module>
-    </modules>
-
+    <artifactId>shenyu-infra-nacos</artifactId>
 </project>
diff --git 
a/shenyu-infra/shenyu-infra-nacos/src/main/java/org/apache/shenyu/infra/nacos/config/NacosACMConfig.java
 
b/shenyu-infra/shenyu-infra-nacos/src/main/java/org/apache/shenyu/infra/nacos/config/NacosACMConfig.java
new file mode 100644
index 0000000000..0494c86da3
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-nacos/src/main/java/org/apache/shenyu/infra/nacos/config/NacosACMConfig.java
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.nacos.config;
+
+import java.util.Objects;
+
+public class NacosACMConfig {
+
+    private boolean enabled;
+
+    private String endpoint;
+
+    private String namespace;
+
+    private String accessKey;
+
+    private String secretKey;
+
+    /**
+     * get enabled.
+     *
+     * @return enabled
+     */
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    /**
+     * set enabled.
+     *
+     * @param enabled enabled
+     */
+    public void setEnabled(final boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    /**
+     * get endpoint.
+     *
+     * @return endpoint
+     */
+    public String getEndpoint() {
+        return endpoint;
+    }
+
+    /**
+     * set endpoint.
+     *
+     * @param endpoint endpoint
+     */
+    public void setEndpoint(final String endpoint) {
+        this.endpoint = endpoint;
+    }
+
+    /**
+     * get namespace.
+     *
+     * @return namespace
+     */
+    public String getNamespace() {
+        return namespace;
+    }
+
+    /**
+     * set namespace.
+     *
+     * @param namespace namespace
+     */
+    public void setNamespace(final String namespace) {
+        this.namespace = namespace;
+    }
+
+    /**
+     * get accessKey.
+     *
+     * @return accessKey
+     */
+    public String getAccessKey() {
+        return accessKey;
+    }
+
+    /**
+     * set accessKey.
+     *
+     * @param accessKey accessKey
+     */
+    public void setAccessKey(final String accessKey) {
+        this.accessKey = accessKey;
+    }
+
+    /**
+     * get secretKey.
+     *
+     * @return secretKey
+     */
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    /**
+     * set secretKey.
+     *
+     * @param secretKey secretKey
+     */
+    public void setSecretKey(final String secretKey) {
+        this.secretKey = secretKey;
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (Objects.isNull(o) || getClass() != o.getClass()) {
+            return false;
+        }
+        NacosACMConfig that = (NacosACMConfig) o;
+        return enabled == that.enabled
+                && Objects.equals(endpoint, that.endpoint)
+                && Objects.equals(namespace, that.namespace)
+                && Objects.equals(accessKey, that.accessKey)
+                && Objects.equals(secretKey, that.secretKey);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(enabled, endpoint, namespace, accessKey, 
secretKey);
+    }
+
+    @Override
+    public String toString() {
+        return "NacosACMConfig{"
+                + "enabled="
+                + enabled
+                + ", endpoint='"
+                + endpoint
+                + '\''
+                + ", namespace='"
+                + namespace
+                + '\''
+                + ", accessKey='"
+                + accessKey
+                + '\''
+                + ", secretKey='"
+                + secretKey
+                + '\''
+                + '}';
+    }
+}
diff --git 
a/shenyu-infra/shenyu-infra-nacos/src/main/java/org/apache/shenyu/infra/nacos/config/NacosConfig.java
 
b/shenyu-infra/shenyu-infra-nacos/src/main/java/org/apache/shenyu/infra/nacos/config/NacosConfig.java
new file mode 100644
index 0000000000..25124c4971
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-nacos/src/main/java/org/apache/shenyu/infra/nacos/config/NacosConfig.java
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.nacos.config;
+
+import java.util.Objects;
+
+public class NacosConfig {
+
+    private String url;
+
+    private String namespace;
+
+    private String username;
+
+    private String password;
+
+    private String contextPath;
+
+    private NacosACMConfig acm;
+
+    /**
+     * get url.
+     *
+     * @return url
+     */
+    public String getUrl() {
+        return url;
+    }
+
+    /**
+     * set url.
+     *
+     * @param url url
+     */
+    public void setUrl(final String url) {
+        this.url = url;
+    }
+
+    /**
+     * get namespace.
+     *
+     * @return namespace
+     */
+    public String getNamespace() {
+        return namespace;
+    }
+
+    /**
+     * set namespace.
+     *
+     * @param namespace namespace
+     */
+    public void setNamespace(final String namespace) {
+        this.namespace = namespace;
+    }
+
+    /**
+     * get username.
+     *
+     * @return username
+     */
+    public String getUsername() {
+        return username;
+    }
+
+    /**
+     * set username.
+     *
+     * @param username username
+     */
+    public void setUsername(final String username) {
+        this.username = username;
+    }
+
+    /**
+     * get password.
+     *
+     * @return password
+     */
+    public String getPassword() {
+        return password;
+    }
+
+    /**
+     * set password.
+     *
+     * @param password password
+     */
+    public void setPassword(final String password) {
+        this.password = password;
+    }
+
+    /**
+     * Gets the value of contextPath.
+     *
+     * @return the value of contextPath
+     */
+    public String getContextPath() {
+        return contextPath;
+    }
+
+    /**
+     * Sets the contextPath.
+     *
+     * @param contextPath contextPath
+     */
+    public void setContextPath(final String contextPath) {
+        this.contextPath = contextPath;
+    }
+
+    /**
+     * get acm.
+     *
+     * @return acm
+     */
+    public NacosACMConfig getAcm() {
+        return acm;
+    }
+
+    /**
+     * set acm.
+     *
+     * @param acm acm
+     */
+    public void setAcm(final NacosACMConfig acm) {
+        this.acm = acm;
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (Objects.isNull(o) || getClass() != o.getClass()) {
+            return false;
+        }
+        NacosConfig that = (NacosConfig) o;
+        return Objects.equals(url, that.url)
+                && Objects.equals(namespace, that.namespace)
+                && Objects.equals(username, that.username)
+                && Objects.equals(password, that.password)
+                && Objects.equals(contextPath, that.contextPath)
+                && Objects.equals(acm, that.acm);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(url, namespace, username, password, contextPath, 
acm);
+    }
+
+    @Override
+    public String toString() {
+        return "NacosConfig{"
+                + "url='"
+                + url
+                + '\''
+                + ", namespace='"
+                + namespace
+                + '\''
+                + ", username='"
+                + username
+                + '\''
+                + ", password='"
+                + password
+                + '\''
+                + ", contextPath='"
+                + contextPath
+                + '\''
+                + ", acm="
+                + acm
+                + '}';
+    }
+}
diff --git 
a/shenyu-infra/shenyu-infra-nacos/src/test/java/org/apache/shenyu/infra/nacos/NacosTests.java
 
b/shenyu-infra/shenyu-infra-nacos/src/test/java/org/apache/shenyu/infra/nacos/NacosTests.java
new file mode 100644
index 0000000000..4dfd534b1d
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-nacos/src/test/java/org/apache/shenyu/infra/nacos/NacosTests.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.nacos;
+
+public class NacosTests {
+}
diff --git a/shenyu-infra/pom.xml b/shenyu-infra/shenyu-infra-x-module/pom.xml
similarity index 86%
copy from shenyu-infra/pom.xml
copy to shenyu-infra/shenyu-infra-x-module/pom.xml
index 5a7e6f2e93..27324fe74c 100644
--- a/shenyu-infra/pom.xml
+++ b/shenyu-infra/shenyu-infra-x-module/pom.xml
@@ -19,15 +19,9 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
     <parent>
         <groupId>org.apache.shenyu</groupId>
-        <artifactId>shenyu</artifactId>
+        <artifactId>shenyu-infra</artifactId>
         <version>2.7.0.2-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>shenyu-infra</artifactId>
-    <packaging>pom</packaging>
-
-    <modules>
-        <module>shenyu-infra-redis</module>
-    </modules>
-
+    <artifactId>shenyu-infra-x-module</artifactId>
 </project>
diff --git 
a/shenyu-infra/shenyu-infra-x-module/src/main/java/org/apache/shenyu/infra/x/XConfig.java
 
b/shenyu-infra/shenyu-infra-x-module/src/main/java/org/apache/shenyu/infra/x/XConfig.java
new file mode 100644
index 0000000000..8e536965f8
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-x-module/src/main/java/org/apache/shenyu/infra/x/XConfig.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.x;
+
+public class XConfig {
+}
diff --git 
a/shenyu-infra/shenyu-infra-x-module/src/test/java/org/apache/shenyu/infra/x/XTests.java
 
b/shenyu-infra/shenyu-infra-x-module/src/test/java/org/apache/shenyu/infra/x/XTests.java
new file mode 100644
index 0000000000..eb0085b343
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-x-module/src/test/java/org/apache/shenyu/infra/x/XTests.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.x;
+
+public class XTests {
+}
diff --git a/shenyu-infra/pom.xml b/shenyu-infra/shenyu-infra-zookeeper/pom.xml
similarity index 86%
copy from shenyu-infra/pom.xml
copy to shenyu-infra/shenyu-infra-zookeeper/pom.xml
index 5a7e6f2e93..473c50e9e7 100644
--- a/shenyu-infra/pom.xml
+++ b/shenyu-infra/shenyu-infra-zookeeper/pom.xml
@@ -19,15 +19,9 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
     <parent>
         <groupId>org.apache.shenyu</groupId>
-        <artifactId>shenyu</artifactId>
+        <artifactId>shenyu-infra</artifactId>
         <version>2.7.0.2-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>shenyu-infra</artifactId>
-    <packaging>pom</packaging>
-
-    <modules>
-        <module>shenyu-infra-redis</module>
-    </modules>
-
+    <artifactId>shenyu-infra-zookeeper</artifactId>
 </project>
diff --git 
a/shenyu-infra/shenyu-infra-zookeeper/src/main/java/org/apache/shenyu/infra/zookeeper/ZookeeperConfig.java
 
b/shenyu-infra/shenyu-infra-zookeeper/src/main/java/org/apache/shenyu/infra/zookeeper/ZookeeperConfig.java
new file mode 100644
index 0000000000..f313aadad1
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-zookeeper/src/main/java/org/apache/shenyu/infra/zookeeper/ZookeeperConfig.java
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.zookeeper;
+
+public class ZookeeperConfig {
+
+    /**
+     * zookeeper server list.
+     * e.g. host1:2181,host2:2181
+     */
+    private final String serverLists;
+
+    /**
+     * zookeeper namespace.
+     */
+    private String namespace = "";
+
+    /**
+     * initial amount of time to wait between retries.
+     */
+    private int baseSleepTimeMilliseconds = 1000;
+
+    /**
+     * max time in ms to sleep on each retry.
+     */
+    private int maxSleepTimeMilliseconds = Integer.MAX_VALUE;
+
+    /**
+     * max number of times to retry.
+     */
+    private int maxRetries = 3;
+
+    /**
+     * session timeout.
+     */
+    private int sessionTimeoutMilliseconds = 60 * 1000;
+
+    /**
+     * connection timeout.
+     */
+    private int connectionTimeoutMilliseconds = 15 * 1000;
+
+    /**
+     * auth token digest. no auth by default.
+     */
+    private String digest;
+
+    public ZookeeperConfig(final String serverLists) {
+        this.serverLists = serverLists;
+    }
+
+    /**
+     * get zookeeper server list.
+     * @return server list.
+     */
+    public String getServerLists() {
+        return serverLists;
+    }
+
+    /**
+     * set namespace.
+     * @param namespace zk namespace
+     * @return zk config
+     */
+    public ZookeeperConfig setNamespace(final String namespace) {
+        this.namespace = namespace;
+        return this;
+    }
+
+    /**
+     * get namespace.
+     * @return namespace
+     */
+    public String getNamespace() {
+        return namespace;
+    }
+
+    /**
+     * get base sleep time.
+     * @return base sleep time.
+     */
+    public int getBaseSleepTimeMilliseconds() {
+        return baseSleepTimeMilliseconds;
+    }
+
+    /**
+     * set base sleep time.
+     * @param baseSleepTimeMilliseconds base sleep time in milliseconds.
+     * @return zk config.
+     */
+    public ZookeeperConfig setBaseSleepTimeMilliseconds(final int 
baseSleepTimeMilliseconds) {
+        this.baseSleepTimeMilliseconds = baseSleepTimeMilliseconds;
+        return this;
+    }
+
+    /**
+     * get max sleep time.
+     * @return max sleep time
+     */
+    public int getMaxSleepTimeMilliseconds() {
+        return maxSleepTimeMilliseconds;
+    }
+
+    /**
+     * set max sleep time.
+     * @param maxSleepTimeMilliseconds max sleep time.
+     * @return zk config.
+     */
+    public ZookeeperConfig setMaxSleepTimeMilliseconds(final int 
maxSleepTimeMilliseconds) {
+        this.maxSleepTimeMilliseconds = maxSleepTimeMilliseconds;
+        return this;
+    }
+
+    /**
+     * get max retries.
+     * @return max retries
+     */
+    public int getMaxRetries() {
+        return maxRetries;
+    }
+
+    /**
+     * set max retries count.
+     * @param maxRetries max retries
+     * @return zk config.
+     */
+    public ZookeeperConfig setMaxRetries(final int maxRetries) {
+        this.maxRetries = maxRetries;
+        return this;
+    }
+
+    /**
+     * get session timeout in milliseconds.
+     * @return session timeout.
+     */
+    public int getSessionTimeoutMilliseconds() {
+        return sessionTimeoutMilliseconds;
+    }
+
+    /**
+     * set session timeout in milliseconds.
+     * @param sessionTimeoutMilliseconds session timeout
+     * @return zk config.
+     */
+    public ZookeeperConfig setSessionTimeoutMilliseconds(final int 
sessionTimeoutMilliseconds) {
+        this.sessionTimeoutMilliseconds = sessionTimeoutMilliseconds;
+        return this;
+    }
+
+    /**
+     * get connection timeout in milliseconds.
+     * @return connection timeout.
+     */
+    public int getConnectionTimeoutMilliseconds() {
+        return connectionTimeoutMilliseconds;
+    }
+
+    /**
+     * set connection timeout in milliseconds.
+     * @param connectionTimeoutMilliseconds connection timeout.
+     * @return zk config.
+     */
+    public ZookeeperConfig setConnectionTimeoutMilliseconds(final int 
connectionTimeoutMilliseconds) {
+        this.connectionTimeoutMilliseconds = connectionTimeoutMilliseconds;
+        return this;
+    }
+
+    /**
+     * get digest.
+     * @return digest.
+     */
+    public String getDigest() {
+        return digest;
+    }
+
+    /**
+     * set digest.
+     * @param digest digest
+     * @return zk config.
+     */
+    public ZookeeperConfig setDigest(final String digest) {
+        this.digest = digest;
+        return this;
+    }
+}
diff --git 
a/shenyu-infra/shenyu-infra-zookeeper/src/test/java/org/apache/shenyu/infra/zookeeper/ZookeeperTests.java
 
b/shenyu-infra/shenyu-infra-zookeeper/src/test/java/org/apache/shenyu/infra/zookeeper/ZookeeperTests.java
new file mode 100644
index 0000000000..68f8c752f0
--- /dev/null
+++ 
b/shenyu-infra/shenyu-infra-zookeeper/src/test/java/org/apache/shenyu/infra/zookeeper/ZookeeperTests.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.infra.zookeeper;
+
+public class ZookeeperTests {
+}

Reply via email to