private void ReplayMessage(TransportMessage unackedMessage) { var messageReplayed = new MessageReplayed(_replayId, unackedMessage); var transportMessage = ToTransportMessage(messageReplayed); _transport.Send(transportMessage, new[] { _peer }, _emptySendContext); }
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); } }
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()); } }
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); } }
protected virtual void OnMessageReplayed(MessageReplayed messageReplayed) { }
protected override void OnMessageReplayed(MessageReplayed messageReplayed) { _logger.DebugFormat("FORWARD: {0} {1}", messageReplayed.Message.MessageTypeId, messageReplayed.Message.Id); Transport._pendingReceives.Add(messageReplayed.Message); }
protected override void OnMessageReplayed(MessageReplayed messageReplayed) { Transport._logger.DebugFormat("FORWARD: {0} {1}", messageReplayed.Message.MessageTypeId, messageReplayed.Message.Id); Transport._pendingReceives.Add(messageReplayed.Message); }
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); }