}
log.debug("Unregistering replication queue provider {} ", replicationQueueProvider);
}
public Result execute() {
final FormattingResultLog resultLog = new FormattingResultLog();
Map<String, Integer> failures = new HashMap<String, Integer>();
if (replicationQueueProviders.size() > 0) {
for (ReplicationQueueProvider replicationQueueProvider : replicationQueueProviders) {
for (ReplicationQueue q : replicationQueueProvider.getAllQueues())
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());
}
} else {
resultLog.debug("No items in queue [{}]", q.getName());
}
} catch (Exception e) {
resultLog.warn("Exception while inspecting replication queue [{}]: {}", q.getName(), e);
}
}
} else {
resultLog.debug("No replication queue providers found");
}
if (failures.size() > 0) {
// a specific log entry (using markdown) to provide a recommended user action
for (Map.Entry<String, Integer> entry : failures.entrySet()) {
resultLog.warn("Replication queue {}'s first item in the default queue has been retried {} times (threshold: {})",
entry.getKey(), entry.getValue(), numberOfRetriesAllowed);
}
}
return new Result(resultLog);