This commit is contained in:
Redkale
2020-06-15 23:35:26 +08:00
parent 76d538264a
commit ffd3b6daf6
2 changed files with 10 additions and 0 deletions

View File

@@ -31,6 +31,11 @@ public class HttpMessageClient extends MessageClient {
return messageAgent.generateHttpReqTopic(module);
}
//格式: http.req.user-n10
public String generateHttpReqTopic(String module, String resname) {
return messageAgent.generateHttpReqTopic(module, resname);
}
public String generateHttpReqTopic(HttpSimpleRequest request, String path) {
String module = request.getRequestURI();
if (path != null && !path.isEmpty() && module.startsWith(path)) module = module.substring(path.length());

View File

@@ -213,6 +213,11 @@ public abstract class MessageAgent {
return "http.req." + module.toLowerCase();
}
//格式: http.req.user
public String generateHttpReqTopic(String module, String resname) {
return "http.req." + module.toLowerCase() + (resname == null || resname.isEmpty() ? "" : ("-" + resname));
}
//格式: sncp.resp.node10
protected String generateSncpRespTopic() {
return "sncp.resp.node" + nodeid;