add code to support queue offset persistence.