public TmqClient CreateInstance()
        {
            TmqClient client = new TmqClient();

            if (!string.IsNullOrEmpty(_id))
            {
                client.ClientId = _id;
            }

            if (!string.IsNullOrEmpty(_name))
            {
                client.SetClientName(_name);
            }

            if (!string.IsNullOrEmpty(_type))
            {
                client.SetClientType(_type);
            }

            if (!string.IsNullOrEmpty(_token))
            {
                client.SetClientToken(_token);
            }

            if (_enhance != null)
            {
                _enhance(client);
            }

            return(client);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Client creation action for server instances
        /// </summary>
        private static TmqClient CreateInstanceClient(InstanceOptions options)
        {
            TmqClient client = new TmqClient();

            client.SetClientName(options.Name);
            client.SetClientToken(options.Token);
            client.SetClientType("server");
            return(client);
        }