Skip to content

Commit

Permalink
Merge pull request #40
Browse files Browse the repository at this point in the history
FEAT : CDE-403-sur-un-gros-fichier-le-bad-ecrase-son-contenu-au-fil-d…
  • Loading branch information
jvk88511334 authored Apr 8, 2024
2 parents ad04014 + dfa9853 commit 25928ad
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 25928ad

Please sign in to comment.