Skip to content

Commit

Permalink
Update Jackson max message size
Browse files Browse the repository at this point in the history
  • Loading branch information
smozely committed Jan 9, 2024
1 parent e633e8a commit 9680d50
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package nz.govt.eop.hilltop_crawler

import com.fasterxml.jackson.core.StreamReadConstraints
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.runApplication
Expand All @@ -12,5 +13,9 @@ class Application {}

fun main(args: Array<String>) {
System.setProperty("com.sun.security.enableAIAcaIssuers", "true")

StreamReadConstraints.overrideDefaultStreamReadConstraints(
StreamReadConstraints.builder().maxStringLength(50_000_000).build())

runApplication<Application>(*args)
}
2 changes: 1 addition & 1 deletion packages/HilltopCrawler/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spring:

streams:
properties:
num.stream.threads: 8
num.stream.threads: 2
producer.max.request.size: 10485760
producer.compression.type: gzip
default:
Expand Down
5 changes: 5 additions & 0 deletions packages/Manager/src/main/kotlin/nz/govt/eop/Application.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package nz.govt.eop

import com.fasterxml.jackson.core.StreamReadConstraints
import java.nio.file.Files
import java.util.Base64
import kotlin.io.path.pathString
Expand All @@ -26,6 +27,10 @@ fun main(args: Array<String>) {
if (System.getenv(ENV_CONFIG_KEYSTORE_CONTENT) != null) {
storeKeystoreFromEnvironment()
}

StreamReadConstraints.overrideDefaultStreamReadConstraints(
StreamReadConstraints.builder().maxStringLength(50_000_000).build())

runApplication<Application>(*args)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/Manager/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spring:

streams:
properties:
num.stream.threads: 4
num.stream.threads: 2
max.poll.records: 10
default:
key.serde: org.apache.kafka.common.serialization.Serdes$StringSerde
Expand Down

0 comments on commit 9680d50

Please sign in to comment.