Class ConsumerSettings.Builder

java.lang.Object
com.here.platform.data.client.settings.ConsumerSettings.Builder
Enclosing class:
ConsumerSettings

public static final class ConsumerSettings.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public ConsumerSettings build()
    • withConsumerId

      public ConsumerSettings.Builder withConsumerId(String consumerId)
      Parameters:
      consumerId - The ID to use to identify this consumer. It must be unique within the consumer group. If you do not provide one, the system will generate one. This parameter is applicable only for http-connector.

      Returns:
      builder
      See Also:
    • withEarliestOffset

      public ConsumerSettings.Builder withEarliestOffset()
      Subscribe for earliest offset (old) available for selected group name. For already existent group name, all partitions since last checkpoint will be returned. For new group name, all partitions available.
      Returns:
      builder
    • withGroupName

      public ConsumerSettings.Builder withGroupName(String groupName)
      Parameters:
      groupName - name of a consumer group. A string that uniquely identifies the group of consumer processes to which this consumer belongs. By setting the same group name multiple processes indicate that they are all part of the same consumer group. Maximum length of this field is 1000 characters.
      Returns:
      builder
      See Also:
    • withLatestOffset

      public ConsumerSettings.Builder withLatestOffset()
      Subscribe only to new partitions. Any previous data published prior to the subscription will be skipped. Use this offset if you are interested only into new partitions.

      LatestOffset completely ignore previously existing checkpoint for same groupName, all leases are created with the latest offset available. This means that during the stream partitions id re-balance between workers, there is no guarantee that all events will be processed.

      Returns:
      builder
    • withManualLatestOffset

      public ConsumerSettings.Builder withManualLatestOffset()
      The offset is manually controlled by user trough [SubscriptionControl.acknowledge] and [SubscriptionControl.checkpoint], starting from the latest available offsets if no previous offsets were committed.

      This setting cannot be used with FlinkQueryApi subscribe method, because there is no interface that allows to acknowledge partitions manually.

      Returns:
      builder
    • withManualOffset

      public ConsumerSettings.Builder withManualOffset()
      The offset is manually controlled by user trough [SubscriptionControl.acknowledge] and [SubscriptionControl.checkpoint], starting from the earliest available offsets if no previous offsets were committed.

      This setting cannot be used with FlinkQueryApi subscribe method, because there is no interface that allows to acknowledge partitions manually.

      Returns:
      builder