@Override
  public void sendRequest(String request) throws Exception {
    int retriesLeft = REQUEST_RETRIES;

    while (retriesLeft > 0 && !Thread.currentThread().isInterrupted()) {
      LOGGER.info("Sending request " + request);
      requester.send(request);

      int expect_reply = 1;
      while (expect_reply > 0) {
        PollItem items[] = {new PollItem(requester, Poller.POLLIN)};
        int rc = ZMQ.poll(items, REQUEST_TIMEOUT);
        if (rc == -1) {
          break; //  Interrupted
        }

        if (items[0].isReadable()) {

          try {
            String response = requester.recvStr();

            retriesLeft = 0;
            expect_reply = 0;

            LOGGER.info("Handling response");
            this.handler.handle(response);
          } catch (Exception e) {
            LOGGER.warn("Error during request/response", e);

            if (e instanceof ZMQException) {
              LOGGER.error("Will close request socket");
              requester.close();
              ctx.close();
              LOGGER.info("Closed request socket, which was connected to " + responder);
              throw new Exception("Error during request/response", e);
            }
          }

        } else if (--retriesLeft == 0) {
          LOGGER.error("Service " + responder + " seems to be unavailable");
          throw new Exception("Service " + responder + " seems to be unavailable");
        } else {
          LOGGER.warn("No response from " + responder);
          requester.close();
          LOGGER.info("Reconnecting request socket to " + responder);
          connect();
        }
      }
    }
  }