public void TestAcknowledgeConfirmation() { _confirmingDistributor.Distribute(_set, _tracked, ApplicationMessageType.AddAttribute); var trackingIds = _confirmingDistributor.AllTrackingIds; Assert.Single(trackingIds); var tackingId = trackingIds.ToList()[0]; Assert.Equal(2, _confirmingDistributor.UnconfirmedNodesFor(tackingId).Count()); _confirmingDistributor.AcknowledgeConfirmation(tackingId, _confirmingDistributor.UnconfirmedNodesFor(tackingId).ToList()[0]); Assert.Single(_confirmingDistributor.UnconfirmedNodesFor(tackingId)); _confirmingDistributor.AcknowledgeConfirmation(tackingId, _confirmingDistributor.UnconfirmedNodesFor(tackingId).ToList()[0]); Assert.Empty(_confirmingDistributor.UnconfirmedNodesFor(tackingId)); }
//========================================= // InboundStreamInterest (operations App) //========================================= #region InboundStreamInterest (operations App) public void HandleInboundStreamMessage(AddressType addressType, RawMessage message) { if (addressType.IsOperational) { var request = new ReceivedAttributeMessage(message); var type = request.Type; switch (type) { case ApplicationMessageType.CreateAttributeSet: _remoteRequestHandler.CreateAttributeSet(request); break; case ApplicationMessageType.AddAttribute: _remoteRequestHandler.AddAttribute(request); break; case ApplicationMessageType.ReplaceAttribute: _remoteRequestHandler.ReplaceAttribute(request); break; case ApplicationMessageType.RemoveAttribute: _remoteRequestHandler.RemoveAttribute(request); break; case ApplicationMessageType.RemoveAttributeSet: _remoteRequestHandler.RemoveAttributeSet(request); break; case ApplicationMessageType.ConfirmCreateAttributeSet: case ApplicationMessageType.ConfirmAddAttribute: case ApplicationMessageType.ConfirmReplaceAttribute: case ApplicationMessageType.ConfirmRemoveAttribute: case ApplicationMessageType.ConfirmRemoveAttributeSet: _confirmingDistributor.AcknowledgeConfirmation(request.CorrelatingMessageId, _configuration.NodeMatching(request.SourceNodeId)); _confirmationInterest.Confirm(request.SourceNodeId, request.AttributeSetName, request.AttributeName, type); break; default: _configuration.Logger.Warn($"Received unknown message: {type.ToString()}"); break; } } }