Esempio n. 1
0
        public async Task <IActionResult> GetQueue(string queueName)
        {
            Verify.IsNotEmpty(nameof(queueName), queueName);

            RequestContext requestContext = this.HttpContext.GetRequestContext();
            var            context        = requestContext.Context.WithTag(_tag);

            InternalQueueManagementV1 result = await _management.GetQueue(context, queueName);

            if (result == null)
            {
                return(new StandardActionResult(context, HttpStatusCode.NotFound));
            }

            return(new StandardActionResult(context)
                   .SetContent(result.ConvertTo()));
        }
Esempio n. 2
0
        public async Task SetQueueSuccessTests()
        {
            var context = _workContext.WithTag(_tag);

            const string queueName = "test-queue";
            await _management.SetQueue(context, queueName, 10, 11, 12);

            InternalQueueManagementV1 result = await _management.GetQueue(context, queueName);

            result.Should().NotBeNull();
            result.QueueName.Should().Be(queueName);
            result.CurrentSizeLimit.Should().Be(10);
            result.CurrentRetryLimit.Should().Be(11);
            result.LockValidForSec.Should().Be(12);
            result.Disable.Should().BeFalse();
            result.QueueLength.Should().Be(0);

            await _management.DeleteQueue(context, queueName);

            result = await _management.GetQueue(context, queueName);

            result.Should().BeNull();
        }