com.lightbend.lagom.internal.broker.kafka.kafkasubscriber

imzjd6km  于 2021-06-04  发布在  Kafka
关注(0)|答案(1)|浏览(556)

我是lagom,elasticsearch的新手,我正在使用lagom,elasticsearch,scala和cassandra。一切都很好,但当我通过postman发布json数据时,数据会转到cassandra,但不会转到elasticsearch,我会收到一个错误警告,如下所示
12:22:10.688[error]com.lightbend.lagom.internal.broker.kafka.kafkasubscriber[sourcethread=search-impl-application-akka.actor.default-dispatcher-5,akkatimestamp=06:52:10.688utc,akkasource=akka。tcp://search-impl-application@127.0.0.1:51584/user/kafkabackoffconsumer1 customertopic/kafkaconsumera1 customertopic,sourceactorsystem=search impl application]-主题订阅因失败而中断:[java.lang.illegalstateexception:服务定位器未找到服务ElasticSearch]12:22:10.688[error]akka.actor.oneforonestrategy[sourcethread=search-impl-application-akka.actor.default-dispatcher-5,akkatimestamp=06:52:10.688utc,阿克卡斯尔=akka://search-impl-application/user/kafkabackoffconsumer1-customertopic/kafkaconsumeractor1-customertopic,sourceactorsystem=search impl application]-服务定位器java.lang.illegalstateexception未找到服务ElasticSearch:服务定位器com.lightbend.lagom.internal.client.clientservicecallinvoker.$anonfun$doinvoke$4(clientservicecallinvoker)未找到服务ElasticSearch。scala:75)在scala.util.success.$anonfun$map$1(请尝试。scala:251)在scala.util.success.map(try。scala:209)在scala.concurrent.future.$anonfun$map$1(future。scala:289)在scala.concurrent.impl.promise.liftedtree1$1(promise。scala:29)在scala.concurrent.impl.promise.$anonfun$transform$1(promise。scala:29)在scala.concurrent.impl.callbackrunnable.run(承诺。scala:60)在akka.dispatch.batchingexecutor$abstractbatch.processbatch(batchingexecutor。scala:55)在akka.dispatch.batchingexecutor$blockablebatch.$anonfun$运行$1(batchingexecutor。scala:91)在scala.runtime.java8.jfunction0$mcv$sp.apply(jfunction0$mcv$sp。java:12)在scala.concurrent.blockcontext$.withblockcontext(blockcontext)。scala:81)在akka.dispatch.batchingexecutor$blockablebatch.run(batchingexecutor。scala:91)在akka.dispatch.taskinvocation.run(abstractdispatcher。scala:40)在akka.dispatch.forkjoinexecutorconfigurator$akkaforkjointask.exec(forkjoinexecutorconfigurator。scala:44)在akka.dispatch.forkjoin.forkjointask.doexec(forkjointask。java:260)在akka.dispatch.forkjoin.forkjoinpool$workqueue.runtask(forkjoinpool。java:1339)在akka.dispatch.forkjoin.forkjoinpool.runworker(forkjoinpool。java:1979)在akka.dispatch.forkjoin.forkjoinworkerthread.run(forkjoinworkerthread。java:107)
[警告]未找到com.lightbend.lagom.internal.scaladsl.registry.serviceregistryservicelocator[]-服务名称=[ElasticSearch]。提示:可能没有注册?
有什么帮助吗??

mitkmikd

mitkmikd1#

看到了吗https://www.lagomframework.com/documentation/1.4.x/scala/servicelocator.html#communicating-使用外部服务获取有关使用其他服务配置开发模式服务定位器的信息。
例如,在线拍卖scala示例项目中是这样配置的:

// register 'elastic-search' as an unmanaged service on the service locator so that at 'runAll' our code
// will resolve 'elastic-search' and use it. See also com.example.com.ElasticSearch
lagomUnmanagedServices in ThisBuild += ("elastic-search" -> "http://127.0.0.1:9200")

您需要重新加载sbt配置并重新启动服务才能使其生效。

相关问题