use of org.apache.pulsar.client.impl.conf.ProducerConfigurationData in project incubator-pulsar by apache.
the class PulsarClientImpl method createProducer.
@Override
public Producer<byte[]> createProducer(final String topic, final ProducerConfiguration conf) throws PulsarClientException {
if (conf == null) {
throw new PulsarClientException.InvalidConfigurationException("Invalid null configuration object");
}
try {
ProducerConfigurationData confData = conf.getProducerConfigurationData().clone();
confData.setTopicName(topic);
return createProducerAsync(confData).get();
} catch (ExecutionException e) {
Throwable t = e.getCause();
if (t instanceof PulsarClientException) {
throw (PulsarClientException) t;
} else {
throw new PulsarClientException(t);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new PulsarClientException(e);
}
}
use of org.apache.pulsar.client.impl.conf.ProducerConfigurationData in project incubator-pulsar by apache.
the class PulsarClientImpl method createProducerAsync.
@Override
public CompletableFuture<Producer<byte[]>> createProducerAsync(final String topic, final ProducerConfiguration conf) {
ProducerConfigurationData confData = conf.getProducerConfigurationData().clone();
confData.setTopicName(topic);
return createProducerAsync(confData);
}
use of org.apache.pulsar.client.impl.conf.ProducerConfigurationData in project incubator-pulsar by apache.
the class PulsarClientImpl method createProducerAsync.
@Override
public CompletableFuture<Producer<byte[]>> createProducerAsync(String topic) {
ProducerConfigurationData conf = new ProducerConfigurationData();
conf.setTopicName(topic);
return createProducerAsync(conf);
}
use of org.apache.pulsar.client.impl.conf.ProducerConfigurationData in project incubator-pulsar by apache.
the class PulsarClientImpl method createProducer.
@Override
public Producer<byte[]> createProducer(String topic) throws PulsarClientException {
try {
ProducerConfigurationData conf = new ProducerConfigurationData();
conf.setTopicName(topic);
return createProducerAsync(conf).get();
} catch (ExecutionException e) {
Throwable t = e.getCause();
if (t instanceof PulsarClientException) {
throw (PulsarClientException) t;
} else {
throw new PulsarClientException(t);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new PulsarClientException(e);
}
}
Aggregations