private async Task HandleMessageAsync(Message message, CancellationToken token)
        {
            try
            {
                var entityEvent = _eventsSerializationService.DeserializeEvent(message.Body);

                await _publishingService.PublishEventToGlobalSubscriptionsAsync(entityEvent).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                _logger.MessagesProcessingThrew(ex, message.MessageId);

                throw;
            }
        }
        public async Task InvokeAsync(
            GlobalPublishPipelineModuleConfig config,
            PipelineContext pipelineContext,
            NextModuleDelegate invokeNextModule
            )
        {
            if (config.SenderType != null)
            {
                if (_eventSenders.TryGetValue(config.SenderType, out var eventSender))
                {
                    await eventSender.SendAsync(pipelineContext.PipelineEvent).ConfigureAwait(false);
                }
                else
                {
                    throw new EventSenderNotFoundException();
                }
            }
            else
            {
                await _publishingService.PublishEventToGlobalSubscriptionsAsync(pipelineContext.PipelineEvent).ConfigureAwait(false);
            }

            await invokeNextModule(pipelineContext).ConfigureAwait(false);
        }