private static Unsubscribe getUnsubscribeMessage(NetMessage message) { NetUnsubscribe netUnsub = message.Action.UnsbuscribeMessage; Unsubscribe unsubscribe = new Unsubscribe(); unsubscribe.Action_id = netUnsub.ActionId; unsubscribe.Destination = netUnsub.Destination; unsubscribe.Destination_type = translate(netUnsub.DestinationType); return(unsubscribe); }
/// <summary> /// Cancel a previous subscription. /// </summary> /// <param name="subscription">A Subscription instance.</param> /// <param name="acceptRequest">An AcceptRequest instance.</param> public void Unsubscribe(Subscription subscription, AcceptRequest acceptRequest) { if (IsClosed()) { return; } NetUnsubscribe netUnsubscribe = new NetUnsubscribe(subscription.DestinationPattern, subscription.DestinationType); NetAction action = new NetAction(NetAction.ActionType.UNSUBSCRIBE); action.UnsbuscribeMessage = netUnsubscribe; NetMessage netMessage = new NetMessage(action, subscription.Headers); protocolHandler.HandleOutgoingMessage(netMessage, acceptRequest); protocolHandler.RemoveSubscription(subscription); }
/// <summary> /// Cancel a previous subscription. /// </summary> /// <param name="subscription">A Subscription instance.</param> /// <param name="acceptRequest">An AcceptRequest instance.</param> public void Unsubscribe(Subscription subscription, AcceptRequest acceptRequest) { if (IsClosed()) return; NetUnsubscribe netUnsubscribe = new NetUnsubscribe(subscription.DestinationPattern, subscription.DestinationType); NetAction action = new NetAction(NetAction.ActionType.UNSUBSCRIBE); action.UnsbuscribeMessage = netUnsubscribe; NetMessage netMessage = new NetMessage(action, subscription.Headers); protocolHandler.HandleOutgoingMessage(netMessage, acceptRequest); protocolHandler.RemoveSubscription(subscription); }