{"record":{"id":"010dfcd3c71fb00d","repo":"quarkusio/quarkus","slug":"two-vertxbootstrapconsumerbuilditem-instances-have","errorCode":null,"errorMessage":"Two VertxBootstrapConsumerBuildItem instances have the same priority and orderKey, which is not allowed. First instance: [priority: ${priority}, orderKey: ${orderKey}], second instance: [priority: ${otherPriority}, orderKey: ${otherOrderKey}]","messagePattern":"Two VertxBootstrapConsumerBuildItem instances have the same priority and orderKey, which is not allowed\\. First instance: \\[priority: (.+?), orderKey: (.+?)\\], second instance: \\[priority: (.+?), orderKey: (.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/vertx/deployment-spi/src/main/java/io/quarkus/vertx/deployment/spi/VertxBootstrapConsumerBuildItem.java","lineNumber":59,"sourceCode":"        return consumer;\n    }\n\n    @Override\n    public int compareTo(VertxBootstrapConsumerBuildItem o) {\n        if (this == o) {\n            return 0;\n        }\n        int result = Integer.compare(this.priority, o.priority);\n        if (result != 0) {\n            return result;\n        }\n        Logger.getLogger(VertxBootstrapConsumerBuildItem.class).warnf(\n                \"Two VertxBootstrapConsumerBuildItem have the same priority (%d). The order of execution is not guaranteed. \" +\n                        \"Consider using different priorities to ensure a deterministic order.\",\n                this.priority);\n        result = this.orderKey.compareTo(o.orderKey);\n        if (result == 0) {\n            throw new IllegalStateException(\n                    \"Two VertxBootstrapConsumerBuildItem instances have the same priority and orderKey, which is not allowed. \"\n                            + \"First instance: [priority: \" + this.priority + \", orderKey: \" + this.orderKey + \"], \"\n                            + \"second instance: [priority: \" + o.priority + \", orderKey: \" + o.orderKey + \"]\");\n        }\n        return result;\n    }\n}\n","sourceCodeStart":41,"sourceCodeEnd":67,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/vertx/deployment-spi/src/main/java/io/quarkus/vertx/deployment/spi/VertxBootstrapConsumerBuildItem.java#L41-L67","documentation":"VertxBootstrapConsumerBuildItem implements Comparable: consumers are first ordered by priority, then by orderKey. If two items share both the same priority and the same orderKey, deterministic ordering is impossible and compareTo throws IllegalStateException naming both conflicting instances.","triggerScenarios":"Two extensions (or two build steps in one extension) produce VertxBootstrapConsumerBuildItem instances with equal priority and identical orderKey, then the deployment sorts them.","commonSituations":"Copy-pasting build-item creation code between extensions without changing the key; two features in the same extension reusing the default key; a version merge leaving duplicate registrations.","solutions":["Change one item's orderKey to a unique stable string (prefix with the extension name)","Use a different priority value if ordering intent actually differs","Audit your codebase for duplicate VertxBootstrapConsumerBuildItem productions","Register ordering via documented conventions so keys don't collide across extensions"],"exampleFix":"// before (two places)\nnew VertxBootstrapConsumerBuildItem(c1, 100, \"bootstrap\");\nnew VertxBootstrapConsumerBuildItem(c2, 100, \"bootstrap\");\n\n// after\nnew VertxBootstrapConsumerBuildItem(c1, 100, \"ext-a-bootstrap\");\nnew VertxBootstrapConsumerBuildItem(c2, 100, \"ext-b-bootstrap\");","handlingStrategy":"validation","validationCode":"// ensure unique (priority, orderKey) pairs before producing items\nSet<String> seen = new HashSet<>();\nfor (var item : items) {\n    if (!seen.add(item.priority + \":\" + item.orderKey)) {\n        throw new IllegalStateException(\"Duplicate priority+orderKey: \" + item.orderKey);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    Collections.sort(items);\n} catch (IllegalStateException e) {\n    throw new IllegalStateException(\"Fix duplicate VertxBootstrapConsumerBuildItem keys\", e);\n}","preventionTips":["Prefix orderKey with the extension name for uniqueness","Never reuse the same key at the same priority across extensions","Audit build steps that produce bootstrap consumers for copy-paste duplicates"],"tags":["quarkus","vertx","build-spi","ordering-conflict","duplicates"],"backgroundTag":"duplicate-build-item-order-key","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}