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 a group. -
Method Summary
Modifier and TypeMethodDescriptionReturns the group membership operation configured for this close.static CloseOptionsStatic method to create aCloseOptionswith a specified group membership operation.timeout()Returns the timeout configured for this close.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
Returns the group membership operation configured for this close.- Returns:
- The group membership operation
-
timeout
-