-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from ojdev/dev
增加Json反序列化失败时的日志
- Loading branch information
Showing
9 changed files
with
83 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
RabbitMQ.EventBus.AspNetCore.Simple/Controllers/MessageBodyHandle00.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Microsoft.Extensions.Logging; | ||
using RabbitMQ.EventBus.AspNetCore.Events; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace RabbitMQ.EventBus.AspNetCore.Simple.Controllers | ||
{ | ||
public class MessageBodyHandle00 : IEventHandler<MessageBody>, IDisposable | ||
{ | ||
private Guid id; | ||
private readonly ILogger<MessageBodyHandle> _logger; | ||
|
||
public MessageBodyHandle00(ILogger<MessageBodyHandle> logger) | ||
{ | ||
id = Guid.NewGuid(); | ||
_logger = logger ?? throw new ArgumentNullException(nameof(logger)); | ||
} | ||
public void Dispose() | ||
{ | ||
Console.WriteLine("释放"); | ||
} | ||
|
||
public Task Handle(EventHandlerArgs<MessageBody> args) | ||
{ | ||
Console.WriteLine("=================================================="); | ||
Console.WriteLine(id + "=>" + typeof(MessageBody).Name); | ||
Console.WriteLine(args.Event.Body); | ||
Console.WriteLine(args.Original); | ||
Console.WriteLine(args.Redelivered); | ||
Console.WriteLine("=================================================="); | ||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
RabbitMQ.EventBus.AspNetCore.Simple/Controllers/MessageBodyHandle111.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Microsoft.Extensions.Logging; | ||
using RabbitMQ.EventBus.AspNetCore.Events; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace RabbitMQ.EventBus.AspNetCore.Simple.Controllers | ||
{ | ||
public class MessageBodyHandle111 : IEventHandler<MessageBody1> | ||
{ | ||
private Guid id; | ||
private readonly ILogger<MessageBodyHandle> _logger; | ||
|
||
public MessageBodyHandle111(ILogger<MessageBodyHandle> logger) | ||
{ | ||
id = Guid.NewGuid(); | ||
_logger = logger ?? throw new ArgumentNullException(nameof(logger)); | ||
} | ||
public void Dispose() | ||
{ | ||
Console.WriteLine("释放"); | ||
} | ||
|
||
public Task Handle(EventHandlerArgs<MessageBody1> args) | ||
{ | ||
Console.WriteLine("=================================================="); | ||
Console.WriteLine(id + "=>" + typeof(MessageBody1).Name); | ||
Console.WriteLine(args.Event.Body); | ||
Console.WriteLine(args.Original); | ||
Console.WriteLine(args.Redelivered); | ||
Console.WriteLine("=================================================="); | ||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters