title: Vertx http server Thread has been blocked for xxxx ms, time limit is 2000
body: <p>i have written a large scale http server using , but im getting this error when number of concurrent requests increases </p>
  
  <pre><code> WARNING: Thread Thread[vert.x-eventloop-thread-1,5,main] has been blocked for 8458 ms, time limit is 1000
  </code></pre>
  
  <p>io.vertx.core.VertxException: Thread blocked</p>
  
  <p>here is my full code :</p>
  
  <pre><code>  public class MyVertxServer {
  
  public Vertx vertx = Vertx.vertx(new VertxOptions().setWorkerPoolSize(100));
  private HttpServer server = vertx.createHttpServer();
  private Router router = Router.router(vertx);
  
  public void bind(int port){
  
  
      server.requestHandler(router::accept).listen(port);
  
  }
  
  public void createContext(String path,MyHttpHandler handler){
  
      if(!path.endsWith("/")){
          path += "/";
      }
  
      path+="*";
  
  
      router.route(path).handler(new Handler&lt;RoutingContext&gt;() {
  
          @Override
          public void handle(RoutingContext ctx) {
  
              String[] handlerID = ctx.request().uri().split(ctx.currentRoute().getPath());
  
              String suffix = handlerID.length &gt; 1 ? handlerID[1] : null;
              handler.Handle(ctx, new VertxUtils(), suffix);
  
          }
      });
  }
  
  
  }
  </code></pre>
  
  <p>and how i call it :</p>
  
  <pre><code>    ver.createContext("/getRegisterManager",new ProfilesManager.RegisterHandler());
      ver.createContext("/getLoginManager", new ProfilesManager.LoginHandler());
      ver.createContext("/getMapcomCreator",new ItemsManager.MapcomCreator());
      ver.createContext("/getImagesManager", new ItemsManager.ImagesHandler());
  
      ver.bind(PORT);
  </code></pre>
  
  <p>how ever i dont find eventbus() useful for http servers that process send/receive files , because u need to send the RoutingContext in the message with is not possible.</p>
  
  <p>could you please point me to the right direction? thanks</p>
  
  <p>added a little bit of handler's code:</p>
  
  <pre><code>  class ProfileGetter implements MyHttpHandler{
  
      @Override
      public void Handle(RoutingContext ctx, VertxUtils utils, String suffix) {
  
          String username = utils.Decode(ctx.request().headers().get("username"));
          String lang = utils.Decode(ctx.request().headers().get("lang"));
  
          display("profile requested : "+username);
  
          Profile profile = ProfileManager.FindProfile(username,lang);
  
          if(profile == null){
              ctx.request().response().putHeader("available","false");
              utils.sendResponseAndEnd(ctx.response(),400);
              return;
          }else{
              ctx.request().response().putHeader("available","true");
              utils.writeStringAndEnd(ctx, new Gson().toJson(profile));
          }
  
      }
  
  
  
    }
  </code></pre>
  
  <p>here ProfileManager.FindProfile(username,lang) does a long running database job on the same thread </p>
  
  <p>...</p>
  
  <p>basically all of my processes are happening on the main thread , because if i use executor i will get strange exceptions and nullpointers in Vertx , making me feel like the request proccessors in Vertx are parallel</p>