【问题标题】:com.lightbend.lagom.internal.scaladsl.registry.ScalaServiceRegistryClient [] - serviceName=[elastic-search] was not foundcom.lightbend.lagom.internal.scaladsl.registry.ScalaServiceRegistryClient [] - 未找到 serviceName=[elastic-search]
【发布时间】:2021-02-28 22:26:03
【问题描述】:

我是 lagom scala 的新手。因为我使用弹性搜索将我的数据存储为文档。我也在运行外部 cassandra。当我调用一个操作将我的数据存储在 cassandra 和弹性搜索中时。因为我的数据数据成功存储在 cassandra 中,但没有存储在弹性搜索中。我也将所有依赖项都包含在 Loader 中,lagomUnmanagedServices 也用于弹性搜索。 我的弹性搜索加载器类

 lazy val elasticSearch= serviceClient.implement[ElasticSearch]


 lazy val indexStore:IndexStore[SearchResult]=wire[ElasticSearchIndexStore]

我用于弹性搜索的 build.sbt 文件是

lagomUnmanagedServices in ThisBuild := Map("elastic-search" -> "http://127.0.0.1:9200")

lagomCassandraEnabled in ThisBuild := false

lagomUnmanagedServices in ThisBuild := Map("cas_native" -> "http://localhost:9042")

弹性搜索服务调用

override def descriptor: Descriptor ={
  named("elastic-search")
  .withCalls(
    restCall(Method.POST,"/:index/category/:id/_update",updateIndexCategory _)
 .withAutoAcl(true)

我的特质服务方法

    trait ElasticSearch extends Service
{
  def updateIndexCategory(index:String,id:UUID):ServiceCall[UpdateIndexCategoryData,Done]
}

我也在外部运行弹性搜索。但我不知道为什么会显示此消息

com.lightbend.lagom.internal.scaladsl.registry.ScalaServiceRegistryClient [] - serviceName=[elastic-search] was not found. Hint: Maybe it was not started?

提前致谢。

【问题讨论】:

    标签: scala web-services elasticsearch cassandra lagom


    【解决方案1】:

    我发现错误出现在 cassandra 的 lagomUnmanagedServices 中。 我把它改成下面的样子

    lagomCassandraEnabled in ThisBuild := false
    lagomCassandraPort in ThisBuild:=9042
    

    【讨论】:

      猜你喜欢
      • 2016-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-09-29
      • 2022-06-29
      • 2019-11-04
      • 2018-01-14
      • 2021-07-31
      相关资源
      最近更新 更多