{"record":{"id":"ad8a374772f31929","repo":"eclipse-vertx/vert.x","slug":"event-bus-is-not-started","errorCode":null,"errorMessage":"Event Bus is not started","messagePattern":"Event Bus is not started","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/eventbus/impl/EventBusImpl.java","lineNumber":427,"sourceCode":"          }\n        }\n      }\n      return null;\n    } else {\n      if (metrics != null) {\n        metrics.messageReceived(msg.address(), !msg.isSend(), messageLocal, 0);\n      }\n      return new ReplyException(ReplyFailure.NO_HANDLERS, \"No handlers for address \" + msg.address);\n    }\n  }\n\n  protected HandlerHolder nextHandler(ConcurrentCyclicSequence<HandlerHolder> handlers, boolean messageLocal) {\n    return handlers.next();\n  }\n\n  protected void checkStarted() {\n    if (!started) {\n      throw new IllegalStateException(\"Event Bus is not started\");\n    }\n  }\n\n  protected String generateReplyAddress() {\n    return \"__vertx.reply.\" + Long.toString(replySequence.incrementAndGet());\n  }\n\n  <T> ReplyHandler<T> createReplyHandler(MessageImpl message,\n                                         boolean src,\n                                         DeliveryOptions options) {\n    return createReplyHandler(vertx.getOrCreateContext(), message, src,  options);\n  }\n\n  <T> ReplyHandler<T> createReplyHandler(ContextInternal context,\n                                         MessageImpl message,\n                                         boolean src,\n                                         DeliveryOptions options) {\n    long timeout = options.getSendTimeout();","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/eventbus/impl/EventBusImpl.java#L409-L445","documentation":"Most EventBus operations (consumer, localConsumer, sendOrPubInternal) require the bus to have completed its start sequence. EventBusImpl.checkStarted throws this IllegalStateException when 'started' is false, protecting against use of a bus whose internal structures are not yet initialized.","triggerScenarios":"Registering consumers or sending messages on the event bus before vertx.eventBus().start() (or Vertx startup) has completed; using an EventBus obtained from a Vertx instance that is still initializing.","commonSituations":"Application code using the bus inside a Verticle's constructor or before start() completes; custom Vertx builders/graalvm init that grab the event bus too early; tests that send messages immediately after Vertx.vertx() without awaiting startup.","solutions":["Call eventBus().start(...) and wait for the returned future before using the bus.","Move bus usage into verticle.start(Promise) and complete the promise after consumers are registered.","Compose on vertx.deployVerticle(...) / startup future with Futures.allSuccessful before sending messages.","Verify you are not calling EventBus methods on an EventBus from a Vertx instance you constructed without finishing its start."],"exampleFix":"// before\nvertx.eventBus().consumer(\"addr\", msg -> {}); // too early\n// after\nvertx.eventBus().start().onSuccess(v -> {\n  vertx.eventBus().consumer(\"addr\", msg -> {});\n});","handlingStrategy":"validation","validationCode":"// only touch the bus after startup completes\nvertx.eventBus().start().compose(v -> {\n  vertx.eventBus().consumer(\"addr\", msg -> {});\n  return Promise.<Void>succeededFuture().future();\n});","typeGuard":null,"tryCatchPattern":"try {\n  bus.consumer(\"addr\", handler);\n} catch (IllegalStateException e) {\n  // bus not started; defer registration until start future completes\n}","preventionTips":["Register consumers and send messages only inside verticle.start(Promise) after startup","Chain bus usage on the eventBus().start() future","Never use the event bus in constructors or static initializers"],"tags":["eventbus","lifecycle","not-started","illegal-state"],"backgroundTag":"invalid-state-transition","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}