예제 #1
0
 /// <summary>
 /// Initializes a new instance of the KubeMQ.SDK.csharp.Subscription.SubscribeRequest using a set of parameters.
 /// </summary>
 /// <param name="subscriptionType">Represents the type of Subscriber operation KubeMQ.SDK.csharp.Subscription.SubscribeType.</param>
 /// <param name="clientID">Represents an identifier that will subscribe to kubeMQ under.</param>
 /// <param name="channel">Represents the channel name that will subscribe to under kubeMQ.</param>
 /// <param name="group">Represents the group the channel is assign to , if not filled will be empty string(no group).</param>
 /// <param name="eventsStoreType"> Represents the type of subscription to persistence using KubeMQ.SDK.csharp.Subscription.EventsStoreType.</param>
 /// <param name="eventsStoreTypeValue">Represents the value of subscription to persistence queue.</param>
 public SubscribeRequest(SubscribeType subscriptionType, string clientID, string channel, EventsStoreType eventsStoreType, long eventsStoreTypeValue, string group = "")
 {
     SubscribeType        = subscriptionType;
     ClientID             = clientID;
     Channel              = channel;
     Group                = group;
     EventsStoreType      = eventsStoreType;
     EventsStoreTypeValue = eventsStoreTypeValue;
 }
예제 #2
0
        protected SubscribeRequest CreateSubscribeRequest(SubscribeType subscriptionType  = SubscribeType.SubscribeTypeUndefined,
                                                          EventsStoreType eventsStoreType = EventsStoreType.Undefined,
                                                          int TypeValue = 0, string group = "")
        {
            Random           random           = new Random();
            SubscribeRequest subscribeRequest = new SubscribeRequest()
            {
                Channel              = ChannelName,
                ClientID             = random.Next(9, 19999).ToString(),
                EventsStoreType      = eventsStoreType,
                EventsStoreTypeValue = TypeValue,
                Group         = group,
                SubscribeType = subscriptionType
            };

            return(subscribeRequest);
        }