public abstract class ProducerBase<T> extends Object implements Producer<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
ProducerBase.MultiSchemaMode |
| Modifier and Type | Field and Description |
|---|---|
protected PulsarClientImpl |
client |
protected ProducerConfigurationData |
conf |
protected ProducerInterceptors |
interceptors |
protected ProducerBase.MultiSchemaMode |
multiSchemaMode |
protected CompletableFuture<Producer<T>> |
producerCreatedFuture |
protected Schema<T> |
schema |
protected ConcurrentOpenHashMap<SchemaHash,byte[]> |
schemaCache |
protected String |
topic |
| Modifier | Constructor and Description |
|---|---|
protected |
ProducerBase(PulsarClientImpl client,
String topic,
ProducerConfigurationData conf,
CompletableFuture<Producer<T>> producerCreatedFuture,
Schema<T> schema,
ProducerInterceptors interceptors) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitflushAsync, getLastDisconnectedTimestamp, getLastSequenceId, getProducerName, getStats, isConnectedprotected final CompletableFuture<Producer<T>> producerCreatedFuture
protected final ProducerConfigurationData conf
protected final ProducerInterceptors interceptors
protected final ConcurrentOpenHashMap<SchemaHash,byte[]> schemaCache
protected volatile ProducerBase.MultiSchemaMode multiSchemaMode
protected final PulsarClientImpl client
protected final String topic
protected ProducerBase(PulsarClientImpl client, String topic, ProducerConfigurationData conf, CompletableFuture<Producer<T>> producerCreatedFuture, Schema<T> schema, ProducerInterceptors interceptors)
public MessageId send(T message) throws PulsarClientException
send in interface Producer<T>PulsarClientExceptionpublic CompletableFuture<MessageId> sendAsync(T message)
public CompletableFuture<MessageId> sendAsync(Message<?> message)
public TypedMessageBuilder<T> newMessage()
newMessage in interface Producer<T>public <V> TypedMessageBuilder<V> newMessage(Schema<V> schema)
newMessage in interface Producer<T>public TypedMessageBuilder<T> newMessage(Transaction txn)
newMessage in interface Producer<T>public MessageId send(Message<?> message) throws PulsarClientException
PulsarClientExceptionpublic void flush()
throws PulsarClientException
flush in interface Producer<T>PulsarClientExceptionpublic void close()
throws PulsarClientException
close in interface Closeableclose in interface AutoCloseableclose in interface Producer<T>PulsarClientExceptionpublic abstract CompletableFuture<Void> closeAsync()
closeAsync in interface Producer<T>public ProducerConfigurationData getConfiguration()
public CompletableFuture<Producer<T>> producerCreatedFuture()
protected void onSendAcknowledgement(Message<?> message, MessageId msgId, Throwable exception)
protected boolean changeToReadyState()
protected boolean changeToRegisteringSchemaState()
protected org.apache.pulsar.client.impl.HandlerState.State getState()
protected void setState(org.apache.pulsar.client.impl.HandlerState.State s)
protected org.apache.pulsar.client.impl.HandlerState.State getAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater)
public PulsarClientImpl getClient()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.