Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
Consumer {
   /**
     * Alert the consumer to trigger a new rebalance by rejoining the group. This is a nonblocking call that forces
	 * the consumer to trigger a new rebalance on the next poll call. Note that this API does not itself initiate
	 * the rebalance, so you must still call poll. If a rebalance is already in progress, the
	 * method will return
	 * false to indicate that it was a no-op. TheYou can useruse canthis thento decide whether to just complete the current
	 * current rebalance, or retry thisin tocase triggerthe acurrent rebalance does not withinclude the latest subscription metadata; however,
	 * in most up-to-date subscription metadata. Note cases it is better to determine that based on the resulting assignment of the current rebalance. Only
	 * that this API does not itself initiate the rebalance, so you must still call poll. when it is not possible to validate whether the latest metadata was used based on the received assignment
	 * should you consider retrying based on the return value. 
	 * <p>
	 * You should not need to call this during normal processing, as the consumer group will manage itself
	 * automatically and rebalance when necessary. However there may be situations where the application wishes to
	 * trigger a rebalance that would otherwise not occur. For example, if some condition external and invisible to
	 * the Consumer and its group membership changes in a way that has implications for the partition assignment,
	 * this method can be used to trigger a reassignment. The kind of system change that would merit calling this
 	 * method is one that would also be reflected in the Subscription userdata that is passed to the assignor so it
	 * can make assignment decisions based on more than group membership and metadata. If your assignor does not use
	 * this userdata, or you do not use a custom assignor, you should not use this API.
     *
     * @return false if a rebalance is already in progress
     * @throws java.lang.IllegalStateException if the consumer does not use group subscription
     */
    boolean enforceRebalance() {
}

...