Ejemplo n.º 1
0
        public ProductUpdateResponseItem[] DequeueProductUpdateResponseArray(int messageId)
        {
            ProductUpdateResponseItem[] products = null;
            var client = new QueueOf_ProductUpdateRequestArray_ProductUpdateResponseClient();

            DateTime?dequeuedAt             = null;
            var      numberOfFailedAttempts = 0;

            Log.ForCurrent.DebugFormat("Dequeueing ProductUpdateResponseArray. MessageId: {0}", messageId);
            for (var i = 0; i < _settings.MaximumNumberOfRetries; i++)
            {
                Thread.Sleep(_settings.MillisecondsBetweenRetries);
                products = client.DequeueMessage(messageId);

                if (products != null)
                {
                    dequeuedAt = DateTime.Now;
                    break;
                }

                numberOfFailedAttempts++;
            }

            _pimRequestLogRepository.UpdateRequestWithResponseData(messageId, dequeuedAt, numberOfFailedAttempts, products);

            return(products);
        }
Ejemplo n.º 2
0
        public ProductUpdateResponseItem[] DequeueProductUpdateResponseArray(int messageId)
        {
            ProductUpdateResponseItem[] products = null;
            var client = new QueueOf_ProductUpdateRequestArray_ProductUpdateResponseClient();

            DateTime? dequeuedAt = null;
            var numberOfFailedAttempts = 0;

            Log.ForCurrent.DebugFormat("Dequeueing ProductUpdateResponseArray. MessageId: {0}", messageId);
            for (var i = 0; i < _settings.MaximumNumberOfRetries; i++)
            {
                Thread.Sleep(_settings.MillisecondsBetweenRetries);
                products = client.DequeueMessage(messageId);

                if (products != null)
                {
                    dequeuedAt = DateTime.Now;
                    break;
                }

                numberOfFailedAttempts++;
            }

            _pimRequestLogRepository.UpdateRequestWithResponseData(messageId, dequeuedAt, numberOfFailedAttempts, products);

            return products;
        }
Ejemplo n.º 3
0
        public int EnqueueProductUpdateRequestArray(string primaryAction, string secondaryAction, ProductUpdateRequestItem[] queryItem)
        {
            Log.ForCurrent.DebugFormat("Enqueueing ProductUpdateRequestArray. Primary action: {0}. Secondary action: {1}", primaryAction, secondaryAction);
            var messageId = new QueueOf_ProductUpdateRequestArray_ProductUpdateResponseClient().EnqueueMessage(primaryAction, secondaryAction, queryItem);

            LogRequest(messageId, primaryAction, secondaryAction, queryItem);

            return(messageId);
        }
Ejemplo n.º 4
0
        public int EnqueueProductUpdateRequestArray(string primaryAction, string secondaryAction, ProductUpdateRequestItem[] queryItem)
        {
            Log.ForCurrent.DebugFormat("Enqueueing ProductUpdateRequestArray. Primary action: {0}. Secondary action: {1}", primaryAction, secondaryAction);
            var messageId = new QueueOf_ProductUpdateRequestArray_ProductUpdateResponseClient().EnqueueMessage(primaryAction, secondaryAction, queryItem);

            LogRequest(messageId, primaryAction, secondaryAction, queryItem);

            return messageId;
        }