コード例 #1
0
ファイル: MessageReplayer.cs プロジェクト: cdzkhxhdgs/Zebus
        private void ReplayMessage(TransportMessage unackedMessage)
        {
            var messageReplayed  = new MessageReplayed(_replayId, unackedMessage);
            var transportMessage = ToTransportMessage(messageReplayed);

            _transport.Send(transportMessage, new[] { _peer }, _emptySendContext);
        }
コード例 #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);
                }
            }
コード例 #3
0
ファイル: MessageReplayer.cs プロジェクト: cdzkhxhdgs/Zebus
        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());
            }
        }
コード例 #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);
                }
            }
コード例 #5
0
 protected virtual void OnMessageReplayed(MessageReplayed messageReplayed)
 {
 }
コード例 #6
0
            protected override void OnMessageReplayed(MessageReplayed messageReplayed)
            {
                _logger.DebugFormat("FORWARD: {0} {1}", messageReplayed.Message.MessageTypeId, messageReplayed.Message.Id);

                Transport._pendingReceives.Add(messageReplayed.Message);
            }
コード例 #7
0
 protected virtual void OnMessageReplayed(MessageReplayed messageReplayed)
 {
 }
コード例 #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);
            }
コード例 #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);

            }