{"record":{"id":"7a6c843b4139ef9b","repo":"quarkusio/quarkus","slug":"orderkey-must-be-present-and-not-empty-7a6c84","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/VertxOptionsConsumerBuildItem.java","lineNumber":28,"sourceCode":" * Vert.x system behavior, e.g. setting MetricsOptions to enable\n * and configure a metrics provider.\n * <p>\n * Consumers will be called in priority order (lowest to highest), then by order key,\n * after VertxConfiguration has been read and applied.\n */\npublic final class VertxOptionsConsumerBuildItem extends MultiBuildItem implements Comparable<VertxOptionsConsumerBuildItem> {\n    private final Consumer<VertxOptions> consumer;\n    private final int priority;\n    private final String orderKey;\n\n    /**\n     * @param optionsConsumer the consumer to apply to VertxOptions\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 VertxOptionsConsumerBuildItem(Consumer<VertxOptions> 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<VertxOptions> getConsumer() {\n        return consumer;\n    }\n\n    @Override\n    public int compareTo(VertxOptionsConsumerBuildItem 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":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/vertx/deployment-spi/src/main/java/io/quarkus/vertx/deployment/spi/VertxOptionsConsumerBuildItem.java#L10-L46","documentation":"VertxOptionsConsumerBuildItem carries a Consumer<VertxOptions> applied when the Vert.x instance is configured, with a priority and a mandatory stable orderKey for deterministic sorting. The constructor throws IllegalArgumentException for a null or empty orderKey.","triggerScenarios":"Creating new VertxOptionsConsumerBuildItem(consumer, priority, orderKey) in a deployment build step with a null/empty orderKey, typically from an unset config value or forgotten argument.","commonSituations":"Extension authors customizing Vert.x options based on configuration where the key field is absent; porting code from the older constructor that had no orderKey parameter.","solutions":["Supply a stable non-empty orderKey literal unique to your extension","Default the key from configuration with Objects.requireNonNullElse or @WithDefault in the config mapping","Validate configuration before constructing the build item","Update extension code to the current constructor signature"],"exampleFix":"// before\nnew VertxOptionsConsumerBuildItem(consumer, priority, null);\n\n// after\nnew VertxOptionsConsumerBuildItem(consumer, priority, \"myext-vertx-options\");","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(orderKey, \"orderKey required\");\nif (orderKey.isEmpty()) throw new IllegalArgumentException(\"orderKey must not be empty\");\nnew VertxOptionsConsumerBuildItem(consumer, priority, orderKey);","typeGuard":null,"tryCatchPattern":"try {\n    new VertxOptionsConsumerBuildItem(consumer, priority, key);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"VertxOptions consumer wiring failed: \" + e.getMessage(), e);\n}","preventionTips":["Give each options consumer a stable literal key","Validate config before constructing the build item","Migrate off the legacy constructor signature lacking 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"}