浏览代码

reorganize error message prompts.

master
Savorboard 7 年前
父节点
当前提交
141ece8231
共有 2 个文件被更改,包括 8 次插入7 次删除
  1. +4
    -1
      src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs
  2. +4
    -6
      src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs

+ 4
- 1
src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs 查看文件

@@ -78,7 +78,10 @@ namespace DotNetCore.CAP.Kafka

private void ConsumerClient_OnConsumeError(object sender, Message e)
{
OnError?.Invoke(sender, $"Consumer client raised an error. Topic:{e.Topic}, Reason:{e.Error}");
var message = e.Deserialize<Null, string>(null, StringDeserializer);

OnError?.Invoke(sender, $"An error occurred during consume the message; Topic:'{e.Topic}'," +
$"Message:'{message.Value}', Reason:'{e.Error}'.");
}

private void ConsumerClient_OnMessage(object sender, Message<Null, string> e)


+ 4
- 6
src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs 查看文件

@@ -78,12 +78,10 @@ namespace DotNetCore.CAP.RabbitMQ
RabbitMQOptions.ExchangeType,
true);

var arguments = new Dictionary<string, object> { { "x-message-ttl", _rabbitMQOptions.QueueMessageExpires } };
_channel.QueueDeclare(_queueName,
true,
false,
false,
arguments);
var arguments = new Dictionary<string, object> {
{ "x-message-ttl", _rabbitMQOptions.QueueMessageExpires }
};
_channel.QueueDeclare(_queueName, true, false, false, arguments);

_connectionPool.Return(connection);
}


正在加载...
取消
保存