From 847a9ecbce255e3d2b9552ae20d669febad6ef98 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Sun, 16 Jul 2017 18:29:08 +0800 Subject: [PATCH] rename cap attribute routekey --- src/DotNetCore.CAP.Kafka/CapSubscribeAttribute.cs | 12 ++++++------ src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs | 2 +- src/DotNetCore.CAP.RabbitMQ/CapSubscribeAttribute.cs | 2 +- .../RabbitMQConsumerClient.cs | 2 +- src/DotNetCore.CAP/Abstractions/TopicAttribute.cs | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/DotNetCore.CAP.Kafka/CapSubscribeAttribute.cs b/src/DotNetCore.CAP.Kafka/CapSubscribeAttribute.cs index 3d906d1..92b2a93 100644 --- a/src/DotNetCore.CAP.Kafka/CapSubscribeAttribute.cs +++ b/src/DotNetCore.CAP.Kafka/CapSubscribeAttribute.cs @@ -4,24 +4,24 @@ namespace DotNetCore.CAP.Kafka { public class CapSubscribeAttribute : TopicAttribute { - public CapSubscribeAttribute(string topicName) - : this(topicName, 0) + public CapSubscribeAttribute(string name) + : this(name, 0) { } /// /// Not support /// - public CapSubscribeAttribute(string topicName, int partition) - : this(topicName, partition, 0) + public CapSubscribeAttribute(string name, int partition) + : this(name, partition, 0) { } /// /// Not support /// - public CapSubscribeAttribute(string topicName, int partition, long offset) - : base(topicName) + public CapSubscribeAttribute(string name, int partition, long offset) + : base(name) { Offset = offset; Partition = partition; diff --git a/src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs b/src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs index 52b34e3..ad79353 100644 --- a/src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs +++ b/src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs @@ -73,7 +73,7 @@ namespace DotNetCore.CAP.Kafka var message = new MessageContext { Group = _groupId, - KeyName = e.Topic, + Name = e.Topic, Content = e.Value }; MessageReceieved?.Invoke(sender, message); diff --git a/src/DotNetCore.CAP.RabbitMQ/CapSubscribeAttribute.cs b/src/DotNetCore.CAP.RabbitMQ/CapSubscribeAttribute.cs index 5e33a1c..cfbbc8d 100644 --- a/src/DotNetCore.CAP.RabbitMQ/CapSubscribeAttribute.cs +++ b/src/DotNetCore.CAP.RabbitMQ/CapSubscribeAttribute.cs @@ -4,7 +4,7 @@ namespace DotNetCore.CAP.RabbitMQ { public class CapSubscribeAttribute : TopicAttribute { - public CapSubscribeAttribute(string routingKey) : base(routingKey) + public CapSubscribeAttribute(string name) : base(name) { } diff --git a/src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs b/src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs index c32e6df..35bbcc0 100644 --- a/src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs +++ b/src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs @@ -87,7 +87,7 @@ namespace DotNetCore.CAP.RabbitMQ var message = new MessageContext { Group = _queueName, - KeyName = e.RoutingKey, + Name = e.RoutingKey, Content = Encoding.UTF8.GetString(e.Body) }; MessageReceieved?.Invoke(sender, message); diff --git a/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs b/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs index 1e1ef2d..bc4bb8f 100644 --- a/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs +++ b/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs @@ -8,9 +8,9 @@ namespace DotNetCore.CAP.Abstractions [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)] public abstract class TopicAttribute : Attribute { - protected TopicAttribute(string topicName) + protected TopicAttribute(string name) { - Name = topicName; + Name = name; } ///