Skip to content

Commit

Permalink
Replay kafka topic with new dataformat
Browse files Browse the repository at this point in the history
  • Loading branch information
torchr89 committed Oct 24, 2023
1 parent cb7dc27 commit 34f3e5b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AivenKafkaConfig(
aivenKafkaErrorHandler: AivenKafkaErrorHandler
): ConcurrentKafkaListenerContainerFactory<String, String> {
val config = mapOf(
ConsumerConfig.GROUP_ID_CONFIG to "aktivitetskrav-backend-group-v1",
ConsumerConfig.GROUP_ID_CONFIG to "aktivitetskrav-backend-group-v2",
ConsumerConfig.AUTO_OFFSET_RESET_CONFIG to kafkaAutoOffsetReset,
ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG to StringDeserializer::class.java,
ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG to StringDeserializer::class.java,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ data class KAktivitetskravVarsel(
val createdAt: OffsetDateTime,
val journalpostId: String,
val svarfrist: LocalDate,
val document: List<DocumentComponentDTO>
val document: List<DocumentComponentDTO>,
val internUuid: UUID
) : Serializable

fun KAktivitetskravVarsel.toAktivitetskravVarsel() =
Expand All @@ -40,5 +41,6 @@ fun KAktivitetskravVarsel.toAktivitetskravVarsel() =
createdAt = this.createdAt,
journalpostId = this.journalpostId,
svarfrist = this.svarfrist,
document = this.document
document = this.document,
internUuid = this.internUuid
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ data class KAktivitetskravVurdering(
val stoppunktAt: LocalDate,
val updatedBy: String?,
val sistVurdert: OffsetDateTime?,
val frist: LocalDate?
val frist: LocalDate?,
val internUuid: UUID
)

fun KAktivitetskravVurdering.toAktivitetskravVurdering() =
Expand All @@ -29,5 +30,6 @@ fun KAktivitetskravVurdering.toAktivitetskravVurdering() =
stoppunktAt = this.stoppunktAt,
updatedBy = this.updatedBy,
sistVurdert = this.sistVurdert,
frist = this.frist
frist = this.frist,
internUuid = this.internUuid
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ data class AktivitetskravVarsel(
val createdAt: OffsetDateTime,
val journalpostId: String,
val svarfrist: LocalDate,
val document: List<DocumentComponentDTO>
val document: List<DocumentComponentDTO>,
val internUuid: UUID
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ data class AktivitetskravVurdering(
val stoppunktAt: LocalDate,
val updatedBy: String?,
val sistVurdert: OffsetDateTime?,
val frist: LocalDate?
val frist: LocalDate?,
val internUuid: UUID
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DELETE FROM AKTIVITETSKRAV_VARSEL;
DELETE FROM AKTIVITETSKRAV_VURDERING;
5 changes: 5 additions & 0 deletions src/main/resources/db/migration/V5__Add_new_uuid_columns.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE AKTIVITETSKRAV_VURDERING
ADD COLUMN internal_uuid UUID NOT NULL;

ALTER TABLE AKTIVITETSKRAV_VARSEL
ADD COLUMN internal_uuid UUID NOT NULL;

0 comments on commit 34f3e5b

Please sign in to comment.