Ejemplo n.º 1
0
        private void ReplayMessage(TransportMessage unackedMessage)
        {
            var messageReplayed  = new MessageReplayed(_replayId, unackedMessage);
            var transportMessage = ToTransportMessage(messageReplayed);

            _transport.Send(transportMessage, new[] { _peer }, _emptySendContext);
        }
Ejemplo n.º 2
0
            protected override void OnMessageReplayed(MessageReplayed messageReplayed)
            {
                _logger.DebugFormat("REPLAY: {0} {1}", messageReplayed.Message.MessageTypeId, messageReplayed.Message.Id);

                Transport.TriggerMessageReceived(messageReplayed.Message);
                Transport._receivedMessagesIds.TryAdd(messageReplayed.Message.Id, true);

                _replayCount++;
                if (_replayCount % 100 == 0)
                {
                    _logger.InfoFormat("Replayed {0} messages...", _replayCount);
                }
            }
Ejemplo n.º 3
0
        private void ForwardLiveMessages(CancellationToken cancellationToken)
        {
            var phaseEnd = DateTime.UtcNow + _persistenceConfiguration.SafetyPhaseDuration;

            while (DateTime.UtcNow < phaseEnd && !cancellationToken.IsCancellationRequested)
            {
                if (!_liveMessages.TryTake(out var liveMessage, 200))
                {
                    continue;
                }

                var messageReplayed = new MessageReplayed(_replayId, liveMessage);
                _transport.Send(ToTransportMessage(messageReplayed), new[] { _peer }, new SendContext());
            }
        }
Ejemplo n.º 4
0
            protected override void OnMessageReplayed(MessageReplayed messageReplayed)
            {
                Transport._logger.DebugFormat("REPLAY: {0} {1}", messageReplayed.Message.MessageTypeId, messageReplayed.Message.Id);

                // the message was persisted because it comes from the persistence
                // but previous Zebus versions do not specify the WasPersisted field
                // => force WasPersisted to support previous Zebus version and make sure the message will be acked
                messageReplayed.Message.WasPersisted = true;

                Transport.TriggerMessageReceived(messageReplayed.Message);
                Transport._receivedMessagesIds.TryAdd(messageReplayed.Message.Id, true);

                _replayCount++;
                if (_replayCount % 100 == 0)
                {
                    Transport._logger.InfoFormat("Replayed {0} messages...", _replayCount);
                }
            }
Ejemplo n.º 5
0
 protected virtual void OnMessageReplayed(MessageReplayed messageReplayed)
 {
 }
Ejemplo n.º 6
0
            protected override void OnMessageReplayed(MessageReplayed messageReplayed)
            {
                _logger.DebugFormat("FORWARD: {0} {1}", messageReplayed.Message.MessageTypeId, messageReplayed.Message.Id);

                Transport._pendingReceives.Add(messageReplayed.Message);
            }
Ejemplo n.º 7
0
 protected virtual void OnMessageReplayed(MessageReplayed messageReplayed)
 {
 }
Ejemplo n.º 8
0
            protected override void OnMessageReplayed(MessageReplayed messageReplayed)
            {
                Transport._logger.DebugFormat("FORWARD: {0} {1}", messageReplayed.Message.MessageTypeId, messageReplayed.Message.Id);

                Transport._pendingReceives.Add(messageReplayed.Message);
            }
Ejemplo n.º 9
0
            protected override void OnMessageReplayed(MessageReplayed messageReplayed)
            {
                Transport._logger.DebugFormat("REPLAY: {0} {1}", messageReplayed.Message.MessageTypeId, messageReplayed.Message.Id);

                messageReplayed.Message.ForcePersistenceAck = true;
                Transport.TriggerMessageReceived(messageReplayed.Message);
                Transport._receivedMessagesIds.TryAdd(messageReplayed.Message.Id, true);

                _replayCount++;
                if (_replayCount % 100 == 0)
                    Transport._logger.InfoFormat("Replayed {0} messages...", _replayCount);

            }