try {
ReplicationQueueItem item = q.getHead();
if (item != null) {
ReplicationQueueItemState status = q.getStatus(item);
if (status.getAttempts() <= numberOfRetriesAllowed) {
resultLog.debug("Queue: [{}], first item: [{}], number of retries: {}", q.getName(), item.getId(), status.getAttempts());
} else {
// the no. of attempts is higher than the configured threshold
resultLog.warn("Queue: [{}], first item: [{}], number of retries: {}, expected number of retries <= {}",
q.getName(), item.getId(), status.getAttempts(), numberOfRetriesAllowed);
failures.put(q.getName(), status.getAttempts());