Skip to content

Commit

Permalink
Trying to log less.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Oct 7, 2024
1 parent 59f2a52 commit 6c7fd71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions media-berlijn/src/main/java/nl/vpro/berlijn/domain/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ private Parser() {
@Value("${berlijn.lenient:false}")
public void setLenient(boolean lenient) {
if (lenient) {
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
log.info("Berlijn json parser in Lenient mode");
if (mapper.isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)) {
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
log.info("Berlijn json parser in Lenient mode");
}
} else {
mapper.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
log.info("Berlijn json parser in strict mode (failing on unknown properties)");
if (! mapper.isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)) {
mapper.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
log.info("Berlijn json parser in strict mode (failing on unknown properties)");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static Stream<ProductMetadata> messages() {
.map(KafkaDumpReader.Record::bytes)
.map(parser::parseProductMetadata)
.sorted(PomsMapper.randomOrder(random))
// .limit(1000)
.limit(1000)
;

}
Expand Down

0 comments on commit 6c7fd71

Please sign in to comment.