Module: Rdkafka::Defaults
- Defined in:
- lib/rdkafka/defaults.rb
Overview
Provides default timeout and configuration values used throughout the library.
These constants standardize timing values across consumers, producers, and admin clients. Values are specified in milliseconds (ms) unless otherwise noted.
Constant Summary collapse
- CONSUMER_COMMITTED_TIMEOUT_MS =
Consumer timeout for fetching committed offsets
2_000- CONSUMER_QUERY_WATERMARK_TIMEOUT_MS =
Consumer timeout for querying watermark offsets
1_000- CONSUMER_LAG_TIMEOUT_MS =
Consumer timeout for lag calculations
1_000- CONSUMER_OFFSETS_FOR_TIMES_TIMEOUT_MS =
Consumer timeout for offset-by-timestamp lookups
1_000- CONSUMER_CLUSTER_ID_TIMEOUT_MS =
Consumer timeout for fetching the cluster id when it is not already cached from metadata
1_000- CONSUMER_POLL_TIMEOUT_MS =
Consumer timeout for poll operations (used in each iteration)
250- CONSUMER_SEEK_TIMEOUT_MS =
Consumer timeout for seek operations (0 = non-blocking)
0- CONSUMER_EVENTS_POLL_TIMEOUT_MS =
Consumer timeout for events_poll (0 = non-blocking async)
0- PRODUCER_FLUSH_TIMEOUT_MS =
Producer timeout for flush operations
5_000- PRODUCER_PURGE_FLUSH_TIMEOUT_MS =
Producer timeout for flush during purge
100- PRODUCER_PURGE_SLEEP_INTERVAL_MS =
Sleep interval used in producer purge loop
1- PRODUCER_SEND_OFFSETS_TIMEOUT_MS =
Timeout for transactional send_offsets_to_transaction
5_000- METADATA_TIMEOUT_MS =
Default timeout for metadata requests
2_000- METADATA_MAX_RETRIES =
Hard ceiling on metadata fetch attempts on transient errors (backstop; the retry budget normally ends the loop first)
10- METADATA_MIN_ATTEMPTS =
Minimum metadata fetch attempts before the retry budget may end the loop, so a slow broker (whose requests each consume the full timeout) still gets a few tries
3- METADATA_RETRY_BUDGET_MS =
Soft wall-clock budget for the whole metadata retry loop; past it (and past METADATA_MIN_ATTEMPTS) the loop stops so a synchronous fetch cannot block the caller for long
5_000- METADATA_RETRY_BACKOFF_BASE_MS =
Base backoff time for metadata retry (100ms = 0.1s)
100- METADATA_RETRY_BACKOFF_MAX_MS =
Maximum backoff time between metadata retries. Caps the exponential backoff so a long retry sequence against an unhealthy cluster cannot block the calling thread for minutes.
1_000- HANDLE_WAIT_TIMEOUT_MS =
Default wait timeout for operation handles
60_000- NATIVE_KAFKA_POLL_TIMEOUT_MS =
Polling interval for NativeKafka background thread
100- NATIVE_KAFKA_SYNCHRONIZE_SLEEP_INTERVAL_MS =
Sleep interval used in NativeKafka#synchronize wait loop
10- PARTITIONS_COUNT_CACHE_TTL_MS =
TTL for partitions count cache entries (30 seconds)
30_000