Skip to content

Commit

Permalink
FEAT : CDE-403-sur-un-gros-fichier-le-bad-ecrase-son-contenu-au-fil-d…
Browse files Browse the repository at this point in the history
…u-traitement

     - ajout d'une méthode de contrôle de présence de fichier de log temporaire obsolète
  • Loading branch information
EryneKL committed Apr 8, 2024
1 parent 0533b8c commit dfa9853
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/fr/abes/logskbart/kafka/LogsListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -57,15 +58,15 @@ public void listenInfoKbart2KafkaAndErrorKbart2Kafka(ConsumerRecord<String, Stri
LogKbart logKbart = logsMapper.map(dto, LogKbart.class);

String[] listMessage = message.key().split(";");
// log.debug(Arrays.toString(listMessage));
log.debug(Arrays.toString(listMessage));
// recuperation de l'heure a laquelle le message a ete envoye
Timestamp currentTimestamp = new Timestamp(message.timestamp());
logKbart.setTimestamp(new Date(currentTimestamp.getTime()));
logKbart.setPackageName(listMessage[0]);
String nbLineOrigine = (listMessage.length > 1) ? listMessage[1] : "";
logKbart.setNbLine(Integer.parseInt((nbLineOrigine.isEmpty() ? "-1" : nbLineOrigine) ));

// logKbart.log();
logKbart.log();

// Vérifie qu'un fichier portant le nom du kbart en cours existe
if (!logKbart.getPackageName().contains("ctx:package") && !logKbart.getPackageName().contains("_FORCE")) {
Expand Down

0 comments on commit dfa9853

Please sign in to comment.