Class CloseOptions
java.lang.Object
org.apache.kafka.clients.consumer.CloseOptions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum to specify the group membership operation upon leaving group. -
Method Summary
Modifier and TypeMethodDescriptionstatic CloseOptionsStatic method to create aCloseOptionswith a specified group membership operation.timeout()static CloseOptionsStatic method to create aCloseOptionswith a custom timeout.Fluent method to set the group membership operation upon shutdown.withTimeout(Duration timeout) Fluent method to set the timeout for the close process.
-
Method Details
-
timeout
Static method to create aCloseOptionswith a custom timeout.- Parameters:
timeout- the maximum time to wait for the consumer to close.- Returns:
- a new
CloseOptionsinstance with the specified timeout.
-
groupMembershipOperation
public static CloseOptions groupMembershipOperation(CloseOptions.GroupMembershipOperation operation) Static method to create aCloseOptionswith a specified group membership operation.- Parameters:
operation- the group membership operation to apply. Must be one ofLEAVE_GROUP,REMAIN_IN_GROUP, orDEFAULT.- Returns:
- a new
CloseOptionsinstance with the specified group membership operation.
-
withTimeout
Fluent method to set the timeout for the close process.- Parameters:
timeout- the maximum time to wait for the consumer to close. Ifnull, the default timeout will be used.- Returns:
- this
CloseOptionsinstance.
-
withGroupMembershipOperation
Fluent method to set the group membership operation upon shutdown.- Parameters:
operation- the group membership operation to apply. Must be one ofLEAVE_GROUP,REMAIN_IN_GROUP, orDEFAULT.- Returns:
- this
CloseOptionsinstance.
-
groupMembershipOperation
-
timeout
-