Beispiel #1
0
        public void Run()
        {
            audit.LogLine("Starting client");

            try
            {
                using (var remoteBroker = new RemoteBroker(
                           config.Hostname,
                           config.Port,
                           config.RequestQueueName,
                           config.ResponseQueueName,
                           config.RequestTimeoutMilliseconds))
                {
                    audit.LogLine("Waiting for requests");
                    var request = remoteBroker.Receive();
                    while (request.HasValue)
                    {
                        request = ApplyProcessingRules(request.Value, deployProcessingRules, remoteBroker);
                    }
                }
            }
            catch (Exception ex)
            {
                audit.LogException("There was a problem processing messages", ex);
            }

            audit.LogLine("Stopping client");
        }
Beispiel #2
0
 private Maybe <Request> GetNextRequest(RemoteBroker remoteBroker, IResponse response)
 {
     if (response is FatalErrorResponse)
     {
         return(Maybe <Request> .None);
     }
     else
     {
         return(remoteBroker.Receive());
     }
 }
Beispiel #3
0
        public void GoLiveWith(ProcessingRules processingRules)
        {
            audit.LogLine("Starting client");

            try
            {
                using (var remoteBroker = new RemoteBroker(hostname, port, uniqueId, TimeToWaitForRequests))
                {
                    audit.LogLine("Waiting for requests");
                    var request = remoteBroker.Receive();
                    while (request.HasValue)
                    {
                        request = ApplyProcessingRules(request.Value, processingRules, remoteBroker);
                    }
                }
            }
            catch (Exception ex)
            {
                audit.LogException("There was a problem processing messages", ex);
            }

            audit.LogLine("Stopping client");
        }
 public Maybe <Request> GetNextRequest(RemoteBroker remoteBroker) => remoteBroker.Receive();