Class/Object

fs2.kafka

ConsumerSettings

Related Docs: object ConsumerSettings | package kafka

Permalink

sealed abstract class ConsumerSettings[K, V] extends AnyRef

ConsumerSettings contain settings necessary to create a KafkaConsumer. At the very least, this includes a key deserializer, a value deserializer, and an ExecutionContext on which blocking Kafka operations can be executed.

Several convenience functions are provided so that you don't have to work with String values and ConsumerConfig for configuration. It's still possible to specify ConsumerConfig values with functions like withProperty.

ConsumerSettings instances are immutable and all modification functions return a new ConsumerSettings instance.

Use ConsumerSettings#apply to create a new instance.

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

Abstract Value Members

  1. abstract def closeTimeout: FiniteDuration

    Permalink

    The time to wait for the Java KafkaConsumer to shutdown.

    The default value is 20 seconds.

  2. abstract def commitRecovery: CommitRecovery

    Permalink

    The CommitRecovery strategy for recovering from offset commit exceptions.

    The default is CommitRecovery#Default.

  3. abstract def commitTimeout: FiniteDuration

    Permalink

    The time to wait for offset commits to complete.

    The time to wait for offset commits to complete. If an offset commit doesn't complete within this time, a CommitTimeoutException will be raised instead.

    The default value is 15 seconds.

  4. abstract def consumerFactory: ConsumerFactory

    Permalink

    The ConsumerFactory for creating the Java Consumer.

    The ConsumerFactory for creating the Java Consumer. The default is ConsumerFactory#Default. Note that you normally don't need to have a custom ConsumerFactory, and you should instead prefer to create a custom trait or class similar to KafkaConsumer for testing purposes.

  5. abstract def executionContext: ExecutionContext

    Permalink

    The ExecutionContext on which to run blocking Kafka operations.

  6. abstract def fetchTimeout: FiniteDuration

    Permalink

    The time to wait for topic-partition fetches to complete when using KafkaConsumer#stream.

    The time to wait for topic-partition fetches to complete when using KafkaConsumer#stream. Once all topic-partition fetches expire, new fetches for all assigned partitions will be issued.

    The default value is 500 milliseconds.

  7. abstract def keyDeserializer: Deserializer[K]

    Permalink

    The Deserializer to use for deserializing record keys.

  8. abstract def pollInterval: FiniteDuration

    Permalink

    How often we should attempt to call poll on the Java KafkaConsumer.

    The default value is 50 milliseconds.

  9. abstract def pollTimeout: FiniteDuration

    Permalink

    How long we should allow the poll call to block for in the Java KafkaConsumer.

    The default value is 50 milliseconds.

  10. abstract def properties: Map[String, String]

    Permalink

    Properties which can be provided when creating a Java KafkaConsumer instance.

    Properties which can be provided when creating a Java KafkaConsumer instance. Numerous functions in ConsumerSettings add properties here if the settings are used by the Java KafkaConsumer.

  11. abstract def recordMetadata: (ConsumerRecord[K, V]) ⇒ String

    Permalink

    The function used to specify metadata for records.

    The function used to specify metadata for records. This metadata will be included in OffsetAndMetadata in the CommittableOffsets, and can then be committed with the offsets.

    By default, there will be no metadata, as determined by OffsetFetchResponse.NO_METADATA.

  12. abstract def valueDeserializer: Deserializer[V]

    Permalink

    The Deserializer to use for deserializing record values.

  13. abstract def withAutoCommitInterval(autoCommitInterval: FiniteDuration): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified auto commit interval.

    Returns a new ConsumerSettings instance with the specified auto commit interval. This is equivalent to setting the following property using the withProperty function, except you can specify it with a FiniteDuration instead of a String.

    ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG
  14. abstract def withAutoOffsetReset(autoOffsetReset: AutoOffsetReset): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified auto offset reset.

    Returns a new ConsumerSettings instance with the specified auto offset reset. This is equivalent to setting the following property using the withProperty function, except you can specify it with AutoOffsetReset instead of a String.

    ConsumerConfig.AUTO_OFFSET_RESET_CONFIG
  15. abstract def withBootstrapServers(bootstrapServers: String): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified bootstrap servers.

    Returns a new ConsumerSettings instance with the specified bootstrap servers. This is equivalent to setting the following property using the withProperty function.

    ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG
  16. abstract def withClientId(clientId: String): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified client id.

    Returns a new ConsumerSettings instance with the specified client id. This is equivalent to setting the following property using the withProperty function.

    ConsumerConfig.CLIENT_ID_CONFIG
  17. abstract def withCloseTimeout(closeTimeout: FiniteDuration): ConsumerSettings[K, V]

    Permalink

    Creates a new ConsumerSettings with the specified closeTimeout.

  18. abstract def withCommitRecovery(commitRecovery: CommitRecovery): ConsumerSettings[K, V]

    Permalink

    Creates a new ConsumerSettings with the specified CommitRecovery as the commitRecovery to use.

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

    Permalink

    Creates a new ConsumerSettings with the specified commitTimeout.

  20. abstract def withConsumerFactory(consumerFactory: ConsumerFactory): ConsumerSettings[K, V]

    Permalink

    Creates a new ConsumerSettings with the specified ConsumerFactory as the consumerFactory to use.

    Creates a new ConsumerSettings with the specified ConsumerFactory as the consumerFactory to use. Note that under normal usage you don't need to have a custom ConsumerFactory instance. For testing, you should prefer to use a custom trait or class similar to KafkaConsumer.

  21. abstract def withEnableAutoCommit(enableAutoCommit: Boolean): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified auto commit setting.

    Returns a new ConsumerSettings instance with the specified auto commit setting. This is equivalent to setting the following property using the withProperty function, except you can specify it with a Boolean instead of a String.

    ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG

    Note that by default, this setting is set to false.

  22. abstract def withFetchTimeout(fetchTimeout: FiniteDuration): ConsumerSettings[K, V]

    Permalink

    Creates a new ConsumerSettings with the specified fetchTimeout.

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

    Permalink

    Returns a new ConsumerSettings instance with the specified group id.

    Returns a new ConsumerSettings instance with the specified group id. This is equivalent to setting the following property using the withProperty function.

    ConsumerConfig.GROUP_ID_CONFIG
  24. abstract def withHeartbeatInterval(heartbeatInterval: FiniteDuration): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified heartbeat interval.

    Returns a new ConsumerSettings instance with the specified heartbeat interval. This is equivalent to setting the following property using the withProperty function, except you can specify it with a FiniteDuration instead of a String.

    ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG
  25. abstract def withMaxPollInterval(maxPollInterval: FiniteDuration): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified max poll interval.

    Returns a new ConsumerSettings instance with the specified max poll interval. This is equivalent to setting the following property using the withProperty function, except you can specify it with a FiniteDuration instead of a String.

    ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG
  26. abstract def withMaxPollRecords(maxPollRecords: Int): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified max poll records.

    Returns a new ConsumerSettings instance with the specified max poll records. This is equivalent to setting the following property using the withProperty function, except you can specify it with an Int instead of a String.

    ConsumerConfig.MAX_POLL_RECORDS_CONFIG
  27. abstract def withPollInterval(pollInterval: FiniteDuration): ConsumerSettings[K, V]

    Permalink

    Creates a new ConsumerSettings with the specified pollInterval.

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

    Permalink

    Creates a new ConsumerSettings with the specified pollTimeout.

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

    Permalink

    Includes the specified keys and values as properties.

    Includes the specified keys and values as properties. The keys should be part of the ConsumerConfig keys, and the values should be valid choices for the keys.

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

    Permalink

    Includes the specified keys and values as properties.

    Includes the specified keys and values as properties. The keys should be part of the ConsumerConfig keys, and the values should be valid choices for the keys.

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

    Permalink

    Includes a property with the specified key and value.

    Includes a property with the specified key and value. The key should be one of the keys in ConsumerConfig, and the value should be a valid choice for the key.

  32. abstract def withRecordMetadata(recordMetadata: (ConsumerRecord[K, V]) ⇒ String): ConsumerSettings[K, V]

    Permalink

    Creates a new ConsumerSettings with the specified recordMetadata.

  33. abstract def withSessionTimeout(sessionTimeout: FiniteDuration): ConsumerSettings[K, V]

    Permalink

    Returns a new ConsumerSettings instance with the specified session timeout.

    Returns a new ConsumerSettings instance with the specified session timeout. This is equivalent to setting the following property using the withProperty function, except you can specify it with a FiniteDuration instead of a String.

    ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped