This commit is contained in:
Redkale
2021-01-14 12:25:23 +08:00
parent e2a1fa15d3
commit 5781ad1de0
2 changed files with 6 additions and 0 deletions

View File

@@ -272,6 +272,9 @@ public class CacheClusterAgent extends ClusterAgent implements Resourcable {
} }
source.hremove(servicename, serviceid); source.hremove(servicename, serviceid);
if (realcanceled && currEntry != null) currEntry.canceled = true; if (realcanceled && currEntry != null) currEntry.canceled = true;
if (!"mqtp".equals(protocol) && currEntry != null && currEntry.submqtp) {
deregister(ns, "mqtp", service, realcanceled);
}
} }
@Override @Override

View File

@@ -116,6 +116,7 @@ public abstract class ClusterAgent {
register(ns, "mqtp", service); register(ns, "mqtp", service);
ClusterEntry mqentry = new ClusterEntry(ns, "mqtp", service); ClusterEntry mqentry = new ClusterEntry(ns, "mqtp", service);
localEntrys.put(mqentry.serviceid, mqentry); localEntrys.put(mqentry.serviceid, mqentry);
htentry.submqtp = true;
} }
} }
} }
@@ -313,6 +314,8 @@ public abstract class ClusterAgent {
public boolean canceled; public boolean canceled;
public boolean submqtp;
public ClusterEntry(NodeServer ns, String protocol, Service service) { public ClusterEntry(NodeServer ns, String protocol, Service service) {
this.serviceid = generateServiceId(ns, protocol, service); this.serviceid = generateServiceId(ns, protocol, service);
this.servicename = generateServiceName(ns, protocol, service); this.servicename = generateServiceName(ns, protocol, service);