add supports for ZeroMQ, XRabbitMQ, XKafka ...
This commit is contained in:
@@ -6,6 +6,8 @@ using Microsoft.Extensions.Logging;
|
||||
using xCommons.Extensions;
|
||||
using xEventService.Configuration;
|
||||
using xEventService.Constants;
|
||||
using xEventService.Extensions;
|
||||
using xEventService.Models;
|
||||
using xExceptions.Constants;
|
||||
|
||||
namespace xEventService.Providers
|
||||
@@ -87,10 +89,21 @@ namespace xEventService.Providers
|
||||
)
|
||||
{
|
||||
//
|
||||
await DoWorkAsync(
|
||||
payload: consumeResult.Message,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
var message = consumeResult
|
||||
.Message
|
||||
.Value
|
||||
.FromJSON<XEventMessage>();
|
||||
if (message.IsValid(
|
||||
allowedSenders: allowedSenders,
|
||||
allowedActions: allowedActions)
|
||||
)
|
||||
{
|
||||
//
|
||||
await DoWorkAsync(
|
||||
payload: consumeResult.Message,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ConsumeException)
|
||||
@@ -105,13 +118,18 @@ namespace xEventService.Providers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose Implementation ...
|
||||
/// Dispose Object ...
|
||||
/// </summary>
|
||||
public override void Dispose()
|
||||
{
|
||||
//
|
||||
consumer.Close();
|
||||
consumer.Dispose();
|
||||
if (consumer != null)
|
||||
{
|
||||
consumer.Close();
|
||||
consumer.Dispose();
|
||||
}
|
||||
|
||||
//
|
||||
GC.SuppressFinalize(this);
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user