Search code examples
scalaelasticsearchcassandraapache-kafkalagom

com.lightbend.lagom.internal.broker.kafka.KafkaSubscriberActor


I am new to lagom,elasticsearch,I am using lagom,elasticsearch,scala and cassandra.Everything is fine but when i post json data through postman,data go to cassandra but not to the elasticsearch and I am getting an error a warning and as below

12:22:10.688 [error] com.lightbend.lagom.internal.broker.kafka.KafkaSubscriberActor [sourceThread=search-impl-application-akka.actor.default-dispatcher-5, akkaTimestamp=06:52:10.688UTC, akkaSource=akka.tcp://[email protected]:51584/user/KafkaBackoffConsumer1-customerTopic/KafkaConsumerActor1-customerTopic, sourceActorSystem=search-impl-application] - Topic subscription interrupted due to failure: [java.lang.IllegalStateException: Service elastic-search was not found by service locator] 12:22:10.688 [error] akka.actor.OneForOneStrategy [sourceThread=search-impl-application-akka.actor.default-dispatcher-5, akkaTimestamp=06:52:10.688UTC, akkaSource=akka://search-impl-application/user/KafkaBackoffConsumer1-customerTopic/KafkaConsumerActor1-customerTopic, sourceActorSystem=search-impl-application] - Service elastic-search was not found by service locator java.lang.IllegalStateException: Service elastic-search was not found by service locator at com.lightbend.lagom.internal.client.ClientServiceCallInvoker.$anonfun$doInvoke$4(ClientServiceCallInvoker.scala:75) at scala.util.Success.$anonfun$map$1(Try.scala:251) at scala.util.Success.map(Try.scala:209) at scala.concurrent.Future.$anonfun$map$1(Future.scala:289) at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29) at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44) at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

[warn] com.lightbend.lagom.internal.scaladsl.registry.ServiceRegistryServiceLocator [] - Service name=[elastic-search] was not found. Hint: Maybe it was not registered?

any help??


Solution

  • See https://www.lagomframework.com/documentation/1.4.x/scala/ServiceLocator.html#Communicating-with-external-services for information on configuring the development mode service locator with additional services.

    For example, this is how it's configured in the Online Auction Scala example project:

    // 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")
    

    You'll need to reload your sbt configuration and restart your services for this to take effect.