Currently, after the changes introduced in KIP-266, many methods in Kafka Consumer have a bounded execution time given by a user specified Duration parameter. However, in some cases, some methods could not perform their operations in the allocated timeout. In this case, the user might wish to have a onTimeoutExpired callback which would be called should a blocking method timeout before any results could be returned.
The user can implement something like described above, but Kafka can spare the user the necessity of coding such a feature if we can support one by itself.
One possible use of this callback is to retry the method (e.g. the onTimeoutExpired callback triggers another call to the same method after some allocated time).