Skip to content

Commit

Permalink
Merge pull request #589 from DependencyTrack/issue-1080-rename-kafka-…
Browse files Browse the repository at this point in the history
…topic-prefix

Rename topic prefix config
  • Loading branch information
nscuro authored Feb 21, 2024
2 parents 03f7ec0 + fbbe6bd commit 6af80d3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ there's no need to deploy it in an application server like Tomcat or WildFly.
## Running

In case you want to provide a topic prefix to use in conjunction with hyades application then the environment variable
to export is API_TOPIC_PREFIX<br/>
to export is KAFKA_TOPIC_PREFIX<br/>
If the host environment requires ssl configuration then below configurations need to be passed:

| Environment Variable | Description | Default | Required |
|:----------------------------------------|:-----------------------------------------|:--------|:--------:|
| `API_TOPIC_PREFIX` | Prefix for topic names | - ||
| `KAFKA_TOPIC_PREFIX` | Prefix for topic names | - ||
| `KAFKA_TLS_ENABLED` | Whether tls is enabled | false ||
| `KAFKA_SECURTY_PROTOCOL` | Security protocol to be used | - ||
| `KAFKA_TRUSTSTORE_PATH` | Trust store path to be used | - ||
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dependencytrack/common/ConfigKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum ConfigKey implements Config.Key {

KEY_STORE_PASSWORD("kafka.keystore.password", ""),
KAFKA_NUM_STREAM_THREADS("kafka.num.stream.threads", 1),
KAFKA_TOPIC_PREFIX("api.topic.prefix", ""),
KAFKA_TOPIC_PREFIX("kafka.topic.prefix", ""),
KAFKA_PRODUCER_DRAIN_TIMEOUT_DURATION("kafka.producer.drain.timeout.duration", "PT30S"),
KAFKA_STREAMS_DESERIALIZATION_EXCEPTION_THRESHOLD_COUNT("kafka.streams.deserialization.exception.threshold.count", "5"),
KAFKA_STREAMS_DESERIALIZATION_EXCEPTION_THRESHOLD_INTERVAL("kafka.streams.deserialization.exception.threshold.interval", "PT30M"),
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ kafka.keystore.path=
kafka.keystore.password=

# Optional
api.topic.prefix=
kafka.topic.prefix=

# Required
application.id=dtrack-apiserver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class KafkaTopicsTest {

@Test
public void testTopicNameWithPrefix() {
environmentVariables.set("API_TOPIC_PREFIX", "foo-bar.baz.");
environmentVariables.set("KAFKA_TOPIC_PREFIX", "foo-bar.baz.");
assertThat(KafkaTopics.VULN_ANALYSIS_RESULT.name()).isEqualTo("foo-bar.baz.dtrack.vuln-analysis.result");
}

Expand Down

0 comments on commit 6af80d3

Please sign in to comment.