Exemple #1
0
        /// <summary>
        /// Sends a UnsubscribeChannels message to a store.
        /// </summary>
        /// <param name="channelIds">The channel IDs.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <UnsubscribeChannels> UnsubscribeChannels(IDictionary <string, long> channelIds, IMessageHeaderExtension extension = null)
        {
            var body = new UnsubscribeChannels
            {
                ChannelIds = channelIds ?? new Dictionary <string, long>(),
            };

            return(SendRequest(body, extension: extension));
        }
Exemple #2
0
        /// <summary>
        /// Sends a UnsubscribeChannels message to a producer.
        /// </summary>
        /// <param name="channelIds">The list of channel identifiers.</param>
        /// <returns>The message identifier.</returns>
        public virtual long UnsubscribeChannels(IList <long> channelIds)
        {
            var header = CreateMessageHeader(Protocols.ChannelSubscribe, MessageTypes.ChannelSubscribe.UnsubscribeChannels);

            var channelSubscribeStop = new UnsubscribeChannels
            {
                ChannelIds = channelIds
            };

            return(Session.SendMessage(header, channelSubscribeStop));
        }
 /// <summary>
 /// Handles the UnsubscribeChannels message from a consumer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="unsubscribeChannels">The UnsubscribeChannels message.</param>
 protected virtual void HandleUnsubscribeChannels(IMessageHeader header, UnsubscribeChannels unsubscribeChannels)
 {
     Notify(OnUnsubscribeChannels, header, unsubscribeChannels);
 }