Examples of failureType()


Examples of io.vertx.core.eventbus.ReplyException.failureType()

    return reply -> {
      Future<Message<T>> result;
      if (reply.body() instanceof ReplyException) {
        // This is kind of clunky - but hey-ho
        ReplyException exception = (ReplyException) reply.body();
        metrics.replyFailure(reply.address(), exception.failureType());
        result = Future.completedFuture(exception);
      } else {
        result = Future.completedFuture(reply);
      }
      handler.handle(result);
View Full Code Here

Examples of io.vertx.core.eventbus.ReplyException.failureType()

        assertFalse(ar.succeeded());
        Throwable cause = ar.cause();
        assertTrue(cause instanceof ReplyException);
        ReplyException re = (ReplyException) cause;
        assertEquals(-1, re.failureCode());
        assertEquals(ReplyFailure.TIMEOUT, re.failureType());
        assertTrue(now - start >= timeout);
        testComplete();
      });
    });
    eb.send(ADDRESS1, str, onSuccess((Message<String>msg) -> {
View Full Code Here

Examples of io.vertx.core.eventbus.ReplyException.failureType()

      assertFalse(ar.succeeded());
      Throwable cause = ar.cause();
      assertTrue(cause instanceof ReplyException);
      ReplyException re = (ReplyException) cause;
      assertEquals(-1, re.failureCode());
      assertEquals(ReplyFailure.TIMEOUT, re.failureType());
      assertTrue(now - start >= timeout);
      testComplete();
    });
    await();
  }
View Full Code Here

Examples of io.vertx.core.eventbus.ReplyException.failureType()

      assertFalse(ar.succeeded());
      Throwable cause = ar.cause();
      assertTrue(cause instanceof ReplyException);
      ReplyException re = (ReplyException) cause;
      assertEquals(-1, re.failureCode());
      assertEquals(ReplyFailure.NO_HANDLERS, re.failureType());
      testComplete();
    });
    await();
  }
View Full Code Here

Examples of io.vertx.core.eventbus.ReplyException.failureType()

      Throwable cause = ar.cause();
      assertTrue(cause instanceof ReplyException);
      ReplyException re = (ReplyException) cause;
      assertEquals(failureCode, re.failureCode());
      assertEquals(failureMsg, re.getMessage());
      assertEquals(ReplyFailure.RECIPIENT_FAILURE, re.failureType());
      testComplete();
    });
    await();
  }
View Full Code Here

Examples of io.vertx.core.eventbus.ReplyException.failureType()

      assertFalse(ar.succeeded());
      Throwable cause = ar.cause();
      assertTrue(cause instanceof ReplyException);
      ReplyException re = (ReplyException) cause;
      assertEquals(-1, re.failureCode());
      assertEquals(ReplyFailure.TIMEOUT, re.failureType());
      testComplete();
    });
    await();
  }
View Full Code Here

Examples of org.vertx.java.core.eventbus.ReplyException.failureType()

    eventBus.sendWithTimeout(inAddress, new JsonObject().putString("action", "connect"), 1000, new Handler<AsyncResult<Message<Boolean>>>() {
      @Override
      public void handle(AsyncResult<Message<Boolean>> result) {
        if (result.failed()) {
          ReplyException failure = (ReplyException) result.cause();
          if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) {
            log.warn(String.format("%s - Failed to connect to %s", DefaultOutputConnection.this, context.target()), result.cause());
            new DefaultFutureResult<Void>(failure).setHandler(doneHandler);
          } else if (failure.failureType().equals(ReplyFailure.TIMEOUT)) {
            log.warn(String.format("%s - Connection to %s failed, retrying", DefaultOutputConnection.this, context.target()));
            connect(doneHandler);
View Full Code Here

Examples of org.vertx.java.core.eventbus.ReplyException.failureType()

        if (result.failed()) {
          ReplyException failure = (ReplyException) result.cause();
          if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) {
            log.warn(String.format("%s - Failed to connect to %s", DefaultOutputConnection.this, context.target()), result.cause());
            new DefaultFutureResult<Void>(failure).setHandler(doneHandler);
          } else if (failure.failureType().equals(ReplyFailure.TIMEOUT)) {
            log.warn(String.format("%s - Connection to %s failed, retrying", DefaultOutputConnection.this, context.target()));
            connect(doneHandler);
          } else {
            log.debug(String.format("%s - Connection to %s failed, retrying", DefaultOutputConnection.this, context.target()));
            vertx.setTimer(500, new Handler<Long>() {
View Full Code Here

Examples of org.vertx.java.core.eventbus.ReplyException.failureType()

    eventBus.sendWithTimeout(inAddress, new JsonObject().putString("action", "disconnect"), 5000, new Handler<AsyncResult<Message<Boolean>>>() {
      @Override
      public void handle(AsyncResult<Message<Boolean>> result) {
        if (result.failed()) {
          ReplyException failure = (ReplyException) result.cause();
          if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) {
            log.warn(String.format("%s - Failed to disconnect from %s", DefaultOutputConnection.this, context.target()), result.cause());
            new DefaultFutureResult<Void>(failure).setHandler(doneHandler);
          } else if (failure.failureType().equals(ReplyFailure.NO_HANDLERS)) {
            log.info(String.format("%s - Disconnected from %s", DefaultOutputConnection.this, context.target()));
            new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
View Full Code Here

Examples of org.vertx.java.core.eventbus.ReplyException.failureType()

        if (result.failed()) {
          ReplyException failure = (ReplyException) result.cause();
          if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) {
            log.warn(String.format("%s - Failed to disconnect from %s", DefaultOutputConnection.this, context.target()), result.cause());
            new DefaultFutureResult<Void>(failure).setHandler(doneHandler);
          } else if (failure.failureType().equals(ReplyFailure.NO_HANDLERS)) {
            log.info(String.format("%s - Disconnected from %s", DefaultOutputConnection.this, context.target()));
            new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
          } else {
            log.debug(String.format("%s - Disconnection from %s failed, retrying", DefaultOutputConnection.this, context.target()));
            disconnect(doneHandler);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.