소스 검색

rename MessageBase to MessageContext

master
Savorboard 7 년 전
부모
커밋
73baaa84dc
5개의 변경된 파일12개의 추가작업 그리고 8개의 파일을 삭제
  1. +3
    -2
      src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs
  2. +3
    -2
      src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
  3. +2
    -2
      src/DotNetCore.CAP/Abstractions/ConsumerContext.cs
  4. +1
    -1
      src/DotNetCore.CAP/IConsumerClient.cs
  5. +3
    -1
      src/DotNetCore.CAP/Infrastructure/MessageContext.cs

+ 3
- 2
src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs 파일 보기

@@ -12,7 +12,7 @@ namespace DotNetCore.CAP.Kafka
private readonly KafkaOptions _kafkaOptions;
private Consumer<Null, string> _consumerClient;

public event EventHandler<MessageBase> MessageReceieved;
public event EventHandler<MessageContext> MessageReceieved;

public IDeserializer<string> StringDeserializer { get; set; }

@@ -65,8 +65,9 @@ namespace DotNetCore.CAP.Kafka

private void ConsumerClient_OnMessage(object sender, Message<Null, string> e)
{
var message = new MessageBase
var message = new MessageContext
{
Group = _groupId,
KeyName = e.Topic,
Content = e.Value
};


+ 3
- 2
src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs 파일 보기

@@ -17,7 +17,7 @@ namespace DotNetCore.CAP.RabbitMQ
private IConnection _connection;
private IModel _channel;

public event EventHandler<MessageBase> MessageReceieved;
public event EventHandler<MessageContext> MessageReceieved;

public RabbitMQConsumerClient(string queueName, RabbitMQOptions options)
{
@@ -77,8 +77,9 @@ namespace DotNetCore.CAP.RabbitMQ

private void OnConsumerReceived(object sender, BasicDeliverEventArgs e)
{
var message = new MessageBase
var message = new MessageContext
{
Group = _queueName,
KeyName = e.RoutingKey,
Content = Encoding.UTF8.GetString(e.Body)
};


+ 2
- 2
src/DotNetCore.CAP/Abstractions/ConsumerContext.cs 파일 보기

@@ -13,7 +13,7 @@ namespace DotNetCore.CAP.Abstractions
/// </summary>
/// <param name="descriptor">consumer method descriptor. </param>
/// <param name="message"> reveied message.</param>
public ConsumerContext(ConsumerExecutorDescriptor descriptor, MessageBase message)
public ConsumerContext(ConsumerExecutorDescriptor descriptor, MessageContext message)
{
ConsumerDescriptor = descriptor ?? throw new ArgumentNullException(nameof(descriptor));
DeliverMessage = message ?? throw new ArgumentNullException(nameof(message));
@@ -27,6 +27,6 @@ namespace DotNetCore.CAP.Abstractions
/// <summary>
/// consumer reveived message.
/// </summary>
public MessageBase DeliverMessage { get; set; }
public MessageContext DeliverMessage { get; set; }
}
}

+ 1
- 1
src/DotNetCore.CAP/IConsumerClient.cs 파일 보기

@@ -14,6 +14,6 @@ namespace DotNetCore.CAP

void Listening(TimeSpan timeout);

event EventHandler<MessageBase> MessageReceieved;
event EventHandler<MessageContext> MessageReceieved;
}
}

src/DotNetCore.CAP/Infrastructure/MessageBase.cs → src/DotNetCore.CAP/Infrastructure/MessageContext.cs 파일 보기

@@ -1,7 +1,9 @@
namespace DotNetCore.CAP.Infrastructure
{
public class MessageBase
public class MessageContext
{
public string Group { get; set; }

public string KeyName { get; set; }

public string Content { get; set; }

불러오는 중...
취소
저장