示例#1
0
        internal AvroKafkaProducer(RdKafka.Producer producer, RdKafka.Topic topic, int keySchemaId, int valueSchemaId)
        {
            _producer      = producer;
            _topic         = topic;
            _keySchemaId   = keySchemaId;
            _valueSchemaId = valueSchemaId;

            _keySchemaBytes = BitConverter.GetBytes(keySchemaId);
            Array.Reverse(_keySchemaBytes);

            _valueSchemaBytes = BitConverter.GetBytes(valueSchemaId);
            Array.Reverse(_valueSchemaBytes);
        }
示例#2
0
 /// <summary>
 /// Request Metadata from broker.
 ///
 /// Parameters:
 ///   allTopics    - if true: request info about all topics in cluster,
 ///                  if false: only request info about locally known topics.
 ///   onlyForTopic - only request info about this topic
 ///   includeInternal - include internal topics prefixed with __
 ///   timeout      - maximum response time before failing.
 /// </summary>
 public Task<Metadata> Metadata (bool allTopics=true, Topic onlyForTopic=null,
         bool includeInternal=false, TimeSpan timeout=default(TimeSpan))
 {
     return Task.FromResult(
             handle.Metadata(allTopics, onlyForTopic?.handle, includeInternal, timeout));
 }