This commit is contained in:
@@ -159,8 +159,11 @@ public abstract class MessageAgent {
|
||||
|
||||
//格式: sncp.req.user
|
||||
public final String generateSncpReqTopic(Service service) {
|
||||
if (service instanceof WebSocketNode) {
|
||||
String resname = Sncp.getResourceName(service);
|
||||
return "sncp.req.ws" + (resname.isEmpty() ? "" : ("-" + resname)) + ".node" + nodeid;
|
||||
}
|
||||
String resname = Sncp.getResourceName(service);
|
||||
if (service instanceof WebSocketNode) return "sncp.req.ws" + (resname.isEmpty() ? "" : ("-" + resname));
|
||||
return "sncp.req." + Sncp.getResourceType(service).getSimpleName().replaceAll("Service.*$", "").toLowerCase() + (resname.isEmpty() ? "" : ("-" + resname));
|
||||
}
|
||||
|
||||
@@ -198,11 +201,6 @@ public abstract class MessageAgent {
|
||||
|
||||
}
|
||||
|
||||
//格式: ws.resp.wsgame.node100
|
||||
public String generateWebSocketRespTopic(WebSocketNode node) {
|
||||
return "ws.resp." + node.getName() + ".node" + nodeid;
|
||||
}
|
||||
|
||||
//格式: xxxx.resp.node10
|
||||
protected String generateRespTopic(String protocol) {
|
||||
return protocol + ".resp.node" + nodeid;
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class WebSocketNode {
|
||||
if (wsthreads == 0) wsthreads = Runtime.getRuntime().availableProcessors() * 8;
|
||||
if (wsthreads > 0) this.semaphore = new Semaphore(wsthreads);
|
||||
}
|
||||
String mqtopic = this.messageAgent == null ? null : this.messageAgent.generateWebSocketRespTopic(this);
|
||||
String mqtopic = this.messageAgent == null ? null : this.messageAgent.generateSncpReqTopic((Service)this);
|
||||
if (mqtopic != null || this.localSncpAddress != null) {
|
||||
this.wsaddress = new WebSocketAddress(mqtopic, localSncpAddress);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user