Skip to content

Commit

Permalink
Add documentation to properties
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesarnal committed Oct 8, 2024
1 parent 835676a commit 44f1cd1
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 45 deletions.
4 changes: 0 additions & 4 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>io.cloudevents</groupId>
<artifactId>cloudevents-json-jackson</artifactId>
</dependency>

<!-- Test Only -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ private ArtifactCreated(String id, String aggregateId, JSONObject eventPayload)

public static ArtifactCreated of(ArtifactMetaDataDto artifactMetaDataDto) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", artifactMetaDataDto.getGroupId())
.put("artifactId", artifactMetaDataDto.getArtifactId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ private ArtifactMetadataUpdated(String id, String aggregateId, JSONObject eventP
public static ArtifactMetadataUpdated of(String groupId, String artifactId,
EditableArtifactMetaDataDto artifactMetaDataDto) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", groupId).put("artifactId", artifactId)
.put("name", artifactMetaDataDto.getName()).put("owner", artifactMetaDataDto.getOwner())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ private ArtifactRuleConfigured(String id, String aggregateId, JSONObject eventPa
public static ArtifactRuleConfigured of(String groupId, String artifactId, RuleType ruleType,
RuleConfigurationDto rule) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", groupId).put("artifactId", artifactId)
.put("ruleType", ruleType.value()).put("rule", rule.getConfiguration())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ private ArtifactVersionCreated(String id, String aggregateId, JSONObject eventPa

public static ArtifactVersionCreated of(ArtifactVersionMetaDataDto versionMetaDataDto) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", versionMetaDataDto.getGroupId())
.put("artifactId", versionMetaDataDto.getArtifactId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ private ArtifactVersionMetadataUpdated(String id, String aggregateId, JSONObject
public static ArtifactVersionMetadataUpdated of(String groupId, String artifactId, String version,
EditableVersionMetaDataDto editableVersionMetaDataDto) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", groupId).put("artifactId", artifactId).put("version", version)
.put("name", editableVersionMetaDataDto.getName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ private GlobalRuleConfigured(String id, String aggregateId, JSONObject eventPayl

public static GlobalRuleConfigured of(RuleType ruleType, RuleConfigurationDto rule) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("ruleType", ruleType.value()).put("rule", rule.getConfiguration())
.put("eventType", GLOBAL_RULE_CONFIGURED.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ private GroupCreated(String id, String aggregateId, JSONObject eventPayload) {

public static GroupCreated of(GroupMetaDataDto groupMetaDataDto) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", groupMetaDataDto.getGroupId()).put("eventType",
GROUP_CREATED.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ private GroupDeleted(String id, String aggregateId, JSONObject eventPayload) {

public static GroupDeleted of(String groupId) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", groupId).put("eventType", GROUP_DELETED.name());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ private GroupMetadataUpdated(String id, String aggregateId, JSONObject eventPayl

public static GroupMetadataUpdated of(String groupId, EditableGroupMetaDataDto groupMetaDataDto) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", groupId).put("description", groupMetaDataDto.getDescription())
.put("eventType", GROUP_METADATA_UPDATED.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ private GroupRuleConfigured(String id, String aggregateId, JSONObject eventPaylo

public static GroupRuleConfigured of(String groupId, RuleType ruleType, RuleConfigurationDto rule) {
String id = UUID.randomUUID().toString();
// TODO here we have to define the internal structure of the event, maybe use cloudevents?
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id).put("groupId", groupId).put("ruleType", ruleType.value())
.put("rule", rule.getConfiguration()).put("eventType", GROUP_RULE_CONFIGURED.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ public class KafkaSqlFactory {

@Inject
@ConfigProperty(name = "apicurio.kafkasql.snapshots.topic", defaultValue = "kafkasql-snapshots")
@Info(category = "storage", description = "Kafka sql storage topic name")
@Info(category = "storage", description = "Kafka sql storage topic name", registryAvailableSince = "3.0.0")
String snapshotsTopic;

@Inject
@ConfigProperty(name = "apicurio.kafkasql.snapshot.every.seconds", defaultValue = "86400s")
@Info(category = "storage", description = "Kafka sql journal topic snapshot every")
@Info(category = "storage", description = "Kafka sql journal topic snapshot every", registryAvailableSince = "3.0.0")
String snapshotEvery;

@Inject
@ConfigProperty(name = "apicurio.storage.snapshot.location", defaultValue = "./")
@Info(category = "storage", description = "Kafka sql snapshots store location")
@Info(category = "storage", description = "Kafka sql snapshots store location", registryAvailableSince = "3.0.0")
String snapshotStoreLocation;

@Inject
@ConfigProperty(name = "apicurio.events.kafka.topic", defaultValue = "registry-events")
@Info(category = "storage", description = "Kafka sql storage event topic")
@Info(category = "storage", description = "Kafka sql storage event topic", registryAvailableSince = "3.0.1")
String eventsTopic;

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3587,12 +3587,14 @@ public String createSnapshot(String location) throws RegistryStorageException {
public String createEvent(OutboxEvent event) {
if (supportsDatabaseEvents()) {
// Create outbox event
handles.withHandle(handle -> handle.createUpdate(sqlStatements.createOutboxEvent())
.bind(0, event.getId()).bind(1, eventsTopic).bind(2, event.getAggregateId())
.bind(3, event.getType()).bind(4, event.getPayload().toString()).execute());

deleteEvent(event.getId());
handles.withHandle(handle -> {
handle.createUpdate(sqlStatements.createOutboxEvent()).bind(0, event.getId())
.bind(1, eventsTopic).bind(2, event.getAggregateId()).bind(3, event.getType())
.bind(4, event.getPayload().toString()).execute();

return handle.createUpdate(sqlStatements.deleteOutboxEvent()).bind(0, event.getId())
.execute();
});
}
return event.getId();
}
Expand All @@ -3602,17 +3604,6 @@ public boolean supportsDatabaseEvents() {
return isPostgresql() || isMssql();
}

private void deleteEvent(String eventId) {
try {
handles.withHandle(handle -> handle.createUpdate(sqlStatements.deleteOutboxEvent())
.bind(0, eventId).execute());
}

catch (RegistryStorageException ex) {
throw new RegistryStorageException("Could not delete outbox event with ID " + eventId + ".", ex);
}
}

private boolean isPostgresql() {
return sqlStatements.dbType().equals("postgresql");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,12 +778,12 @@ The following {registry} configuration options are available for each component
|`apicurio.kafkasql.snapshot.every.seconds`
|`string`
|`86400s`
|
|`3.0.0`
|Kafka sql journal topic snapshot every
|`apicurio.kafkasql.snapshots.topic`
|`string`
|`kafkasql-snapshots`
|
|`3.0.0`
|Kafka sql storage topic name
|`apicurio.kafkasql.ssl.key.password`
|`optional<string>`
Expand Down Expand Up @@ -838,7 +838,7 @@ The following {registry} configuration options are available for each component
|`apicurio.storage.snapshot.location`
|`string`
|`./`
|
|`3.0.0`
|Kafka sql snapshots store location
|`apicurio.storage.sql.kind`
|`string`
Expand Down
8 changes: 0 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@
<!-- Picocli -->
<picocli.version>4.6.3</picocli.version>

<!-- Cloudevents-->
<cloudevents.version>4.0.1</cloudevents.version>

<!-- Confluent API / client -->
<confluent.version>7.6.2</confluent.version>

Expand Down Expand Up @@ -633,11 +630,6 @@
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.cloudevents</groupId>
<artifactId>cloudevents-json-jackson</artifactId>
<version>${cloudevents.version}</version>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
Expand Down

0 comments on commit 44f1cd1

Please sign in to comment.