示例#1
0
        /// <summary>
        /// Sends a SubscribeChannels message to a store.
        /// </summary>
        /// <param name="channels">The channels.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <SubscribeChannels> SubscribeChannels(IDictionary <string, ChannelSubscribeInfo> channels, IMessageHeaderExtension extension = null)
        {
            var body = new SubscribeChannels
            {
                Channels = channels ?? new Dictionary <string, ChannelSubscribeInfo>(),
            };

            return(SendRequest(body, extension: extension));
        }
示例#2
0
        /// <summary>
        /// Sends a SubscribeChannels message to a producer.
        /// </summary>
        /// <param name="channelSubscribeInfos">The list of <see cref="ChannelSubscribeInfo" /> objects.</param>
        /// <returns>The message identifier.</returns>
        public virtual long SubscribeChannels(IList <ChannelSubscribeInfo> channelSubscribeInfos)
        {
            var header = CreateMessageHeader(Protocols.ChannelSubscribe, MessageTypes.ChannelSubscribe.SubscribeChannels);

            var channelSubscribeStart = new SubscribeChannels
            {
                Channels = channelSubscribeInfos
            };

            return(Session.SendMessage(header, channelSubscribeStart));
        }
 /// <summary>
 /// Handles the SubscribeChannels message from a consumer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="subscribeChannels">The SubscribeChannels message.</param>
 protected virtual void HandleSubscribeChannels(IMessageHeader header, SubscribeChannels subscribeChannels)
 {
     Notify(OnSubscribeChannels, header, subscribeChannels);
 }