Skip to content

Commit fca1d3d

Browse files
author
欧俊
committed
修改默认的队列名位Type.FullName
1 parent 340326d commit fca1d3d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/RabbitMQ.EventBus.AspNetCore/DefaultRabbitMQEventBusV2.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public void Subscribe(Type eventType, string type = "topic")
100100
if (attribute is EventBusAttribute attr)
101101
{
102102
string queue = attr.Queue ?? (_persistentConnection.Configuration.Prefix == QueuePrefixType.ExchangeName
103-
? $"{ attr.Exchange }.{ eventType.Name }"
104-
: $"{GlaobalExchangeName}.{ eventType.Name }");
103+
? $"{attr.Exchange}.{eventType.Name}"
104+
: (eventType.FullName ?? $"{GlaobalExchangeName}.{eventType.Name}"));
105105

106106
var onlyKey = $"{attr.Exchange}_{queue}_{attr.RoutingKey}";
107107
if (!subscribes.TryGetValue(onlyKey, out IModel channel))
@@ -158,8 +158,8 @@ public void Subscribe(Type eventType, Type responseType, string type = "topic")
158158
if (attribute is EventBusAttribute attr)
159159
{
160160
string queue = attr.Queue ?? (_persistentConnection.Configuration.Prefix == QueuePrefixType.ExchangeName
161-
? $"{ attr.Exchange }.{ eventType.Name }"
162-
: $"{GlaobalExchangeName}.{ eventType.Name }");
161+
? $"{attr.Exchange}.{eventType.Name}"
162+
: (eventType.FullName ?? $"{GlaobalExchangeName}.{eventType.Name}"));
163163

164164
var onlyKey = $"{attr.Exchange}_{queue}_{attr.RoutingKey}";
165165
_logger.LogWarning($"onlyKey => {onlyKey}");

0 commit comments

Comments
 (0)