public void ProcessJob(ActiveMqSchedulerManagementJob job)
        {
            var message = job.Consumer.ReceiveNoWait();
            while (message != null)
            {
                RemoveDeferredMessages(message.Properties[ScheduledMessage.AMQ_SCHEDULED_ID]);

                job.ExprirationDate = DateTime.Now + DeleteTaskMaxIdleTime;
                message = job.Consumer.ReceiveNoWait();
            }
        }
Example #2
0
        public void ProcessJob(ActiveMqSchedulerManagementJob job)
        {
            IMessage message = job.Consumer.ReceiveNoWait();

            while (message != null)
            {
                this.RemoveDeferredMessages(message.Properties[ScheduledMessage.AMQ_SCHEDULED_ID]);

                job.ExprirationDate = DateTime.Now + this.DeleteTaskMaxIdleTime;
                message             = job.Consumer.ReceiveNoWait();
            }
        }
        public void WhenProcessingJobs_ExpiredJobsAreDisposed()
        {
            const string Selector = "Selector";
            var message = new TransportMessage();
            var destination = new Mock<IDestination>().Object;
            var job = new ActiveMqSchedulerManagementJob(null, destination, DateTime.Now + TimeSpan.FromMinutes(-1));
            message.Headers[ActiveMqSchedulerManagement.ClearScheduledMessagesSelectorHeader] = Selector;

            this.activeMqSchedulerManagementCommandsMock.Setup(c => c.CreateActiveMqSchedulerManagementJob(Selector)).Returns(job);

            this.testee.HandleTransportMessage(message);
            this.testee.ProcessAllJobs(new CancellationToken(false));

            this.activeMqSchedulerManagementCommandsMock.Verify(c => c.DisposeJob(job));
        }
 public void DisposeJob(ActiveMqSchedulerManagementJob job)
 {
     job.Consumer.Dispose();
     consumerSession.DeleteDestination(job.Destination);
 }
Example #5
0
 public void DisposeJob(ActiveMqSchedulerManagementJob job)
 {
     job.Consumer.Dispose();
     this.consumerSession.DeleteDestination(job.Destination);
 }