{"record":{"id":"0b8e5d2d156e32f0","repo":"eclipse-vertx/vert.x","slug":"address-not-specified","errorCode":null,"errorMessage":"address not specified","messagePattern":"address not specified","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/eventbus/impl/EventBusImpl.java","lineNumber":359,"sourceCode":"  }\n\n  private <T> void removeLocalRegistration(HandlerHolder<T> holder) {\n    String address = holder.getHandler().address;\n    handlerMap.compute(address, (key, val) -> {\n      if (val == null) {\n        return null;\n      }\n      ConcurrentCyclicSequence<HandlerHolder> next = val.remove(holder);\n      return next.size() == 0 ? null : next;\n    });\n    if (holder.setRemoved() && holder.getContext().deploymentID() != null) {\n      holder.getContext().removeCloseHook(holder.getHandler());\n    }\n  }\n\n  protected <T> void sendReply(MessageImpl<?, T> replyMessage, DeliveryOptions options, ReplyHandler<T> replyHandler) {\n    if (replyMessage.address() == null) {\n      throw new IllegalStateException(\"address not specified\");\n    } else {\n      sendOrPubInternal(new SendContext<>(vertx.getOrCreateContext(), replyMessage, options, replyHandler));\n    }\n  }\n\n  protected <T> void sendOrPub(ContextInternal ctx, MessageImpl<?, T> message, DeliveryOptions options, Promise<Void> writePromise) {\n    sendLocally(message, writePromise);\n  }\n\n  protected <T> void sendOrPub(SendContext<T> sendContext) {\n    sendOrPub(sendContext.ctx, sendContext.message, sendContext.options, sendContext);\n  }\n\n  protected <T> void sendLocally(MessageImpl<?, T> message, Promise<Void> writePromise) {\n    ReplyException failure = deliverMessageLocally(message);\n    if (failure != null) {\n      writePromise.tryFail(failure);\n    } else {","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/eventbus/impl/EventBusImpl.java#L341-L377","documentation":"sendReply is invoked when replying to a received message; the reply message must carry a destination address. EventBusImpl.sendReply throws this IllegalStateException when replyMessage.address() is null, i.e. a reply is being sent but no reply address was captured from the incoming message.","triggerScenarios":"Constructing a MessageImpl manually with a null address and passing it to sendReply/internal reply APIs; replying through a hand-rolled ReplyHandler without a generateReplyAddress()-assigned reply address; misuse of protected internal reply paths in custom EventBus subclasses.","commonSituations":"Custom EventBus implementations or deep-integration code that bypass Message.reply()/fail() and call internal methods directly; tests fabricating reply messages without setting the reply address.","solutions":["Reply using message.reply(body) / replyAndRequest() on the received Message instead of calling internal sendReply.","If building a reply message manually, set its address (typically via generateReplyAddress() or the incoming message's replyAddress).","Avoid subclassing/patching EventBus internals; use DeliveryOptions and the public Message API."],"exampleFix":"// before\nMessageImpl reply = new MessageImpl<>(null, body, options, bus); // null address\nbus.sendReply(reply, options, handler);\n// after\nmessage.reply(body, new DeliveryOptions());","handlingStrategy":"type-guard","validationCode":"Objects.requireNonNull(replyMessage.address(), \"reply address must be set before sendReply\");","typeGuard":"boolean canReply(Message<?, ?> m) {\n  return m.address() != null || m.replyAddress() != null;\n}","tryCatchPattern":"try {\n  message.reply(body);\n} catch (IllegalStateException e) {\n  // no reply address; log and fall back to normal send\n}","preventionTips":["Use the public Message.reply()/replyAndRequest() API instead of internal sendReply","Never construct reply MessageImpl instances manually","In custom EventBus subclasses, always assign generateReplyAddress() to reply messages"],"tags":["eventbus","reply","missing-address","illegal-state"],"backgroundTag":"missing-required-argument","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}