i am trying to run the following vertx tutorial but stuck on this exception.
i have tried to run just single service or the whole project the exception is coming the same.
any docker setting i am missing?
ov 03, 2016 10:35:55 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
cache-infrastructure_1 | INFO: Succeeded in deploying verticle
inventory-microservice_1 | java.net.UnknownHostException: failed to resolve 'inventory-microservice'. Exceeded max queries per resolve 3
inventory-microservice_1 | at io.netty.resolver.dns.DnsNameResolverContext.finishResolve(DnsNameResolverContext.java:476)
inventory-microservice_1 | at io.netty.resolver.dns.DnsNameResolverContext.tryToFinishResolve(DnsNameResolverContext.java:398)
inventory-microservice_1 | at io.netty.resolver.dns.DnsNameResolverContext$3.operationComplete(DnsNameResolverContext.java:193)
inventory-microservice_1 | at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
inventory-microservice_1 | at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:488)
inventory-microservice_1 | at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
inventory-microservice_1 | at io.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:102)
inventory-microservice_1 | at io.netty.resolver.dns.DnsQueryContext.setSuccess(DnsQueryContext.java:195)
inventory-microservice_1 | at io.netty.resolver.dns.DnsQueryContext.finish(DnsQueryContext.java:178)
inventory-microservice_1 | at io.netty.resolver.dns.DnsNameResolver$DnsResponseHandler.channelRead(DnsNameResolver.java:694)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
inventory-microservice_1 | at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
inventory-microservice_1 | at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
inventory-microservice_1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
inventory-microservice_1 | at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
inventory-microservice_1 | at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:93)
inventory-microservice_1 | at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:610)
inventory-microservice_1 | at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:551)
inventory-microservice_1 | at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:465)
inventory-microservice_1 | at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:437)
inventory-microservice_1 | at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
inventory-microservice_1 | at java.lang.Thread.run(Thread.java:745)
解决方案
After lots of debugging finally i found out the recent version of vertx has issues resolving host. so by this option we can disable the disableDnsResolver which is ON by default. and it worked fine for me
CMD ["java -Dvertx.disableDnsResolver=true -jar account-microservice-fat.jar -cluster -conf docker.json"]
if trying to run above example you need to add -Dvertx.disableDnsResolver=true in DockerFile of everymicroservice