Beispiel #1
0
        public bool EnqueuePaymentEvent(CqrsEvent cqrsEvent)
        {
            if (Config.SystemBehaviorConfig.ServiceBusType == Config.ServiceBusTypes.Rabbit)
            {
                _rabbitOutboundQueueProvider.EnqueuePaymentEvent(cqrsEvent);
                return(true);
            }

            var             serializedObject = ObjectSerialization.Serialize(cqrsEvent);
            BrokeredMessage message          = new BrokeredMessage(serializedObject);

            message.MessageId = string.Format("{0}", cqrsEvent.EventId);

            return(SendMessage(_systemClient, message));
        }
Beispiel #2
0
        public async Task <bool> EnqueuePaymentEventAsync(CqrsEvent cqrsEvent)
        {
            if (Config.SystemBehaviorConfig.ServiceBusType == Config.ServiceBusTypes.Rabbit)
            {
                _rabbitOutboundQueueProvider.EnqueuePaymentEvent(cqrsEvent);
                return(true);
            }

            var     serializedObject = ObjectSerialization.Serialize(cqrsEvent);
            Message message          = new Message(Encoding.UTF8.GetBytes(serializedObject));

            message.MessageId = string.Format("{0}", cqrsEvent.EventId);

            return(await SendMessageAsync(_systemClient, message));
        }