You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use a circuit breaker with web-client we have this exception:
15:49:40.631 [vert.x-eventloop-thread-6] 83171574-ac36-4212-abc9-f51656734a2a ERROR io.vertx.core.impl.ContextImpl - Unhandled exception
java.lang.NoSuchMethodException: io.vertx.scala.ext.web.client.HttpResponse$.apply(io.vertx.ext.web.client.HttpResponse)
at java.lang.Class.getMethod(Class.java:1786)
at io.vertx.lang.scala.Converter$.toScala(Converter.scala:31)
at io.vertx.scala.core.Future.$anonfun$setHandler$2(Future.scala:57)
at io.vertx.lang.scala.AsyncResultWrapper.result$lzycompute(AsyncResultWrapper.scala:26)
at io.vertx.lang.scala.AsyncResultWrapper.result(AsyncResultWrapper.scala:26)
at com.norauto.api.external.organizationalunit.OUClient.$anonfun$vertxFutureToScalaFuture$1(OUClient.scala:77)
at io.vertx.scala.core.Future.$anonfun$setHandler$1(Future.scala:57)
at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:125)
at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:86)
at io.vertx.circuitbreaker.impl.CircuitBreakerImpl.lambda$null$3(CircuitBreakerImpl.java:220)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
The code is the following:
breaker.executeCommandFuture[HttpResponse[Buffer]](future => {
performSomeHttpRequest() onComplete {
case Success(httpResult) => future.complete(httpResult)
case Failure(error) => future.fail(error)
}
})
To fix that, we have encapsulated the HttpResource on a custom class Wrapper.
It seem that this failure occurs because HttpResponse.apply need an implicit type scala.reflect.runtime.universe.TypeTag, and the method toScala doesn't support that.
The text was updated successfully, but these errors were encountered:
When we use a circuit breaker with web-client we have this exception:
The code is the following:
To fix that, we have encapsulated the
HttpResource
on a custom classWrapper
.It seem that this failure occurs because
HttpResponse.apply
need an implicit typescala.reflect.runtime.universe.TypeTag
, and the methodtoScala
doesn't support that.The text was updated successfully, but these errors were encountered: