예제 #1
0
        public async Task <bool> EnqueueNotification(NotificationItem notificationQueue)
        {
            if (SystemBehaviorConfig.ServiceBusType == ServiceBusTypes.Rabbit)
            {
                return(_rabbitOutboundQueueProvider.EnqueueNotification(notificationQueue));
            }

            VerifyAndCreateClients();

            Message message = new Message(Encoding.UTF8.GetBytes(ObjectSerialization.Serialize(notificationQueue)));

            message.MessageId = string.Format("{0}", notificationQueue.GetHashCode());

            return(await SendMessage(_notificationClient, message));
        }
예제 #2
0
        public void EnqueueNotification(NotificationItem notificationQueue)
        {
            if (SystemBehaviorConfig.ServiceBusType == ServiceBusTypes.Rabbit)
            {
                _rabbitOutboundQueueProvider.EnqueueNotification(notificationQueue);
                return;
            }

            VerifyAndCreateClients();

            BrokeredMessage message = new BrokeredMessage(ObjectSerialization.Serialize(notificationQueue));

            message.MessageId = string.Format("{0}", notificationQueue.GetHashCode());

            SendMessage(_notificationClient, message);
        }