Commit 847a9ecb authored by Savorboard's avatar Savorboard

rename cap attribute routekey

parent 14aada21
...@@ -4,24 +4,24 @@ namespace DotNetCore.CAP.Kafka ...@@ -4,24 +4,24 @@ namespace DotNetCore.CAP.Kafka
{ {
public class CapSubscribeAttribute : TopicAttribute public class CapSubscribeAttribute : TopicAttribute
{ {
public CapSubscribeAttribute(string topicName) public CapSubscribeAttribute(string name)
: this(topicName, 0) : this(name, 0)
{ {
} }
/// <summary> /// <summary>
/// Not support /// Not support
/// </summary> /// </summary>
public CapSubscribeAttribute(string topicName, int partition) public CapSubscribeAttribute(string name, int partition)
: this(topicName, partition, 0) : this(name, partition, 0)
{ {
} }
/// <summary> /// <summary>
/// Not support /// Not support
/// </summary> /// </summary>
public CapSubscribeAttribute(string topicName, int partition, long offset) public CapSubscribeAttribute(string name, int partition, long offset)
: base(topicName) : base(name)
{ {
Offset = offset; Offset = offset;
Partition = partition; Partition = partition;
......
...@@ -73,7 +73,7 @@ namespace DotNetCore.CAP.Kafka ...@@ -73,7 +73,7 @@ namespace DotNetCore.CAP.Kafka
var message = new MessageContext var message = new MessageContext
{ {
Group = _groupId, Group = _groupId,
KeyName = e.Topic, Name = e.Topic,
Content = e.Value Content = e.Value
}; };
MessageReceieved?.Invoke(sender, message); MessageReceieved?.Invoke(sender, message);
......
...@@ -4,7 +4,7 @@ namespace DotNetCore.CAP.RabbitMQ ...@@ -4,7 +4,7 @@ namespace DotNetCore.CAP.RabbitMQ
{ {
public class CapSubscribeAttribute : TopicAttribute public class CapSubscribeAttribute : TopicAttribute
{ {
public CapSubscribeAttribute(string routingKey) : base(routingKey) public CapSubscribeAttribute(string name) : base(name)
{ {
} }
......
...@@ -87,7 +87,7 @@ namespace DotNetCore.CAP.RabbitMQ ...@@ -87,7 +87,7 @@ namespace DotNetCore.CAP.RabbitMQ
var message = new MessageContext var message = new MessageContext
{ {
Group = _queueName, Group = _queueName,
KeyName = e.RoutingKey, Name = e.RoutingKey,
Content = Encoding.UTF8.GetString(e.Body) Content = Encoding.UTF8.GetString(e.Body)
}; };
MessageReceieved?.Invoke(sender, message); MessageReceieved?.Invoke(sender, message);
......
...@@ -8,9 +8,9 @@ namespace DotNetCore.CAP.Abstractions ...@@ -8,9 +8,9 @@ namespace DotNetCore.CAP.Abstractions
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)]
public abstract class TopicAttribute : Attribute public abstract class TopicAttribute : Attribute
{ {
protected TopicAttribute(string topicName) protected TopicAttribute(string name)
{ {
Name = topicName; Name = name;
} }
/// <summary> /// <summary>
......
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