public async Task <ActionResult> GetAlerts()
        {
            var sessionId = Guid.NewGuid().ToString();
            var message   = new BrokeredMessage
            {
                SessionId = sessionId
            };
            const string queueName           = "Incoming-Get-Alert-List-Queue";
            const string processsedQueueName = "Processed-Get-Alert-List-Queue";
            await _messageBrokerService.SendBrokeredMessage(message, queueName);

            var result =
                await _messageBrokerService.WaitOnBrokeredMessage <GetAlertListResultMessage>(processsedQueueName,
                                                                                              sessionId, 5);

            return(Ok(result));
        }
        public async Task <ActionResult> GetUserRole([FromRoute] Guid userId)
        {
            var sessionId = Guid.NewGuid().ToString();
            var message   = new BrokeredMessage(userId)
            {
                SessionId = sessionId
            };
            const string queueName           = "Incoming-Get-User-Roles-Queue";
            const string processsedQueueName = "Processed-Get-User-Roles-Queue";
            await _messageBrokerService.SendBrokeredMessage(message, queueName);

            var result =
                await _messageBrokerService.WaitOnBrokeredMessage <GetUserRolesResultMessage>(processsedQueueName,
                                                                                              sessionId);

            return(Ok(result.Roles));
        }
        public async Task <ActionResult> Post(
            [FromRoute] Guid transportationId,
            [FromBody] IEnumerable <CapturedLocation> capturedLocations)
        {
            var capturedLocationDtos =
                _autoMapperService.MapObject <IEnumerable <CapturedLocationDto> >(capturedLocations);
            var postMessage = new PostCapturedLocationsMessage
            {
                TransportationId  = transportationId,
                CapturedLocations = capturedLocationDtos
            };
            var sessionId = Guid.NewGuid().ToString();
            var message   = new BrokeredMessage(postMessage)
            {
                SessionId = sessionId
            };
            const string queueName = "Incoming-Post-Captured-Locations-Queue";
            // Processed queue currently not in use because there is no need to wait for a response from the microservice. The response can be delivered back, that message was sent successfully.
            //const string processsedQueueName = "Processed-Post-Captured-Locations-Queue";
            await _messageBrokerService.SendBrokeredMessage(message, queueName);

            return(NoContent());
        }