Commit 4c870f42 authored by Savorboard's avatar Savorboard

NodeId type change to string of DiscoveryOptions for Consul. #314

parent ab8a38a6
...@@ -57,7 +57,7 @@ namespace DotNetCore.CAP.Dashboard.GatewayProxy ...@@ -57,7 +57,7 @@ namespace DotNetCore.CAP.Dashboard.GatewayProxy
{ {
//For performance reasons, we need to put this functionality in the else //For performance reasons, we need to put this functionality in the else
var isSwitchNode = request.Cookies.TryGetValue(NodeCookieName, out var requestNodeId); var isSwitchNode = request.Cookies.TryGetValue(NodeCookieName, out var requestNodeId);
var isCurrentNode = discoveryOptions.NodeId.ToString() == requestNodeId; var isCurrentNode = discoveryOptions.NodeId == requestNodeId;
var isNodesPage = request.Path.StartsWithSegments(new PathString(pathMatch + "/nodes")); var isNodesPage = request.Path.StartsWithSegments(new PathString(pathMatch + "/nodes"));
if (!isSwitchNode || isCurrentNode || isNodesPage) if (!isSwitchNode || isCurrentNode || isNodesPage)
......
...@@ -30,8 +30,9 @@ namespace DotNetCore.CAP ...@@ -30,8 +30,9 @@ namespace DotNetCore.CAP
public string CurrentNodeHostName { get; set; } public string CurrentNodeHostName { get; set; }
public int CurrentNodePort { get; set; } public int CurrentNodePort { get; set; }
public int NodeId { get; set; } public string NodeId { get; set; }
public string NodeName { get; set; } public string NodeName { get; set; }
public string MatchPath { get; set; } public string MatchPath { get; set; }
} }
} }
\ No newline at end of file
...@@ -72,7 +72,7 @@ namespace DotNetCore.CAP.NodeDiscovery ...@@ -72,7 +72,7 @@ namespace DotNetCore.CAP.NodeDiscovery
{ {
return _consul.Agent.ServiceRegister(new AgentServiceRegistration return _consul.Agent.ServiceRegister(new AgentServiceRegistration
{ {
ID = _options.NodeId.ToString(), ID = _options.NodeId,
Name = _options.NodeName, Name = _options.NodeName,
Address = _options.CurrentNodeHostName, Address = _options.CurrentNodeHostName,
Port = _options.CurrentNodePort, Port = _options.CurrentNodePort,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment