adding tasks retry and late_ack to the persist message function