{"record":{"id":"d25432e9638be43b","repo":"quarkusio/quarkus","slug":"failed-to-create-worker-for-workername","errorCode":null,"errorMessage":"Failed to create Worker for ${workerName}","messagePattern":"Failed to create Worker for (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/smallrye-reactive-messaging/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/runtime/QuarkusWorkerPoolRegistry.java","lineNumber":260,"sourceCode":"        if (workerConfig.containsKey(workerName)) {\n            WorkerExecutor executor = workerExecutors.get(workerName);\n            if (executor == null) {\n                synchronized (this) {\n                    executor = workerExecutors.get(workerName);\n                    if (executor == null) {\n                        WorkerPoolConfig config = workerConfig.get(workerName);\n                        executor = executionHolder.vertx().createSharedWorkerExecutor(workerName,\n                                config.maxConcurrency());\n                        log.infof(\"Created worker pool named %s with concurrency of %d\", workerName,\n                                config.maxConcurrency());\n                        workerExecutors.put(workerName, executor);\n                    }\n                }\n            }\n            if (executor != null) {\n                return executor;\n            } else {\n                throw new RuntimeException(\"Failed to create Worker for \" + workerName);\n            }\n        }\n\n        // Shouldn't get here\n        throw new IllegalArgumentException(\"@Blocking referred to invalid worker name. \" + workerName);\n    }\n\n    public void defineWorker(String className, String method, String poolName, boolean virtualThread) {\n        Objects.requireNonNull(className, \"className was empty\");\n        Objects.requireNonNull(method, \"Method was empty\");\n        if (virtualThread) {\n            virtualThreadWorkers.add(poolName);\n            return;\n        }\n\n        if (!poolName.equals(Blocking.DEFAULT_WORKER_POOL)) {\n            // Validate @Blocking value is not empty, if set\n            if (Validation.isBlank(poolName)) {","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/smallrye-reactive-messaging/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/runtime/QuarkusWorkerPoolRegistry.java#L242-L278","documentation":"QuarkusWorkerPoolRegistry.getWorker tries to obtain/create the worker pool referenced by a @Blocking annotation. When the executor could not be created for the given worker name it throws RuntimeException 'Failed to create Worker for <name>'. This is a runtime failure of worker pool provisioning, typically after defineWorker registered a pool that cannot be instantiated.","triggerScenarios":"@Blocking(\"myPool\") where the registry fails to create the executor for 'myPool' at lookup time (e.g. invalid configuration of max concurrency, executor creation failure).","commonSituations":"Misconfigured worker pool parameters; racing/incorrect defineWorker calls from the deployment-generated code; virtual vs platform thread pool misconfiguration.","solutions":["Check worker pool configuration properties (quarkus.thread-pool.max-threads etc.) for invalid values.","Verify defineWorker was called with a valid pool name matching @Blocking's value.","Inspect the underlying cause logged by the executor factory.","Simplify to default @Blocking (no name) to use the default worker pool."],"exampleFix":"// before\n@Blocking(\"borked-pool\")\nvoid consume(String m) { ... }\n// after\n@Blocking\nvoid consume(String m) { ... }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    Worker w = registry.getWorker(workerName);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Failed to create Worker for \" + workerName)) {\n        // fall back to default worker\n        w = registry.getWorker(\"\");\n    } else throw e;\n}","preventionTips":["Validate thread-pool config values at startup.","Prefer default @Blocking unless a dedicated pool is genuinely needed.","Log and monitor worker pool creation during bootstrap."],"tags":["quarkus","reactive-messaging","worker-pool","threading","runtime"],"backgroundTag":"worker-creation-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}