Package org.apache.pulsar.client.impl
Class ProducerBase<T>
java.lang.Object
org.apache.pulsar.client.impl.ProducerBase<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,Producer<T>
- Direct Known Subclasses:
PartitionedProducerImpl,ProducerImpl
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PulsarClientImplprotected final ProducerConfigurationDataprotected final ProducerInterceptorsprotected ProducerBase.MultiSchemaModeprotected final CompletableFuture<Producer<T>>protected URIprotected final ConcurrentOpenHashMap<SchemaHash,byte[]> protected final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProducerBase(PulsarClientImpl client, String topic, ProducerConfigurationData conf, CompletableFuture<Producer<T>> producerCreatedFuture, Schema<T> schema, ProducerInterceptors interceptors) -
Method Summary
Modifier and TypeMethodDescriptionprotected Message<?>beforeSend(Message<?> message) protected booleanprotected booleanprotected booleanvoidclose()abstract CompletableFuture<Void>voidflush()protected org.apache.pulsar.client.impl.HandlerState.StategetAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) protected org.apache.pulsar.client.impl.HandlerState.StategetState()getTopic()<V> TypedMessageBuilder<V>newMessage(Schema<V> schema) newMessage(Transaction txn) protected voidonPartitionsChange(String topicName, int partitions) protected voidonSendAcknowledgement(Message<?> message, MessageId msgId, Throwable exception) protected voidsetRedirectedClusterURI(String serviceUrl, String serviceUrlTls) protected voidsetState(org.apache.pulsar.client.impl.HandlerState.State s) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.pulsar.client.api.Producer
flushAsync, getLastDisconnectedTimestamp, getLastSequenceId, getNumOfPartitions, getProducerName, getStats, isConnected
-
Field Details
-
producerCreatedFuture
-
conf
-
schema
-
interceptors
-
schemaCache
-
multiSchemaMode
-
client
-
topic
-
redirectedClusterURI
-
-
Constructor Details
-
ProducerBase
protected ProducerBase(PulsarClientImpl client, String topic, ProducerConfigurationData conf, CompletableFuture<Producer<T>> producerCreatedFuture, Schema<T> schema, ProducerInterceptors interceptors)
-
-
Method Details
-
send
- Specified by:
sendin interfaceProducer<T>- Throws:
PulsarClientException
-
sendAsync
-
sendAsync
-
newMessage
- Specified by:
newMessagein interfaceProducer<T>
-
newMessage
- Specified by:
newMessagein interfaceProducer<T>
-
newMessage
- Specified by:
newMessagein interfaceProducer<T>
-
send
- Throws:
PulsarClientException
-
flush
- Specified by:
flushin interfaceProducer<T>- Throws:
PulsarClientException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceProducer<T>- Throws:
PulsarClientException
-
closeAsync
- Specified by:
closeAsyncin interfaceProducer<T>
-
getTopic
-
getConfiguration
-
producerCreatedFuture
-
beforeSend
-
onSendAcknowledgement
-
onPartitionsChange
-
toString
-
setRedirectedClusterURI
protected void setRedirectedClusterURI(String serviceUrl, String serviceUrlTls) throws URISyntaxException - Throws:
URISyntaxException
-
changeToReadyState
protected boolean changeToReadyState() -
changeToRegisteringSchemaState
protected boolean changeToRegisteringSchemaState() -
getState
protected org.apache.pulsar.client.impl.HandlerState.State getState() -
changeToConnecting
protected boolean changeToConnecting() -
setState
protected void setState(org.apache.pulsar.client.impl.HandlerState.State s) -
getAndUpdateState
protected org.apache.pulsar.client.impl.HandlerState.State getAndUpdateState(UnaryOperator<org.apache.pulsar.client.impl.HandlerState.State> updater) -
getClient
-