Skip to content
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 @@ -15,17 +15,21 @@ public class NamespaceProperties {
private final @Nullable List<WorkerProperties> workers;
private final @Nonnull String namespace;
private final @Nullable WorkflowCacheProperties workflowCache;
private final @Nullable Boolean ignoreDuplicateDefinitions;

@ConstructorBinding
public NamespaceProperties(
@Nullable String namespace,
@Nullable WorkersAutoDiscoveryProperties workersAutoDiscovery,
@Nullable List<WorkerProperties> workers,
@Nullable WorkflowCacheProperties workflowCache) {
@Nullable WorkflowCacheProperties workflowCache,
@Nullable Boolean ignoreDuplicateDefinitions) {
this.workersAutoDiscovery = workersAutoDiscovery;
this.workers = workers;
this.namespace = MoreObjects.firstNonNull(namespace, NAMESPACE_DEFAULT);
this.workflowCache = workflowCache;
this.ignoreDuplicateDefinitions =
MoreObjects.firstNonNull(ignoreDuplicateDefinitions, Boolean.TRUE);
}

@Nullable
Expand All @@ -51,6 +55,11 @@ public WorkflowCacheProperties getWorkflowCache() {
return workflowCache;
}

@Nonnull
public Boolean isIgnoreDuplicateDefinitions() {
return Boolean.TRUE;
}

public static class WorkflowCacheProperties {
private final @Nullable Integer maxInstances;
private final @Nullable Integer maxThreads;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public NonRootNamespaceProperties(
@Nullable List<WorkerProperties> workers,
@Nullable WorkflowCacheProperties workflowCache,
@Nullable ConnectionProperties connection,
@Nullable Boolean startWorkers) {
super(namespace, workersAutoDiscovery, workers, workflowCache);
@Nullable Boolean startWorkers,
@Nullable Boolean ignoreDuplicateDefinitions) {
super(namespace, workersAutoDiscovery, workers, workflowCache, ignoreDuplicateDefinitions);
this.alias = alias;
this.connection = connection;
this.startWorkers = startWorkers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ public TemporalProperties(
@Nullable WorkflowCacheProperties workflowCache,
@Nonnull ConnectionProperties connection,
@Nullable TestServerProperties testServer,
@Nullable Boolean startWorkers) {
super(namespace, workersAutoDiscovery, workers, workflowCache);
@Nullable Boolean startWorkers,
@Nullable Boolean ignoreDuplicateDefinitions) {
super(namespace, workersAutoDiscovery, workers, workflowCache, ignoreDuplicateDefinitions);
this.connection = connection;
this.testServer = testServer;
this.startWorkers = startWorkers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ private void configureActivityImplementationAutoDiscovery(
worker.getTaskQueue(),
registeredEx.getRegisteredTypeName());
}
if (!namespaceProperties.isIgnoreDuplicateDefinitions()) {
throw registeredEx;
}
}
}

Expand Down Expand Up @@ -468,6 +471,9 @@ private void configureNexusServiceImplementationAutoDiscovery(
worker.getTaskQueue(),
registeredEx.getRegisteredTypeName());
}
if (!namespaceProperties.isIgnoreDuplicateDefinitions()) {
throw registeredEx;
}
}
}

Expand All @@ -492,6 +498,9 @@ private void configureWorkflowImplementationAutoDiscovery(
worker.getTaskQueue(),
registeredEx.getRegisteredTypeName());
}
if (!namespaceProperties.isIgnoreDuplicateDefinitions()) {
throw registeredEx;
}
}
}

Expand Down
Loading