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

            VerifyAndCreateClients();

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

            message.MessageId = Guid.NewGuid().ToString();

            return(await SendMessage(_shiftsClient, message));
        }
예제 #2
0
        public void EnqueueShiftNotification(ShiftQueueItem shiftQueueItem)
        {
            if (SystemBehaviorConfig.ServiceBusType == ServiceBusTypes.Rabbit)
            {
                _rabbitOutboundQueueProvider.EnqueueShiftNotification(shiftQueueItem);
                return;
            }

            VerifyAndCreateClients();

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

            message.MessageId = Guid.NewGuid().ToString();

            SendMessage(_shiftsClient, message);
        }