コード例 #1
0
        internal void Set(string name, string value)
        {
            // TODO: Constant instead of 512?
            var     errorStringBuilder = new StringBuilder(512);
            ConfRes res = LibRdKafka.topic_conf_set(handle, name, value,
                                                    errorStringBuilder, (UIntPtr)errorStringBuilder.Capacity);

            if (res == ConfRes.Ok)
            {
                return;
            }
            else if (res == ConfRes.Invalid)
            {
                throw new InvalidOperationException(errorStringBuilder.ToString());
            }
            else if (res == ConfRes.Unknown)
            {
                throw new InvalidOperationException(errorStringBuilder.ToString());
            }
            else
            {
                throw new Exception("Unknown error while setting configuration property");
            }
        }