Support - SendTimeout for Producer Client
eduardofesilva opened this issue · comments
Hi
Would be possible to support SendTimeout like in Pulsar Client for Java?
This is an mandatory option for scenario where we want to avoid deduplication
import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.PulsarClient;
import java.util.concurrent.TimeUnit;
PulsarClient pulsarClient = PulsarClient.builder()
.serviceUrl("pulsar://localhost:6650")
.build();
Producer producer = pulsarClient.newProducer()
.producerName("producer-1")
.topic("persistent://public/default/topic-1")
.sendTimeout(0, TimeUnit.SECONDS)
.create();
Hi
It would be possible to implement a Send Timeout, but i am unsure of exactly what you want to accomplish. Unlike the java client, the default behavior of dotPulsar is that Send will never timeout, and therefore you don't need to specifically configure the timeout if you want to enable deduplication. Simply enable deduplication on the namespace, and ensure that the producer name is set, and you should be good to go.
If you want timeouts, you should cancel the CancellationToken supplied with the send call after the desired amount of time.
Hope that clarifies things