def METHOD_NAME(attempts: int) -> dt.timedelta:
    """
    Computes the time interval for the next attempt/retry of a message.
    The interval is computed as 2^attempts and is capped at 5 minutes.
    The maximum amount of retries is controlled in the node configuration.
    :param attempts: Current number of attempts.
    :return: The time interval between the previous processing attempt and the next one.
    """
    seconds = 2 ** attempts
    return dt.timedelta(seconds=min(seconds, MAX_RETRY_INTERVAL))