Interface PubSubProducerAdapter

    • 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 a Future 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()