Commit 77a0ba30 authored by Savorboard's avatar Savorboard

Refactoring

parent 7da53485
...@@ -164,7 +164,7 @@ namespace DotNetCore.CAP ...@@ -164,7 +164,7 @@ namespace DotNetCore.CAP
if (!_selector.TryGetTopicExector(receivedMessage.Name, receivedMessage.Group, if (!_selector.TryGetTopicExector(receivedMessage.Name, receivedMessage.Group,
out var executor)) out var executor))
{ {
var error = $"message can not be found subscriber, Message:{receivedMessage},\r\n see: https://github.com/dotnetcore/CAP/issues/63"; var error = $"Message can not be found subscriber. {receivedMessage} \r\n see: https://github.com/dotnetcore/CAP/issues/63";
throw new SubscriberNotFoundException(error); throw new SubscriberNotFoundException(error);
} }
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
using System.Reflection; using System.Reflection;
using DotNetCore.CAP.Diagnostics; using DotNetCore.CAP.Diagnostics;
using Newtonsoft.Json; using Newtonsoft.Json;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// An object that generates IDs. This is broken into a separate class in case we ever want to support multiple worker threads per process // An object that generates IDs. This is broken into a separate class in case we ever want to support multiple worker threads per process
using System; using System;
using System.Threading;
namespace DotNetCore.CAP.Infrastructure namespace DotNetCore.CAP.Infrastructure
{ {
...@@ -49,7 +50,7 @@ namespace DotNetCore.CAP.Infrastructure ...@@ -49,7 +50,7 @@ namespace DotNetCore.CAP.Infrastructure
{ {
lock (s_lock) lock (s_lock)
{ {
return _snowflakeId ?? (_snowflakeId = new SnowflakeId(AppDomain.CurrentDomain.Id, datacenterId)); return _snowflakeId ?? (_snowflakeId = new SnowflakeId(Thread.CurrentThread.ManagedThreadId, datacenterId));
} }
} }
......
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