Package com.linkedin.venice.pubsub.api
Interface PubSubProducerAdapter
-
- All Known Implementing Classes:
ApacheKafkaProducerAdapter
,MockInMemoryProducerAdapter
,PubSubProducerAdapterConcurrentDelegator
,PubSubProducerAdapterDelegator
,TransformingProducerAdapter
public interface PubSubProducerAdapter
The pub-sub producer interface with which venice writer's interact to send messages to pub-sub topic. An implementation of this interface are required to provide the following guarantees: 1. At-least once delivery (ALOD): messages should not be dropped. 2. In order delivery (IOD): messages in the same partition should follow the order in which they were sent.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
close(long closeTimeOutMs)
void
flush()
java.lang.String
getBrokerAddress()
it.unimi.dsi.fastutil.objects.Object2DoubleMap<java.lang.String>
getMeasurableProducerMetrics()
int
getNumberOfPartitions(java.lang.String topic)
Deprecated.java.util.concurrent.CompletableFuture<PubSubProduceResult>
sendMessage(java.lang.String topic, java.lang.Integer partition, KafkaKey key, KafkaMessageEnvelope value, PubSubMessageHeaders pubSubMessageHeaders, PubSubProducerCallback pubSubProducerCallback)
Sends a message to a PubSub topic asynchronously and returns aFuture
representing the result of the produce operation.
-
-
-
Method Detail
-
getNumberOfPartitions
@Deprecated int getNumberOfPartitions(java.lang.String topic)
Deprecated.The support for the following two getNumberOfPartitions APIs will be removed.
-
sendMessage
java.util.concurrent.CompletableFuture<PubSubProduceResult> sendMessage(java.lang.String topic, java.lang.Integer partition, KafkaKey key, KafkaMessageEnvelope value, PubSubMessageHeaders pubSubMessageHeaders, PubSubProducerCallback pubSubProducerCallback)
Sends a message to a PubSub topic asynchronously and returns aFuture
representing the result of the produce operation.- Parameters:
topic
- The name of the Kafka topic to which the message will be sent.partition
- The partition to which the message should be sent.key
- The key associated with the message, used for partitioning and message retrieval.value
- The message payload to be sent to the PubSubTopic topic.pubSubMessageHeaders
- Additional headers to be included with the message.pubSubProducerCallback
- An optional callback to handle the result of the produce operation.- Returns:
- A
Future
representing the result of the produce operation. - Throws:
PubSubOpTimeoutException
- If the produce operation times out.PubSubTopicAuthorizationException
- If there's an authorization error while producing the message.PubSubTopicDoesNotExistException
- If the target topic does not exist.PubSubClientRetriableException
- If a retriable error occurs while producing the message.PubSubClientException
- If an error occurs while producing the message.
-
flush
void flush()
-
close
void close(long closeTimeOutMs)
-
getMeasurableProducerMetrics
it.unimi.dsi.fastutil.objects.Object2DoubleMap<java.lang.String> getMeasurableProducerMetrics()
-
getBrokerAddress
java.lang.String getBrokerAddress()
-
-