diff --git a/api/src/main/resources/META-INF/services/com.alibaba.nacos.api.remote.Payload b/api/src/main/resources/META-INF/services/com.alibaba.nacos.api.remote.Payload
new file mode 100644
index 00000000000..d838e65ea2c
--- /dev/null
+++ b/api/src/main/resources/META-INF/services/com.alibaba.nacos.api.remote.Payload
@@ -0,0 +1,57 @@
+#
+# Copyright 1999-2021 Alibaba Group Holding Ltd.
+#
+# Licensed 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.
+#
+#
+com.alibaba.nacos.api.remote.request.ClientDetectionRequest
+com.alibaba.nacos.api.remote.request.ConnectionSetupRequest
+com.alibaba.nacos.api.remote.request.ConnectResetRequest
+com.alibaba.nacos.api.remote.request.HealthCheckRequest
+com.alibaba.nacos.api.remote.request.PushAckRequest
+com.alibaba.nacos.api.remote.request.ServerCheckRequest
+com.alibaba.nacos.api.remote.request.ServerLoaderInfoRequest
+com.alibaba.nacos.api.remote.request.ServerReloadRequest
+com.alibaba.nacos.api.remote.response.ClientDetectionResponse
+com.alibaba.nacos.api.remote.response.ConnectResetResponse
+com.alibaba.nacos.api.remote.response.ErrorResponse
+com.alibaba.nacos.api.remote.response.HealthCheckResponse
+com.alibaba.nacos.api.remote.response.ServerCheckResponse
+com.alibaba.nacos.api.remote.response.ServerLoaderInfoResponse
+com.alibaba.nacos.api.remote.response.ServerReloadResponse
+com.alibaba.nacos.api.config.remote.request.ClientConfigMetricRequest
+com.alibaba.nacos.api.config.remote.request.ConfigBatchListenRequest
+com.alibaba.nacos.api.config.remote.request.ConfigChangeNotifyRequest
+com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest
+com.alibaba.nacos.api.config.remote.request.ConfigQueryRequest
+com.alibaba.nacos.api.config.remote.request.ConfigRemoveRequest
+com.alibaba.nacos.api.config.remote.response.ClientConfigMetricResponse
+com.alibaba.nacos.api.config.remote.response.ConfigChangeBatchListenResponse
+com.alibaba.nacos.api.config.remote.response.ConfigChangeNotifyResponse
+com.alibaba.nacos.api.config.remote.response.ConfigPublishResponse
+com.alibaba.nacos.api.config.remote.response.ConfigQueryResponse
+com.alibaba.nacos.api.config.remote.response.ConfigRemoveResponse
+com.alibaba.nacos.api.config.remote.request.cluster.ConfigChangeClusterSyncRequest
+com.alibaba.nacos.api.config.remote.response.cluster.ConfigChangeClusterSyncResponse
+com.alibaba.nacos.api.naming.remote.request.BatchInstanceRequest
+com.alibaba.nacos.api.naming.remote.request.InstanceRequest
+com.alibaba.nacos.api.naming.remote.request.NotifySubscriberRequest
+com.alibaba.nacos.api.naming.remote.request.ServiceListRequest
+com.alibaba.nacos.api.naming.remote.request.ServiceQueryRequest
+com.alibaba.nacos.api.naming.remote.request.SubscribeServiceRequest
+com.alibaba.nacos.api.naming.remote.response.BatchInstanceResponse
+com.alibaba.nacos.api.naming.remote.response.InstanceResponse
+com.alibaba.nacos.api.naming.remote.response.NotifySubscriberResponse
+com.alibaba.nacos.api.naming.remote.response.QueryServiceResponse
+com.alibaba.nacos.api.naming.remote.response.ServiceListResponse
+com.alibaba.nacos.api.naming.remote.response.SubscribeServiceResponse
\ No newline at end of file
diff --git a/client/pom.xml b/client/pom.xml
index 6ed18aea215..a5987163ae4 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -183,6 +183,9 @@
com/alibaba/nacos/api/**/**
+
+ META-INF/**/*.*
+
@@ -339,6 +342,9 @@
com/alibaba/nacos/api/**/**
+
+ META-INF/**/*.*
+
diff --git a/client/src/main/java/com/alibaba/nacos/client/remote/ClientPayloadPackageProvider.java b/client/src/main/java/com/alibaba/nacos/client/remote/ClientPayloadPackageProvider.java
deleted file mode 100644
index ef153062e54..00000000000
--- a/client/src/main/java/com/alibaba/nacos/client/remote/ClientPayloadPackageProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 1999-2021 Alibaba Group Holding Ltd.
- *
- * Licensed 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 com.alibaba.nacos.client.remote;
-
-import com.alibaba.nacos.common.remote.PayloadPackageProvider;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * client package provider.
- *
- * @author hujun
- */
-public class ClientPayloadPackageProvider implements PayloadPackageProvider {
-
- private final Set scanPackage = new HashSet<>();
-
- {
- scanPackage.add("com.alibaba.nacos.api.naming.remote.request");
- scanPackage.add("com.alibaba.nacos.api.remote.request");
- scanPackage.add("com.alibaba.nacos.api.config.remote.request");
- scanPackage.add("com.alibaba.nacos.api.naming.remote.response");
- scanPackage.add("com.alibaba.nacos.api.config.remote.response");
- scanPackage.add("com.alibaba.nacos.api.remote.response");
- }
-
- @Override
- public Set getScanPackage() {
- return scanPackage;
- }
-}
diff --git a/client/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider b/client/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
deleted file mode 100644
index 26f9a08be88..00000000000
--- a/client/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 1999-2021 Alibaba Group Holding Ltd.
-#
-# Licensed 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.
-#
-#
-
-com.alibaba.nacos.client.remote.ClientPayloadPackageProvider
\ No newline at end of file
diff --git a/client/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider b/client/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
deleted file mode 100644
index 26f9a08be88..00000000000
--- a/client/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 1999-2021 Alibaba Group Holding Ltd.
-#
-# Licensed 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.
-#
-#
-
-com.alibaba.nacos.client.remote.ClientPayloadPackageProvider
\ No newline at end of file
diff --git a/common/src/main/java/com/alibaba/nacos/common/remote/PayloadRegistry.java b/common/src/main/java/com/alibaba/nacos/common/remote/PayloadRegistry.java
index 722a02ad406..fb9a5d4fc8c 100644
--- a/common/src/main/java/com/alibaba/nacos/common/remote/PayloadRegistry.java
+++ b/common/src/main/java/com/alibaba/nacos/common/remote/PayloadRegistry.java
@@ -17,16 +17,14 @@
package com.alibaba.nacos.common.remote;
import com.alibaba.nacos.api.remote.Payload;
-import com.alibaba.nacos.common.packagescan.DefaultPackageScan;
+
import java.lang.reflect.Modifier;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
import java.util.ServiceLoader;
-import java.util.Set;
/**
- * payload regitry,Define basic scan behavior request and response.
+ * payload registry,Define basic scan behavior request and response.
*
* @author liuzunfei
* @author hujun
@@ -47,18 +45,9 @@ private static synchronized void scan() {
if (initialized) {
return;
}
-
- ServiceLoader payloadPackages = ServiceLoader.load(PayloadPackageProvider.class);
- Set result = new HashSet<>();
- for (PayloadPackageProvider payloadPackage : payloadPackages) {
- result.addAll(payloadPackage.getScanPackage());
- }
- for (String pkg : result) {
- DefaultPackageScan packageScan = new DefaultPackageScan();
- Set> subTypesResponse = packageScan.getSubTypesOf(pkg, Payload.class);
- for (Class> clazz : subTypesResponse) {
- register(clazz.getSimpleName(), clazz);
- }
+ ServiceLoader payloads = ServiceLoader.load(Payload.class);
+ for (Payload payload : payloads) {
+ register(payload.getClass().getSimpleName(), payload.getClass());
}
initialized = true;
}
diff --git a/common/src/test/java/com/alibaba/nacos/common/remote/MockPayloadPackageProvider.java b/common/src/test/java/com/alibaba/nacos/common/remote/MockPayloadPackageProvider.java
deleted file mode 100644
index bf32b100600..00000000000
--- a/common/src/test/java/com/alibaba/nacos/common/remote/MockPayloadPackageProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed 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 com.alibaba.nacos.common.remote;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class MockPayloadPackageProvider implements PayloadPackageProvider {
-
- private final Set scanPackage = new HashSet<>();
-
- {
- scanPackage.add("com.alibaba.nacos.api.naming.remote.request");
- scanPackage.add("com.alibaba.nacos.api.remote.request");
- scanPackage.add("com.alibaba.nacos.naming.cluster.remote.request");
- scanPackage.add("com.alibaba.nacos.api.naming.remote.response");
- scanPackage.add("com.alibaba.nacos.api.config.remote.response");
- scanPackage.add("com.alibaba.nacos.api.remote.response");
- scanPackage.add("com.alibaba.nacos.naming.cluster.remote.response");
- }
-
- @Override
- public Set getScanPackage() {
- return scanPackage;
- }
-}
diff --git a/common/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider b/common/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
deleted file mode 100644
index f8b9cce83e4..00000000000
--- a/common/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 1999-2021 Alibaba Group Holding Ltd.
-#
-# Licensed 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.
-#
-#
-
-com.alibaba.nacos.common.remote.MockPayloadPackageProvider
\ No newline at end of file
diff --git a/config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigPayloadPackageProvider.java b/config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigPayloadPackageProvider.java
deleted file mode 100644
index bb098f090dc..00000000000
--- a/config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigPayloadPackageProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 1999-2021 Alibaba Group Holding Ltd.
- *
- * Licensed 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 com.alibaba.nacos.config.server.remote;
-
-import com.alibaba.nacos.common.remote.PayloadPackageProvider;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * config package provider.
- *
- * @author hujun
- */
-public class ConfigPayloadPackageProvider implements PayloadPackageProvider {
-
- private final Set scanPackage = new HashSet<>();
-
- {
- scanPackage.add("com.alibaba.nacos.api.remote.request");
- scanPackage.add("com.alibaba.nacos.api.remote.response");
- scanPackage.add("com.alibaba.nacos.api.config.remote.request");
- scanPackage.add("com.alibaba.nacos.api.config.remote.response");
- }
-
- @Override
- public Set getScanPackage() {
- return scanPackage;
- }
-}
diff --git a/config/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider b/config/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
deleted file mode 100644
index 7295acaee6d..00000000000
--- a/config/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 1999-2021 Alibaba Group Holding Ltd.
-#
-# Licensed 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.
-#
-#
-
-com.alibaba.nacos.config.server.remote.ConfigPayloadPackageProvider
\ No newline at end of file
diff --git a/config/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider b/config/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
deleted file mode 100644
index 7295acaee6d..00000000000
--- a/config/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 1999-2021 Alibaba Group Holding Ltd.
-#
-# Licensed 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.
-#
-#
-
-com.alibaba.nacos.config.server.remote.ConfigPayloadPackageProvider
\ No newline at end of file
diff --git a/core/src/test/java/com/alibaba/nacos/core/remote/MockPayloadPackageProvider.java b/core/src/test/java/com/alibaba/nacos/core/remote/MockPayloadPackageProvider.java
deleted file mode 100644
index f2d1cbd9de7..00000000000
--- a/core/src/test/java/com/alibaba/nacos/core/remote/MockPayloadPackageProvider.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 1999-2021 Alibaba Group Holding Ltd.
- *
- * Licensed 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 com.alibaba.nacos.core.remote;
-
-import com.alibaba.nacos.common.remote.PayloadPackageProvider;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * test package provider.
- *
- * @author hujun
- */
-public class MockPayloadPackageProvider implements PayloadPackageProvider {
-
- private final Set scanPackage = new HashSet<>();
-
- {
- scanPackage.add("com.alibaba.nacos.api.naming.remote.request");
- scanPackage.add("com.alibaba.nacos.api.remote.request");
- scanPackage.add("com.alibaba.nacos.naming.cluster.remote.request");
- scanPackage.add("com.alibaba.nacos.api.config.remote.request");
- scanPackage.add("com.alibaba.nacos.api.naming.remote.response");
- scanPackage.add("com.alibaba.nacos.api.config.remote.response");
- scanPackage.add("com.alibaba.nacos.api.remote.response");
- scanPackage.add("com.alibaba.nacos.naming.cluster.remote.response");
- }
-
- @Override
- public Set getScanPackage() {
- return scanPackage;
- }
-}
diff --git a/core/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider b/core/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
deleted file mode 100644
index 12bc123e718..00000000000
--- a/core/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 1999-2021 Alibaba Group Holding Ltd.
-#
-# Licensed 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.
-#
-#
-
-com.alibaba.nacos.core.remote.MockPayloadPackageProvider
\ No newline at end of file
diff --git a/naming/src/main/java/com/alibaba/nacos/naming/cluster/remote/request/RequestRegistry.java b/naming/src/main/java/com/alibaba/nacos/naming/cluster/remote/request/RequestRegistry.java
new file mode 100644
index 00000000000..5a6800b033c
--- /dev/null
+++ b/naming/src/main/java/com/alibaba/nacos/naming/cluster/remote/request/RequestRegistry.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 1999-2020 Alibaba Group Holding Ltd.
+ *
+ * Licensed 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 com.alibaba.nacos.naming.cluster.remote.request;
+
+import com.alibaba.nacos.api.remote.Payload;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * payload registry.
+ *
+ * @author shiyiyue
+ */
+public class RequestRegistry {
+
+ private static Set> payloads = registryPayload();
+
+ private static Set> registryPayload() {
+ HashSet> payloads = new HashSet<>();
+ payloads.add(AbstractClusterRequest.class);
+ payloads.add(DistroDataRequest.class);
+ return payloads;
+ }
+
+ public static final Set> getPayloads() {
+ return payloads;
+ }
+}
diff --git a/common/src/main/java/com/alibaba/nacos/common/remote/PayloadPackageProvider.java b/naming/src/main/java/com/alibaba/nacos/naming/cluster/remote/response/ResponseRegistry.java
similarity index 52%
rename from common/src/main/java/com/alibaba/nacos/common/remote/PayloadPackageProvider.java
rename to naming/src/main/java/com/alibaba/nacos/naming/cluster/remote/response/ResponseRegistry.java
index a9a19ab5d39..8a653f9479d 100644
--- a/common/src/main/java/com/alibaba/nacos/common/remote/PayloadPackageProvider.java
+++ b/naming/src/main/java/com/alibaba/nacos/naming/cluster/remote/response/ResponseRegistry.java
@@ -14,21 +14,29 @@
* limitations under the License.
*/
-package com.alibaba.nacos.common.remote;
+package com.alibaba.nacos.naming.cluster.remote.response;
+import com.alibaba.nacos.api.remote.Payload;
+
+import java.util.HashSet;
import java.util.Set;
/**
- * package provider.
+ * pay load registry.
*
- * @author hujun
+ * @author shiyiyue
*/
-public interface PayloadPackageProvider {
+public class ResponseRegistry {
+
+ private static Set> payloads = getPayload();
- /**
- * get scan package.
- * @return scan package list
- */
- Set getScanPackage();
+ private static Set> getPayload() {
+ HashSet> payloads = new HashSet<>();
+ payloads.add(DistroDataResponse.class);
+ return payloads;
+ }
+ public static final Set> getPayloads() {
+ return payloads;
+ }
}
diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java
index 0830ae0cbbc..d6077706685 100644
--- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java
+++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java
@@ -216,7 +216,7 @@ public ObjectNode searchService(@RequestParam(defaultValue = StringUtils.EMPTY)
}
}
ObjectNode result = JacksonUtils.createEmptyJsonNode();
- result.replace("services", JacksonUtils.transferToJsonNode(serviceNameMap));
+ result.replace("META-INF/services", JacksonUtils.transferToJsonNode(serviceNameMap));
result.put("count", totalCount);
return result;
}
diff --git a/naming/src/main/java/com/alibaba/nacos/naming/remote/rpc/NamingPayloadPackageProvider.java b/naming/src/main/java/com/alibaba/nacos/naming/remote/rpc/NamingPayloadPackageProvider.java
deleted file mode 100644
index fccc0a520fb..00000000000
--- a/naming/src/main/java/com/alibaba/nacos/naming/remote/rpc/NamingPayloadPackageProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 1999-2021 Alibaba Group Holding Ltd.
- *
- * Licensed 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 com.alibaba.nacos.naming.remote.rpc;
-
-import com.alibaba.nacos.common.remote.PayloadPackageProvider;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * naming package provider.
- *
- * @author hujun
- */
-public class NamingPayloadPackageProvider implements PayloadPackageProvider {
-
- private final Set scanPackage = new HashSet<>();
-
- {
- scanPackage.add("com.alibaba.nacos.api.remote.request");
- scanPackage.add("com.alibaba.nacos.api.remote.response");
- scanPackage.add("com.alibaba.nacos.api.naming.remote.request");
- scanPackage.add("com.alibaba.nacos.naming.cluster.remote.request");
- scanPackage.add("com.alibaba.nacos.api.naming.remote.response");
- scanPackage.add("com.alibaba.nacos.naming.cluster.remote.response");
- }
-
- @Override
- public Set getScanPackage() {
- return scanPackage;
- }
-}
diff --git a/naming/src/main/resources/META-INF/services/com.alibaba.nacos.api.remote.Payload b/naming/src/main/resources/META-INF/services/com.alibaba.nacos.api.remote.Payload
new file mode 100644
index 00000000000..779bdb19d04
--- /dev/null
+++ b/naming/src/main/resources/META-INF/services/com.alibaba.nacos.api.remote.Payload
@@ -0,0 +1,18 @@
+#
+# Copyright 1999-2020 Alibaba Group Holding Ltd.
+#
+# Licensed 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.
+#
+
+com.alibaba.nacos.naming.cluster.remote.request.DistroDataRequest
+com.alibaba.nacos.naming.cluster.remote.response.DistroDataResponse
\ No newline at end of file
diff --git a/naming/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider b/naming/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
deleted file mode 100644
index 6ab52b4eccf..00000000000
--- a/naming/src/main/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 1999-2021 Alibaba Group Holding Ltd.
-#
-# Licensed 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.
-#
-#
-
-com.alibaba.nacos.naming.remote.rpc.NamingPayloadPackageProvider
\ No newline at end of file
diff --git a/naming/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider b/naming/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
deleted file mode 100644
index 6ab52b4eccf..00000000000
--- a/naming/src/test/resources/META-INF/services/com.alibaba.nacos.common.remote.PayloadPackageProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright 1999-2021 Alibaba Group Holding Ltd.
-#
-# Licensed 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.
-#
-#
-
-com.alibaba.nacos.naming.remote.rpc.NamingPayloadPackageProvider
\ No newline at end of file