Interface PublishRateLimiter

All Known Implementing Classes:
DisabledPublishRateLimiter, PublishRateLimiterImpl, ResourceGroupPublishLimiter

public interface PublishRateLimiter
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handlePublishThrottling(Producer producer, int numOfMessages, long msgSizeInBytes)
    Consumes publishing quota and handles throttling.
    void
    update(org.apache.pulsar.common.policies.data.Policies policies, String clusterName)
    updates rate-limiting threshold based on policies.
    void
    update(org.apache.pulsar.common.policies.data.PublishRate maxPublishRate)
    updates rate-limiting threshold based on passed in rate limiter.
  • Method Details

    • handlePublishThrottling

      void handlePublishThrottling(Producer producer, int numOfMessages, long msgSizeInBytes)
      Consumes publishing quota and handles throttling.

      The rate limiter implementation calls Producer.incrementThrottleCount() to indicate that the producer should be throttled. The rate limiter must schedule a call to Producer.decrementThrottleCount() after a throttling period that it calculates.

      Parameters:
      numOfMessages - number of messages to publish
      msgSizeInBytes - size of messages in bytes to publish
    • update

      void update(org.apache.pulsar.common.policies.data.Policies policies, String clusterName)
      updates rate-limiting threshold based on policies.
      Parameters:
      policies -
      clusterName -
    • update

      void update(org.apache.pulsar.common.policies.data.PublishRate maxPublishRate)
      updates rate-limiting threshold based on passed in rate limiter.
      Parameters:
      maxPublishRate -