I am new in lagom scala. Since I am using elastic-search to store my data as documents. I am also having external cassandra running. When I call an action to store my data in cassandra as well as in elastic-search. since my data data is stored in cassandra successfully but not storing in elastic-search. I have included all the dependencies in Loader as well and lagomUnmanagedServices also for elastic-search. My Loader class for elastic-search
lazy val elasticSearch= serviceClient.implement[ElasticSearch]
lazy val indexStore:IndexStore[SearchResult]=wire[ElasticSearchIndexStore]
My build.sbt file for elastic-search is
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")
elastic-search service call
override def descriptor: Descriptor ={
named("elastic-search")
.withCalls(
restCall(Method.POST,"/:index/category/:id/_update",updateIndexCategory _)
.withAutoAcl(true)
my trait service method
trait ElasticSearch extends Service
{
def updateIndexCategory(index:String,id:UUID):ServiceCall[UpdateIndexCategoryData,Done]
}
I am externally running elastic-search also. But I dont know why this message showing
com.lightbend.lagom.internal.scaladsl.registry.ScalaServiceRegistryClient [] - serviceName=[elastic-search] was not found. Hint: Maybe it was not started?
Thanks in advance.
I found that the error was in lagomUnmanagedServices for cassandra. I changed it like below