quarkusio/quarkus · error · IllegalStateException
Two VertxOptionsConsumerBuildItem instances have the same pr
Error message
Two VertxOptionsConsumerBuildItem instances have the same priority and orderKey, which is not allowed. First instance: [priority: ${priority}, orderKey: ${orderKey}], second instance: [priority: ${otherPriority}, orderKey: ${otherOrderKey}] What it means
VertxOptionsConsumerBuildItem implements Comparable: items are sorted by priority then orderKey. If two items have both the same priority and orderKey, ordering is ambiguous and compareTo throws IllegalStateException listing both conflicting [priority, orderKey] pairs.
Source
Thrown at extensions/vertx/deployment-spi/src/main/java/io/quarkus/vertx/deployment/spi/VertxOptionsConsumerBuildItem.java:51
}
public Consumer<VertxOptions> getConsumer() {
return consumer;
}
@Override
public int compareTo(VertxOptionsConsumerBuildItem o) {
if (this == o) {
return 0;
}
int result = Integer.compare(this.priority, o.priority);
if (result != 0) {
return result;
}
result = this.orderKey.compareTo(o.orderKey);
if (result == 0) {
throw new IllegalStateException(
"Two VertxOptionsConsumerBuildItem instances have the same priority and orderKey, which is not allowed. "
+ "First instance: [priority: " + this.priority + ", orderKey: " + this.orderKey + "], "
+ "second instance: [priority: " + o.priority + ", orderKey: " + o.orderKey + "]");
}
return result;
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Rename one item's orderKey to a unique value (include the extension/feature name)
- Change priority values where genuinely different ordering is intended
- Search the build for all productions of VertxOptionsConsumerBuildItem and make (priority, orderKey) pairs unique
- Document key naming conventions to prevent future collisions
Example fix
// before new VertxOptionsConsumerBuildItem(c, 50, "options"); new VertxOptionsConsumerBuildItem(c2, 50, "options"); // after new VertxOptionsConsumerBuildItem(c, 50, "ext-a-options"); new VertxOptionsConsumerBuildItem(c2, 50, "ext-b-options");
Defensive patterns
Strategy: validation
Validate before calling
Set<String> keys = new HashSet<>();
for (var item : items) {
if (!keys.add(item.priority + ":" + item.orderKey)) {
throw new IllegalStateException("Duplicate VertxOptionsConsumerBuildItem priority+orderKey: " + item.orderKey);
}
} Try / catch
try {
items.sort(null); // triggers compareTo conflict detection
} catch (IllegalStateException e) {
throw new IllegalStateException("Rename conflicting orderKey", e);
} Prevention
- Namespace orderKeys with extension/feature names
- Keep a central registry of (priority, orderKey) pairs in your project
- Search for duplicate VertxOptionsConsumerBuildItem productions when merging branches
When it happens
Trigger: The Vert.x deployment sorts the collected VertxOptionsConsumerBuildItem list and encounters two items with equal priority and identical orderKey — usually two extensions or build steps reusing the same key.
Common situations: Copy-pasted build-item code across extensions; duplicate registrations after merging feature branches; a shared library and application both registering with the same default key.
Related errors
- Two VertxBootstrapConsumerBuildItem instances have the same
- orderKey must be present and not empty
- orderKey must be present and not empty
- Failed to find any non-blocking provider for startup actions
- No Vert.x instance has been registered in ArC ?
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/6b0992930d5d4303.
Report an issue: GitHub.