Esempio n. 1
0
        protected override void ConfigureServiceBusReceiveEndpoint(IServiceBusReceiveEndpointConfigurator configurator)
        {
            configurator.LockDuration = TimeSpan.FromSeconds(60);

            configurator.UseRenewLock(TimeSpan.FromSeconds(20));

            configurator.Consumer <PingConsumer>();
        }
Esempio n. 2
0
        private void TuneForReportExecution(IServiceBusReceiveEndpointConfigurator r)
        {
            // RSMassTransit expects multiple service instances, competing for
            // infrequent, long-running requests.  Prefetch optimizes for the
            // opposite case and actually *hinders* the spread of infrequent
            // messages across instances.  Therefor, turn prefetch off here.
            r.PrefetchCount = 0;

            // Report execution is single-threaded and typically has both idle
            // periods (waiting on query results) and CPU-bound periods
            // (rendering).  Thus SSRS *should* be able to support more
            // concurrent reports than the number of processors in the system.
            //r.MaxConcurrentCalls = Environment.ProcessorCount * 2;
            //
            // However, while investigating tuning options and future load
            // compensation mechanisms, this will stay at a safer number.
            r.MaxConcurrentCalls = Environment.ProcessorCount;

            // When RSMassTransit tries to pause or stop message consumption,
            // unwanted messages continue to be received, due to limitations in
            // the Azure Service Bus OnMessageAsync API.  The messages accrue
            // unconsumed up to the MaxConcurrentCalls limit.  To ensure those
            // messages quickly become consumable by a competing instance, use
            // a short message lock duration, and auto-renew the lock while
            // consuming a message.
            r.LockDuration = TimeSpan.FromSeconds(60);
            r.UseRenewLock(TimeSpan.FromSeconds(30));

            // The short lock period, combined with several paused instances,
            // can cause many failed delivery attempts.  Use a high enough
            // maximum delivery count to avoid these actionable messages
            // getting dead-lettered.
            r.MaxDeliveryCount = 16;

            // It is reasonable to assume that any client will have given up
            // waiting for their response after a day.
            r.DefaultMessageTimeToLive = TimeSpan.FromDays(1);
        }