private void Produce(string topic, TKey key, TValue val, DateTime?timestamp, int partition, bool blockIfQueueFull, IDeliveryHandler <TKey, TValue> deliveryHandler) { var handler = new TypedDeliveryHandlerShim(key, val, deliveryHandler); var keyBytes = KeySerializer?.Serialize(key); var valBytes = ValueSerializer?.Serialize(val); producer.Produce(topic, valBytes, 0, valBytes == null ? 0 : valBytes.Length, keyBytes, 0, keyBytes == null ? 0 : keyBytes.Length, timestamp, partition, blockIfQueueFull, handler); }
public void ProduceAsync(string topic, TKey key, TValue val, IDeliveryHandler <TKey, TValue> deliveryHandler, DateTime?timestamp = null, int?partition = null, bool blockIfQueueFull = true) { var handler = new TypedDeliveryHandlerShim(key, val, deliveryHandler); producer.ProduceAsync(topic, KeySerializer?.Serialize(key), ValueSerializer?.Serialize(val), handler, timestamp, partition, blockIfQueueFull); }