HttpEndpoint.getClient(serviceDiscovery, new JsonObject().put("name","tweets"), endPoint -> {
if(endPoint.failed()){
log.error("Failed getting discovery", endPoint.cause());
}else{
HttpClient client = endPoint.result();
client.get("/v1/api/tweets", response -> {
response.bodyHandler(body -> routingContext.response().end(body.toString()));
})
.setTimeout(2000)
.exceptionHandler(e -> {
log.error("Exception: " + e.getCause());
routingContext.response().end("Error");
})
.end();
}
});Apr 09, 2017 10:51:01 AM com.tweets.Routes
SEVERE: Exception: nullThe exception itself is null, when I changed my code to
log.error("Exception: " + e.getCause().getMessage());
I got NPE(Routes.java:63 is the log.error).Apr 09, 2017 4:18:16 PM io.vertx.core.impl.ContextImpl
SEVERE: Unhandled exception
java.lang.NullPointerException
at com.tweets.Routes.lambda$null$5(Routes.java:63)
at io.vertx.core.http.impl.HttpClientRequestBase.handleException(HttpClientRequestBase.java:136)
at io.vertx.core.http.impl.HttpClientRequestImpl.handleException(HttpClientRequestImpl.java:51)
at io.vertx.core.http.impl.HttpClientRequestImpl$2.handleFailure(HttpClientRequestImpl.java:707)
at io.vertx.core.http.impl.ConnectionManager$ConnQueue.lambda$connectionFailed$3(ConnectionManager.java:368)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:335)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:193)
at io.vertx.core.http.impl.ConnectionManager$ConnQueue.connectionFailed(ConnectionManager.java:362)
at io.vertx.core.http.impl.ConnectionManager$ConnQueue.access$1900(ConnectionManager.java:194)
at io.vertx.core.http.impl.ConnectionManager$ChannelConnector.lambda$connect$2(ConnectionManager.java:528)
at io.vertx.core.net.impl.ChannelProvider.lambda$connect$0(ChannelProvider.java:42)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:500)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:479)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:420)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:122)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:327)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:343)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:630)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:745)
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/02b318a2-302e-4c1f-ad53-939679e571dd%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.