Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding zstd compression to GeoJsonConverter #73

Merged
merged 3 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public class GeoJsonConverterProperties implements EnvironmentAware {
//BSM
private String kafkaTopicOdeBsmJson = "topic.OdeBsmJson";
private String kafkaTopicProcessedBsm = "topic.ProcessedBsm";

private int lingerMs = 0;

private GeometryOutputMode geometryOutputMode = GeometryOutputMode.GEOJSON_ONLY;

Expand Down Expand Up @@ -119,6 +121,10 @@ public Properties createStreamProperties(String name) {
// Configure the state store location
streamProps.put(StreamsConfig.STATE_DIR_CONFIG, "/var/lib/ode/kafka-streams");

streamProps.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "zstd");

streamProps.put(ProducerConfig.LINGER_MS_CONFIG, getKafkaLingerMs());

if (confluentCloudEnabled) {
streamProps.put("ssl.endpoint.identification.algorithm", "https");
streamProps.put("security.protocol", "SASL_SSL");
Expand Down Expand Up @@ -231,4 +237,14 @@ public void setGeometryOutputMode(String gomString) {
public GeometryOutputMode getGeometryOutputMode() {
return geometryOutputMode;
}


@Value("${kafka.linger_ms}")
public void setKafkaLingerMs(int lingerMs) {
this.lingerMs = lingerMs;
}

public int getKafkaLingerMs() {
return lingerMs;
}
}
4 changes: 3 additions & 1 deletion jpo-geojsonconverter/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ kafka.topics:
retentionMs: 300000

# Jackson Properties
spring.jackson.serialization.write-dates-as-timestamps: false
spring.jackson.serialization.write-dates-as-timestamps: false

kafka.linger_ms: 50
Loading