Ejemplo n.º 1
0
        internal override void SpecificRestart(IModel model)
        {
            MyConsumer = CreateConsumer(model);
            if (_mySettings.CancelationTime.HasValue)
            {
                MyConsumer.ShutdownTimeout = (int)Math.Min(_mySettings.CancelationTime.Value.TotalMilliseconds, int.MaxValue);
            }
            MyConsumer.OnStart    += StartHandler;
            MyConsumer.OnStop     += StopHandler;
            MyConsumer.OnShutdown += GetShutdownHandler(); //automatically restart a new consumer in case of failure
            MyConsumer.OnDelete   += GetDeleteHandler();   //automatically restart a new consumer in case of failure
            MyConsumer.OnError    += ErrorHandler;

            MyConsumer.OnMessage += MessageHandler;
        }
Ejemplo n.º 2
0
        internal override void SpecificRestart(IModel model)
        {
            MyConsumer = CreateConsumer(model);
            if (_mySettings.CancelationTime.HasValue)
                MyConsumer.ShutdownTimeout = (int) Math.Min(_mySettings.CancelationTime.Value.TotalMilliseconds, int.MaxValue);
            MyConsumer.OnStart += StartHandler;
            MyConsumer.OnStop += StopHandler;
            MyConsumer.OnShutdown += GetShutdownHandler(); //automatically restart a new consumer in case of failure
            MyConsumer.OnDelete += GetDeleteHandler(); //automatically restart a new consumer in case of failure
            MyConsumer.OnError += ErrorHandler;

            MyConsumer.OnMessage += MessageHandler;
        }