@@ -79,7 +79,7 @@ public KbartListener(UtilsMapper mapper, BaconService baconService, EmailService
79
79
*/
80
80
@ KafkaListener (topics = {"${topic.name.source.kbart.toload}" }, groupId = "${topic.groupid.source.withppn}" , containerFactory = "kafkaKbartListenerContainerFactory" , concurrency = "${spring.kafka.concurrency.nbThread}" )
81
81
public void listenKbartToCreateFromKafka (ConsumerRecord <String , LigneKbartConnect > lignesKbart ) throws IOException {
82
- String filename = lignesKbart .key ();
82
+ String filename = extractFilenameFromKey ( lignesKbart .key () );
83
83
if (!this .workInProgressMap .containsKey (filename )) {
84
84
this .workInProgressMap .put (filename , new WorkInProgress <>());
85
85
lignesKbart .headers ().forEach (header -> {
@@ -357,7 +357,7 @@ private void suppressionLien469(SudocService service, List<String> listError, in
357
357
@ KafkaListener (topics = {"${topic.name.source.kbart.exnihilo}" }, groupId = "${topic.groupid.source.exnihilo}" , containerFactory = "kafkaKbartListenerContainerFactory" )
358
358
public void listenKbartFromKafkaExNihilo (ConsumerRecord <String , LigneKbartConnect > ligneKbart ) {
359
359
log .debug ("Entrée dans création ex nihilo" );
360
- String filename = ligneKbart .key ();
360
+ String filename = extractFilenameFromKey ( ligneKbart .key () );
361
361
362
362
// S'il s'agit d'un premier message d'un fichier kbart, on créé un WorkInProgress avec le nom du fichier et le nombre total de ligne
363
363
if (!this .workInProgressMapExNihilo .containsKey (filename )) {
@@ -437,7 +437,7 @@ private void creerNoticeExNihilo(LigneKbartConnect ligneKbartConnect, String pro
437
437
*/
438
438
@ KafkaListener (topics = {"${topic.name.source.kbart.imprime}" }, groupId = "${topic.groupid.source.imprime}" , containerFactory = "kafkaKbartListenerContainerFactory" )
439
439
public void listenKbartFromKafkaImprime (ConsumerRecord <String , LigneKbartImprime > lignesKbart ) {
440
- String filename = lignesKbart .key ();
440
+ String filename = extractFilenameFromKey ( lignesKbart .key () );
441
441
442
442
// S'il s'agit d'un premier message d'un fichier kbart, on créé un WorkInProgress avec le nom du fichier et le nombre total de ligne
443
443
if (!this .workInProgressMapImprime .containsKey (filename )) {
@@ -527,4 +527,8 @@ private NoticeConcrete creerNoticeAPartirImprime(LigneKbartImprime ligneKbartImp
527
527
throw e ;
528
528
}
529
529
}
530
+
531
+ private String extractFilenameFromKey (String key ) {
532
+ return key .substring (0 , key .lastIndexOf ('_' ));
533
+ }
530
534
}
0 commit comments