{"record":{"id":"d1436bb4b4bed2f5","repo":"quarkusio/quarkus","slug":"orderkey-must-be-present-and-not-empty","errorCode":null,"errorMessage":"orderKey must be present and not empty","messagePattern":"orderKey must be present and not empty","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/vertx/deployment-spi/src/main/java/io/quarkus/vertx/deployment/spi/VertxBootstrapConsumerBuildItem.java","lineNumber":33,"sourceCode":" * after VertxOptions customizers have been applied.\n * <p>\n * Unlike {@link VertxOptionsConsumerBuildItem}, there is no runtime alternative. {@link VertxBootstrap} being an\n * internal API, only extensions can customize it, and they must do so at build time.\n */\npublic final class VertxBootstrapConsumerBuildItem extends MultiBuildItem\n        implements Comparable<VertxBootstrapConsumerBuildItem> {\n    private final Consumer<VertxBootstrap> consumer;\n    private final int priority;\n    private final String orderKey;\n\n    /**\n     * @param consumer the consumer to apply to VertxBootstrap\n     * @param priority consumers are called from lowest to highest priority\n     * @param orderKey a stable key used to order consumers with the same priority\n     */\n    public VertxBootstrapConsumerBuildItem(Consumer<VertxBootstrap> consumer, int priority, String orderKey) {\n        if (orderKey == null || orderKey.isEmpty()) {\n            throw new IllegalArgumentException(\"orderKey must be present and not empty\");\n        }\n        this.consumer = consumer;\n        this.priority = priority;\n        this.orderKey = orderKey;\n    }\n\n    public Consumer<VertxBootstrap> getConsumer() {\n        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;","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/vertx/deployment-spi/src/main/java/io/quarkus/vertx/deployment/spi/VertxBootstrapConsumerBuildItem.java#L15-L51","documentation":"VertxBootstrapConsumerBuildItem is a deployment SPI build item carrying a Consumer<VertxBootstrap> with a priority and a stable orderKey used to sort consumers deterministically. The constructor rejects a null or empty orderKey because ordering without a stable key is undefined.","triggerScenarios":"An extension's build step constructs new VertxBootstrapConsumerBuildItem(consumer, priority, orderKey) with orderKey == null or \"\" (e.g. from an unset config value or missing constant).","commonSituations":"Extension authors wiring bootstrap customization from configuration where the key property is unset; copy-pasting the two-argument constructor from an older API that had no orderKey.","solutions":["Pass a non-empty stable string literal as orderKey (e.g. \"my-extension-bootstrap\")","Derive the key from a config property with a documented default","Fix extension code still calling an older constructor signature","If the key comes from config, validate the config before creating the build item"],"exampleFix":"// before\nnew VertxBootstrapConsumerBuildItem(consumer, 100, config.key()); // may be null\n\n// after\nnew VertxBootstrapConsumerBuildItem(consumer, 100,\n    Objects.requireNonNullElse(config.key(), \"myext-bootstrap\"));","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(orderKey, \"orderKey required\");\nif (orderKey.isEmpty()) throw new IllegalArgumentException(\"orderKey must not be empty\");\nnew VertxBootstrapConsumerBuildItem(consumer, priority, orderKey);","typeGuard":null,"tryCatchPattern":"try {\n    new VertxBootstrapConsumerBuildItem(consumer, priority, key);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"Build item wiring failed: \" + e.getMessage(), e);\n}","preventionTips":["Use a constant string literal per build item production","Default config-derived keys with @WithDefault or requireNonNullElse","Update any code calling the old constructor without orderKey"],"tags":["quarkus","vertx","build-spi","argument-validation","extension-development"],"backgroundTag":"missing-required-argument","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"}