Max number of retries should be configurable