RED-6805: As Operation I want to see why downloads are in an ERROR state

checkstyle
This commit is contained in:
yhampe 2024-01-15 12:27:18 +01:00
parent c1d46ddace
commit 9c4ee66d02
3 changed files with 5 additions and 10 deletions

View File

@ -1,12 +1,7 @@
package com.iqser.red.service.persistence.service.v1.api.external.resource;
import java.util.concurrent.CompletableFuture;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -72,7 +67,6 @@ public interface DownloadResource {
void downloadFile(@RequestParam(STORAGE_ID) String storageId);
@ResponseBody
@ResponseStatus(value = HttpStatus.OK)
@Operation(summary = "Returns a oneTimeToken for a requested download", description = "Use the optional \"inline\" request parameter " + "to select, if this report will be opened in the browser.")

View File

@ -37,9 +37,10 @@ public class DownloadDLQMessageReceiver {
}
@SneakyThrows
@SneakyThrows
@RabbitListener(queues = MessagingConfiguration.DOWNLOAD_DLQ)
public void handleDlqMessage(Message failedMessage) {
var downloadJob = objectMapper.readValue(failedMessage.getBody(), DownloadJob.class);
String errorCause = failedMessage.getMessageProperties().getHeader(X_ERROR_INFO_HEADER);
if (errorCause == null) {
@ -72,11 +73,12 @@ public class DownloadDLQMessageReceiver {
retryTemplate.execute(retryContext -> {
log.warn("Retrying {} time to set FAILED status for downloadJob userId: {} storageId: {}", retryContext.getRetryCount(), userId, downloadId);
downloadStatusPersistenceService.updateStatus(downloadId, DownloadStatusValue.FAILED,errorCause);
downloadStatusPersistenceService.updateStatus(downloadId, DownloadStatusValue.FAILED, errorCause);
return null;
});
}
private void setDownloadFailed(String userId, String downloadId, String errorCause) {
retryTemplate.execute(retryContext -> {

View File

@ -7,8 +7,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import jakarta.transaction.Transactional;
import org.springframework.stereotype.Service;
import com.iqser.red.service.persistence.management.v1.processor.entity.dossier.DossierEntity;
@ -20,6 +18,7 @@ import com.iqser.red.service.persistence.management.v1.processor.service.persist
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.DownloadFileType;
import com.iqser.red.service.persistence.service.v1.api.shared.model.download.DownloadStatusValue;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
@Service