You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2021/01/15 09:41:15 UTC
[dubbo] 02/03: add back instance metadata listener
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch 3.0-k8s
in repository https://gitbox.apache.org/repos/asf/dubbo.git
commit 780fe21e6897c24b3003d66845c9c80feb9d4964
Author: ken.lj <ke...@gmail.com>
AuthorDate: Fri Jan 15 17:19:55 2021 +0800
add back instance metadata listener
---
.../metadata/InstanceMetadataChangedListener.java | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/InstanceMetadataChangedListener.java b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/InstanceMetadataChangedListener.java
new file mode 100644
index 0000000..5536e53
--- /dev/null
+++ b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/InstanceMetadataChangedListener.java
@@ -0,0 +1,35 @@
+/*
+ * 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.dubbo.metadata;
+
+public interface InstanceMetadataChangedListener {
+ /**
+ * Call when metadata in provider side update <p/>
+ * Used to notify consumer to update metadata of ServiceInstance
+ *
+ * @param metadata latest metadata
+ */
+ void onEvent(String metadata);
+
+ /**
+ * Echo test
+ * Used to check consumer still online
+ */
+ default String echo(String msg) {
+ return msg;
+ }
+}