{"record":{"id":"561f667e005884d7","repo":"eclipse-vertx/vert.x","slug":"eventlooppoolsize-must-be-0","errorCode":null,"errorMessage":"eventLoopPoolSize must be > 0","messagePattern":"eventLoopPoolSize must be > 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"info","filePath":"vertx-core/src/main/java/io/vertx/core/VertxOptions.java","lineNumber":211,"sourceCode":"\n  /**\n   * Get the number of event loop threads to be used by the Vert.x instance.\n   *\n   * @return the number of threads\n   */\n  public int getEventLoopPoolSize() {\n    return eventLoopPoolSize;\n  }\n\n  /**\n   * Set the number of event loop threads to be used by the Vert.x instance.\n   *\n   * @param eventLoopPoolSize the number of threads\n   * @return a reference to this, so the API can be used fluently\n   */\n  public VertxOptions setEventLoopPoolSize(int eventLoopPoolSize) {\n    if (eventLoopPoolSize < 1) {\n      throw new IllegalArgumentException(\"eventLoopPoolSize must be > 0\");\n    }\n    this.eventLoopPoolSize = eventLoopPoolSize;\n    return this;\n  }\n\n  /**\n   * Get the maximum number of worker threads to be used by the Vert.x instance.\n   * <p>\n   * Worker threads are used for running blocking code and worker verticles.\n   *\n   * @return the maximum number of worker threads\n   */\n  public int getWorkerPoolSize() {\n    return workerPoolSize;\n  }\n\n  /**\n   * Set the maximum number of worker threads to be used by the Vert.x instance.","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/VertxOptions.java#L193-L229","documentation":"SC_NETWORK_AUTHENTICATION_REQUIRED is an HttpResponseExpectation constant asserting HTTP 511 (RFC 6585). It validates that a response has status 511 — typically returned by captive portals requiring network login — and fails expectation checks on any other status.","triggerScenarios":"Using HttpResponseExpectation.SC_NETWORK_AUTHENTICATION_REQUIRED against a response whose status is not 511; detecting captive-portal interception of requests.","commonSituations":"Applications used on public Wi-Fi where a captive portal hijacks HTTP(S) requests and returns 511; network-onboarding flows that must redirect users to a login page.","solutions":["Detect the 511 status and redirect the user to the portal login page before retrying the request.","Complete network authentication, then re-issue the original request.","Use SC_NETWORK_AUTHENTICATION_REQUIRED in tests where captive-portal behavior is simulated deliberately."],"exampleFix":"// before\nrequest.expect(HttpResponseExpectation.SC_OK).send();\n// after\nrequest.send().onSuccess(resp -> {\n  if (resp.statusCode() == 511) {\n    // redirect user to captive portal login, then retry\n  }\n});","handlingStrategy":"try-catch","validationCode":"if (response.statusCode() == 511) {\n  String loginUrl = response.getHeader(\"Location\");\n  // redirect user to captive portal, then retry the original request\n}","typeGuard":null,"tryCatchPattern":"request.send().onFailure(err -> {\n  if (err instanceof HttpExpectationFailedException e && e.response().statusCode() == 511) {\n    // handle captive portal: prompt network login and retry\n  }\n});","preventionTips":["Proactively probe for captive portals on untrusted networks before app traffic.","Detect 511 responses and drive users to the portal login flow.","Cache portal-completion state and retry original requests after authentication."],"tags":["http","captive-portal","network","expectation"],"backgroundTag":"http-error-status","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"}