private void Initialize(IDataStorage storage) { var publishMessage = storage.StoreMessage("test.publish.message", new Message( new Dictionary <string, string>() { [Headers.MessageId] = "1000000000", ["test-header"] = "test-value" }, null)); storage.ChangePublishStateAsync(publishMessage, Internal.StatusName.Succeeded); var receivedMessage = storage.StoreReceivedMessage("test.received.message", "test.group", new Message( new Dictionary <string, string>() { [Headers.MessageId] = "1000000001", ["test-header"] = "test-value" }, null)); _receivedMessageId = long.Parse(receivedMessage.DbId); storage.ChangeReceiveStateAsync(receivedMessage, Internal.StatusName.Failed); }
private async Task SetSuccessfulState(MediumMessage message) { message.ExpiresAt = DateTime.Now.AddSeconds(_options.Value.SucceedMessageExpiredAfter); await _dataStorage.ChangePublishStateAsync(message, StatusName.Succeeded); }