﻿using System;
using Abc.Zebus.Util;

namespace Abc.Zebus.Transport
{
    public class ZmqSocketOptions : IZmqSocketOptions
    {
        public ZmqSocketOptions()
        {
            ReadTimeout = 300.Milliseconds();
            SendHighWaterMark = 20000;
            SendTimeout = 1000.Milliseconds();
            SendRetriesBeforeSwitchingToClosedState = 5;
            ClosedStateDuration = 15.Seconds();
            ReceiveHighWaterMark = 20000;
        }

        public TimeSpan ReadTimeout { set; get; }
        public int SendHighWaterMark { get; set; }
        public TimeSpan SendTimeout { get; set; }
        public int SendRetriesBeforeSwitchingToClosedState { get; set; }
        public TimeSpan ClosedStateDuration { get; set; }
        public int ReceiveHighWaterMark { get; set; }
    }
}
﻿using System;
using Abc.Zebus.Util;

namespace Abc.Zebus.Transport
{
    public class ZmqSocketOptions : IZmqSocketOptions
    {
        public ZmqSocketOptions()
        {
            ReadTimeout = 300.Milliseconds();
            SendHighWaterMark = 20000;
            SendTimeout = 100.Milliseconds();
            SendRetriesBeforeSwitchingToClosedState = 2;
            ClosedStateDuration = 15.Seconds();
            ReceiveHighWaterMark = 20000;
        }

        public TimeSpan ReadTimeout { set; get; }
        public int SendHighWaterMark { get; set; }
        public TimeSpan SendTimeout { get; set; }
        public int SendRetriesBeforeSwitchingToClosedState { get; set; }
        public TimeSpan ClosedStateDuration { get; set; }
        public int ReceiveHighWaterMark { get; set; }
    }
}
Make send try policy more aggressive
Make send try policy more aggressive

A slow consumer would block the sending thread for 6s
(1+5 retries * 1000ms) before being marked as down, which prevents other
peers from receiving messages, the new setting is more aggressive
(300ms).
