class ConsumerSettings[K, V] extends AnyRef

Settings for consumers. See akka.kafka.consumer section in reference.conf. Note that the companion object provides apply and create functions for convenient construction of the settings, together with the with methods.

The constructor is Internal API.

Source
ConsumerSettings.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConsumerSettings
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. val closeTimeout: FiniteDuration
  7. val commitRefreshInterval: Duration
  8. val commitTimeWarning: FiniteDuration
  9. val commitTimeout: FiniteDuration
  10. val connectionCheckerSettings: ConnectionCheckerSettings
  11. val consumerFactory: (ConsumerSettings[K, V]) => Consumer[K, V]
  12. val consumerGroupUpdateInterval: FiniteDuration
  13. def createKafkaConsumer(): Consumer[K, V]

    Create a Kafka Consumer instance from these settings.

    Create a Kafka Consumer instance from these settings.

    This will fail with IllegalStateException if asynchronous enrichment is set up -- always prefer createKafkaConsumerAsync() or createKafkaConsumerCompletionStage().

    Exceptions thrown

    IllegalStateException if asynchronous enrichment is set via withEnrichAsync or withEnrichCompletionStage, you must use createKafkaConsumerAsync or createKafkaConsumerCompletionStage to apply it

  14. def createKafkaConsumerAsync()(implicit executionContext: ExecutionContext): Future[Consumer[K, V]]

    Scala API.

    Scala API.

    Create a Kafka Consumer instance from these settings (without blocking for enriched).

  15. def createKafkaConsumerCompletionStage(executor: Executor): CompletionStage[Consumer[K, V]]

    Java API.

    Java API.

    Create a Kafka Consumer instance from these settings (without blocking for enriched).

  16. val dispatcher: String
  17. val drainingCheckInterval: FiniteDuration
  18. val enrichAsync: Option[(ConsumerSettings[K, V]) => Future[ConsumerSettings[K, V]]]
  19. def enriched: Future[ConsumerSettings[K, V]]

    Applies enrichAsync to complement these settings from asynchronous sources.

  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  22. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def getCloseTimeout: Duration
  24. def getMetadataRequestTimeout: Duration
  25. def getOffsetForTimesTimeout: Duration
  26. def getPositionTimeout: Duration
  27. def getProperties: Map[String, AnyRef]

    Get the Kafka consumer settings as map.

  28. def getProperty(key: String): String

    Java API: Get a raw property.

    Java API: Get a raw property. null if it is not defined.

  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. val keyDeserializerOpt: Option[Deserializer[K]]
  32. val metadataRequestTimeout: FiniteDuration
  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. val offsetForTimesTimeout: FiniteDuration
  37. val partitionHandlerWarning: FiniteDuration
  38. val pollInterval: FiniteDuration
  39. val pollTimeout: FiniteDuration
  40. val positionTimeout: FiniteDuration
  41. val properties: Map[String, String]
  42. val resetProtectionSettings: OffsetResetProtectionSettings
  43. val stopTimeout: FiniteDuration
  44. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  45. def toString(): String
    Definition Classes
    ConsumerSettings → AnyRef → Any
  46. val valueDeserializerOpt: Option[Deserializer[V]]
  47. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  50. val waitClosePartition: FiniteDuration
  51. def withBootstrapServers(bootstrapServers: String): ConsumerSettings[K, V]

    A comma-separated list of host/port pairs to use for establishing the initial connection to the Kafka cluster.

  52. def withClientId(clientId: String): ConsumerSettings[K, V]

    An id string to pass to the server when making requests.

    An id string to pass to the server when making requests. The purpose of this is to be able to track the source of requests beyond just ip/port by allowing a logical application name to be included in server-side request logging.

  53. def withCloseTimeout(closeTimeout: Duration): ConsumerSettings[K, V]

    Java API: Set duration to wait for KafkaConsumer.close to finish.

  54. def withCloseTimeout(closeTimeout: FiniteDuration): ConsumerSettings[K, V]

    Set duration to wait for KafkaConsumer.close to finish.

  55. def withCommitRefreshInterval(commitRefreshInterval: Duration): ConsumerSettings[K, V]

    Java API: If set to a finite duration, the consumer will re-send the last committed offsets periodically for all assigned partitions.

    Java API: If set to a finite duration, the consumer will re-send the last committed offsets periodically for all assigned partitions. @see https://issues.apache.org/jira/browse/KAFKA-4682 Set to java.time.Duration.ZERO to switch it off.

    See also

    https://issues.apache.org/jira/browse/KAFKA-4682

  56. def withCommitRefreshInterval(commitRefreshInterval: Duration): ConsumerSettings[K, V]

    If set to a finite duration, the consumer will re-send the last committed offsets periodically for all assigned partitions.

    If set to a finite duration, the consumer will re-send the last committed offsets periodically for all assigned partitions.

    See also

    https://issues.apache.org/jira/browse/KAFKA-4682

  57. def withCommitTimeout(commitTimeout: Duration): ConsumerSettings[K, V]

    Java API: If offset commit requests are not completed within this timeout the returned Future is completed with akka.kafka.CommitTimeoutException.

  58. def withCommitTimeout(commitTimeout: FiniteDuration): ConsumerSettings[K, V]

    If offset commit requests are not completed within this timeout the returned Future is completed with akka.kafka.CommitTimeoutException.

  59. def withCommitWarning(commitTimeWarning: Duration): ConsumerSettings[K, V]

    Java API: If commits take longer than this time a warning is logged

  60. def withCommitWarning(commitTimeWarning: FiniteDuration): ConsumerSettings[K, V]

    If commits take longer than this time a warning is logged

  61. def withConnectionChecker(kafkaConnectionCheckerConfig: ConnectionCheckerSettings): ConsumerSettings[K, V]

    Enable kafka connection checker with provided settings

  62. def withConsumerFactory(factory: (ConsumerSettings[K, V]) => Consumer[K, V]): ConsumerSettings[K, V]

    Replaces the default Kafka consumer creation logic.

  63. def withConsumerGroupUpdateInterval(interval: Duration): ConsumerSettings[K, V]

    Java API: For transactional flows only, how often to push consumer group metadata to the producers a shorter interval makes the risk of dropping batched elements smaller but at the cost of more work sending those updates.

  64. def withConsumerGroupUpdateInterval(interval: FiniteDuration): ConsumerSettings[K, V]

    Scala API: For transactional flows only, how often to push consumer group metadata to the producers a shorter interval makes the risk of dropping batched elements smaller but at the cost of more work sending those updates.

  65. def withDispatcher(dispatcher: String): ConsumerSettings[K, V]

    Fully qualified config path which holds the dispatcher configuration to be used by the akka.kafka.KafkaConsumerActor.

    Fully qualified config path which holds the dispatcher configuration to be used by the akka.kafka.KafkaConsumerActor. Some blocking may occur.

  66. def withDrainingCheckInterval(drainingCheckInterval: Duration): ConsumerSettings[K, V]

    Java API: Check interval for TransactionalProducer when finishing transaction before shutting down consumer

  67. def withDrainingCheckInterval(drainingCheckInterval: FiniteDuration): ConsumerSettings[K, V]

    Scala API: Check interval for TransactionalProducer when finishing transaction before shutting down consumer

  68. def withEnrichAsync(value: (ConsumerSettings[K, V]) => Future[ConsumerSettings[K, V]]): ConsumerSettings[K, V]

    Scala API.

    Scala API. A hook to allow for resolving some settings asynchronously.

    Since

    2.0.0

  69. def withEnrichCompletionStage(value: Function[ConsumerSettings[K, V], CompletionStage[ConsumerSettings[K, V]]]): ConsumerSettings[K, V]

    Java API.

    Java API. A hook to allow for resolving some settings asynchronously.

    Since

    2.0.0

  70. def withGroupId(groupId: String): ConsumerSettings[K, V]

    A unique string that identifies the consumer group this consumer belongs to.

  71. def withGroupInstanceId(groupInstanceId: String): ConsumerSettings[K, V]

    An id string that marks consumer as a unique static member of the consumer group.

  72. def withMetadataRequestTimeout(metadataRequestTimeout: Duration): ConsumerSettings[K, V]

    Java API

  73. def withMetadataRequestTimeout(metadataRequestTimeout: FiniteDuration): ConsumerSettings[K, V]

    Scala API

  74. def withOffsetForTimesTimeout(offsetForTimesTimeout: Duration): ConsumerSettings[K, V]

    Java API: Limits the blocking on Kafka consumer offsetForTimes calls.

  75. def withOffsetForTimesTimeout(offsetForTimesTimeout: FiniteDuration): ConsumerSettings[K, V]

    Scala API: Limits the blocking on Kafka consumer offsetForTimes calls.

  76. def withPartitionAssignmentStrategies(strategies: Array[String]): ConsumerSettings[K, V]

    A list of class names or class types, ordered by preference, of supported partition assignment strategies that the client will use to distribute partition ownership amongst consumer instances when group management is used.

    A list of class names or class types, ordered by preference, of supported partition assignment strategies that the client will use to distribute partition ownership amongst consumer instances when group management is used.

    See https://kafka.apache.org/documentation/#consumerconfigs_partition.assignment.strategy

  77. def withPartitionAssignmentStrategyCooperativeStickyAssignor(): ConsumerSettings[K, V]

    Sets the CooperativeStickyAssignor assignment strategy.

    Sets the CooperativeStickyAssignor assignment strategy.

    See also

    https://kafka.apache.org/documentation/#consumerconfigs_partition.assignment.strategy

    https://kafka.apache.org/33/documentation.html#upgrade_300_notable

  78. def withPartitionHandlerWarning(partitionHandlerWarning: Duration): ConsumerSettings[K, V]

    Java API

  79. def withPartitionHandlerWarning(partitionHandlerWarning: FiniteDuration): ConsumerSettings[K, V]

    Scala API

  80. def withPollInterval(pollInterval: Duration): ConsumerSettings[K, V]

    Java API: Set the interval from one scheduled poll to the next.

  81. def withPollInterval(pollInterval: FiniteDuration): ConsumerSettings[K, V]

    Set the interval from one scheduled poll to the next.

  82. def withPollTimeout(pollTimeout: Duration): ConsumerSettings[K, V]

    Java API: Set the maximum duration a poll to the Kafka broker is allowed to take.

  83. def withPollTimeout(pollTimeout: FiniteDuration): ConsumerSettings[K, V]

    Set the maximum duration a poll to the Kafka broker is allowed to take.

  84. def withPositionTimeout(positionTimeout: Duration): ConsumerSettings[K, V]

    Java API: Limits the blocking on Kafka consumer position calls.

  85. def withPositionTimeout(positionTimeout: FiniteDuration): ConsumerSettings[K, V]

    Scala API: Limits the blocking on Kafka consumer position calls.

  86. def withProperties(properties: Map[String, String]): ConsumerSettings[K, V]

    Java API: The raw properties of the kafka-clients driver, see constants in org.apache.kafka.clients.consumer.ConsumerConfig.

  87. def withProperties(properties: (String, String)*): ConsumerSettings[K, V]

    Scala API: The raw properties of the kafka-clients driver, see constants in org.apache.kafka.clients.consumer.ConsumerConfig.

  88. def withProperties(properties: Map[String, String]): ConsumerSettings[K, V]

    Scala API: The raw properties of the kafka-clients driver, see constants in org.apache.kafka.clients.consumer.ConsumerConfig.

  89. def withProperty(key: String, value: String): ConsumerSettings[K, V]

    The raw properties of the kafka-clients driver, see constants in org.apache.kafka.clients.consumer.ConsumerConfig.

  90. def withResetProtectionSettings(resetProtection: OffsetResetProtectionSettings): ConsumerSettings[K, V]

    Set the protection for unintentional offset reset.

  91. def withStopTimeout(stopTimeout: Duration): ConsumerSettings[K, V]

    Java API: The stage will await outstanding offset commit requests before shutting down, but if that takes longer than this timeout it will stop forcefully.

  92. def withStopTimeout(stopTimeout: FiniteDuration): ConsumerSettings[K, V]

    The stage will await outstanding offset commit requests before shutting down, but if that takes longer than this timeout it will stop forcefully.

  93. def withWaitClosePartition(waitClosePartition: Duration): ConsumerSettings[K, V]

    Java API: Time to wait for pending requests when a partition is closed.

  94. def withWaitClosePartition(waitClosePartition: FiniteDuration): ConsumerSettings[K, V]

    Time to wait for pending requests when a partition is closed.

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped