Example #1
0
        private void ThrottlePublishOfNextMessageIfTokenIsAboutToExpire(Message command)
        {
            //this may not be needed now as we have auto retries, but i think it is possibly an interesting idea,
            //so i have left it in.

            //if token is about to expire for the client then the message just sent will trigger
            //a reconnection, so the subsequent message should not be sent immediately or it will be
            //lost and have to be replayed
            if (brokerConnectionManager.ActiveBrokerTokenIsDueToExpire(command.BrokerId))
            {
                Task.Delay(new TimeSpan(0, 0, 15))
                .Wait();
            }
        }