Skip to content

Commit

Permalink
fix model
Browse files Browse the repository at this point in the history
  • Loading branch information
slu-it committed Aug 30, 2024
1 parent 442ccf1 commit 11e446d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ data class Messaging(
) {
data class PublishedMessage(
val exchange: String,
val routingKey: String,
val routingKeys: List<String>,
)

data class ConsumedQueue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ fun loadPublishedMessages(sourceFolder: File): List<PublishedMessage> {
val file = File(messagingFolder, "published-messages.jsonl")
if (file.isFile) {
return loadFromJsonListFile(file, PublishedMessage::class)
.distinct()
.groupBy(PublishedMessage::exchange, PublishedMessage::routingKeys)
.mapValues { (_, routingKeys) -> routingKeys.flatten().distinct() }
.map { (exchange, routingKeys) -> PublishedMessage(exchange, routingKeys) }
}
return emptyList()
}
Expand Down

0 comments on commit 11e446d

Please sign in to comment.