Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Hi all — (newby) our of interest, what might be the usual cadence of releases for lagom? I notice the last release seemed to be 2019. Is it still actively moving forward?
Michael Ahlers
@ldeck, as a long-time Lagom user, I’ve wondered that myself. Lightbend, last I checked, seems to have stripped all mention of Lagom (and Play) from its site with all emphasis on Akka. Of course, Lagom is an opinionated amalgamation of various Akka projects, all of which are actively maintained and supported.
Thanks @michaelahlers. Good to know. Be nice, of course, to know if it’s still part of their strategy as it appears to be a very nice opinionated framework.
I'm also very concerned about the release frequence of lagom - especially if i look at the contributions in gitlab: https://github.com/lagom/lagom/graphs/contributors
Would be nice the hear a statement of lightbend about the future of lagom.
Sriram Sundharesan

hey.. When I try a subscribe only service as mentioned here
I see this..

1) No implementation for com.lightbend.lagom.javadsl.persistence.PersistentEntityRegistry was bound.
  while locating com.lightbend.lagom.javadsl.persistence.PersistentEntityRegistry
    for the 4th parameter of com.lightbend.lagom.internal.javadsl.persistence.ReadSideImpl.<init>(ReadSideImpl.scala:39)
  at com.lightbend.lagom.javadsl.persistence.PersistenceModule.bindings(PersistenceModule.scala:20):
Binding(class com.lightbend.lagom.internal.javadsl.persistence.ReadSideImpl to self) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$4)

1 error
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:554)
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:161)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:108)
    at com.google.inject.Guice.createInjector(Guice.java:87)
    at com.google.inject.Guice.createInjector(Guice.java:78)
    at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:200)

am I missing something?

1 reply
Levi Ramsey
This message was deleted
1 reply
Jeremy Pollock
Hi! Jeremy Pollock here. I head up product at lightbend. I won’t drop an answer in here quite yet. But I did want to say that I saw the questions and comments and will come back with some directional thoughts from the company. @leviramsey thanks for the YouTube video link; we saw as well and we were scratching our heads as to how that happened. Also, I’m happy to talk to developers using Lagom directly. You can reach me at jeremy.pollock@lightbend.com. Thanks!
1 reply

Hi all. I am a beginner playing with lagom and following the documentation. I tried to experiment replacing cassandra with postgres using JdbcPersistenceComponents. However i get this error on bootup and when calling the service

07:40:33.865 [error] hello [] - Exception in PathCallIdImpl(/api/hello/:id)
akka.pattern.AskTimeoutException: Ask timed out on [EntityRef(EntityTypeKey[org.example.hello.impl.HelloCommand](HelloAggregate), bob)] after [5000 ms]. Message of type [org.example.hello.impl.Hello]. A typical reason for `AskTimeoutException` is that the recipient actor didn't send a reply.

I tried to debug. It seems that after ref.ask[Greeting](replyTo => Hello(id, replyTo)) the aggregate never receive the message.
I ran out of ideas. Can someone help me understand whats wrong? My changes are https://github.com/laiboonh/lagom-hello/commit/6cfb2ffaa8a68baece34fc4519fd8c24172cbb1f#diff-901e3f581fbf1e34ad47779f618f30e0f8afc3e7f645ff665fd353c784cb1f2e

Things worked after i took out cassandra dependency...Mind Blown! Having unused dependency shouldn't matter
libraryDependencies ++= Seq(
//      lagomScaladslPersistenceCassandra,
Guido Contreras Woda
Any design recommendations on how to store authentication state when calling unmanaged services from a lagom service? (i.e. access token from a service login call)
1 reply
how do I change the default actor system name in a Lagom application? I'd like to customise the "sourceActorSystem=application" thing that I see sometimes
[warn] a.s.s.RestartWithBackoffSource [akkaAddress=akka://application@, sourceThread=application-akka.actor.default-dispatcher-15, akkaSource=RestartWithBackoffSource(akka://application), sourceActorSystem=application, akkaTimestamp=10:07:06.606UTC] - Restarting graph due to failure. stack_trace:
I will note that Service.named() is set to something other than "application"
Guido Contreras Woda
How do I spawn an actor with Lagom + Akka typed? I'm using Akka Distributed Data and I don't understand where can I spawn the actor that implements it.
3 replies
Sriram Sundharesan
hey!! we are trying out akka EventSourcedBehaviorWithEnforcedReplies and want to use lightbend telemetry to publish some custom metrics.. but am not find how I can access the akka system... Is there a way I can access akka system or push an ActorRef into EventSourcedBehaviorWithEnforcedReplies implementation?
1 reply
Srepfler Srdan
Hi, I'm trying to stick the akka persistence cassandra Cleanup utility into a Service, I inject the ActorSystem in the constructor but upon invoking at deploy I get an exception saying materializer() doesn't exist on ActorMaterializer
Error injecting constructor, java.lang.NoSuchMethodError: 'akka.stream.ActorMaterializer akka.stream.SystemMaterializer.materializer()'
  at tech.api.impl.MarketsServiceImpl.<init>(MarketsServiceImpl.java:42)
  at com.lightbend.lagom.javadsl.server.ServiceGuiceSupport$LagomServiceBuilder.bind(ServiceGuiceSupport.java:134) (via modules: com.google.inject.util.Modules$OverrideModule -> tech.api.impl.MarketsModule)
  while locating tech.api.impl.MarketsServiceImpl
Caused by: java.lang.NoSuchMethodError: 'akka.stream.ActorMaterializer akka.stream.SystemMaterializer.materializer()'

Hi all! Ive got a question about the lagom-event-streams which are emitted to kafka. Some events were missing - at first i thought that there was a problem with the consumer but i discovered that the missing events had not been published to the topic (but i saw them in the eventstore). I'm using 10 TAGs and today 9 of the TopicProducers had no lag whereas 1 Produced was stalled (i saw this in the read_side_offsets table of persistencejdbc. 9 topics on a offset of about 247xxx... 1 topic still on offset 244xxx).

I searched the logs but could not locate any messages indicating a problem.

The problem itself disappeared when i restarted both nodes of the cluster of this specific persistententity. (unfortunately i missed to check whether the problem resolved after restarting 1 of the 2 nodes).

can anybody drop me a hint what i can do if this problem occurs again?

Srepfler Srdan
What I reported above with no materializer() method, can this be some sort of MiMa issue? It sounds similar to this error akka/akka#25449
Srepfler Srdan
Okay, we copy/pasted Cleanup.scala into our project from akka-persistence-cassandra 0.106 at that point it works, perhaps because akka-persistence-cassandra uses jdk8 and there's some binary compatibility issue?
I need to check who owns it and report upstream
Scott Lyons
So, trying to get back into Akka/Lagom after a few years away. The new project g8 doesn't work, the lagom-sbt-plugin package doesn't seem to exist anywhere
Levi Ramsey
I would honestly suggest looking into Akka Typed (including the typed variants of Persistence and Cluster Sharding... combined, they're kind of a different spin on a lot of Lagom ideas), which (being the backbone of Akka Serverless) likely has a bit more of a future than Lagom
1 reply
(and doesn't rely on build-system plugins)
Scott Lyons
Much obliged! I figured out the issue as being a Scala/Java version mismatch
Hi all on a lagom service, how to handle unknown http path? it always return play framework Action Not Found response. I would like to customise the response
Robert D. Blanchet Jr.

For Lagom service descriptor can I have an endpoint with a query string parameter that is defaulted to a value or do I have to specify it as Option?
eg. can I do this?

trait MyService extends Service {
   def myEndpoint(foo: String, bar: String = "someValue")

   override def descriptor: Descriptor = {
      // ....
      restCall(Method.GET, "whatever/:foo?bar", myEndpoint _)

And call it like this: myService/whatever/test

1 reply
Bartosz Kumorek
im getting errors when building in Intellij that on lagom 1.6.7 scala-java8-compat is suspected to be bnary incompatible.
1 reply
I should be worried or ignore this? Compiling via sbt is ok.
Hey everyone! I've noticed a error in some of our Lagom 1.5 builds where it seems the sbt plugin artifact isn't available, did a quick search: https://search.maven.org/artifact/com.lightbend.lagom/lagom-sbt-plugin and seems only 1.6 is listed there. Is there an alternative resolver I should add? thanks
Harry Tran

Hello. I have a need to consume from a kafka topic (still within same cluster, but not published via events).

Documentations suggest that I create an ExternalKafkaService with the topic defined in its descriptor, then I can write my subscriber as usual. This works, but I'm just wondering if we have any way to not depending on Lagom for this purpose.

  logger.info("Starting the subscriber")
  externalKafkaService.externalTopic.subscribe.atLeastOnce(Flow[ExternalRequest].mapAsync(1) {
    request =>
      logger.info("Executing {}", request)

If I implement the subscriber like this, I can see the "starting" log on startup, but not the "executing" log when I produce the messages to the topic (works fine if using Lagom way)

  private val consumerSettings = ConsumerSettings(actorSystem, new StringDeserializer, new StringDeserializer)

  logger.info("Starting the subscriber")
    .plainSource(consumerSettings, Subscriptions.topics(ExternalTopic))
    .mapAsync(1)(message => {
      val request = Json.parse(message.value).as[ExternalRequest]
      logger.info("Executing {}", request)

Could you help me understand what is missing in 2nd approach? Is there any preferences/advantages to use Lagom way instead, even if we can make 2nd approach work? (I can change 2nd approach to use commitableSource to achieve the atLeastOnce behaviour later)
Thank you in advance.

2 replies
Sathya R
Hi, I have all my web projects in Play framework. Now, planning to bring in Lagom framework for deployments as it is easy to integrate with Cassandra and Apache Kafka. Can I just import my existing Play projects directly into Lagom? or should I rewrite according to Lagom structure? or atleast, how does things work?
1 reply
hi all: when i switch to lagom 1.6.7 i got a (lagom-internal-meta-project-service-locator / update) found version conflict(s) in library dependencies; some are suspected to be binary incompatible: error
org.scala-lang.modules:scala-java8-compat_2.12:1.0.2 (early-semver) is selected over {0.8.0, 0.9.1, 0.9.1, 0.9.1}
[error] +- com.lightbend.lagom:lagom-akka-management-core_2.12:1.6.7 (depends on 1.0.2)
[error] +- com.lightbend.lagom:lagom-javadsl-jackson_2.12:1.6.7 (depends on 1.0.2)
[error] +- com.lightbend.lagom:lagom-api_2.12:1.6.7 (depends on 1.0.2)
[error] +- com.lightbend.lagom:lagom-dev-mode-ssl-support_2.12:1.6.7 (depends on 1.0.2)
[error] +- com.lightbend.lagom:lagom-scaladsl-play-json_2.12:1.6.7 (depends on 1.0.2)
[error] +- com.lightbend.lagom:lagom-logback_2.12:1.6.7 (depends on 1.0.2)
[error] +- com.lightbend.lagom:lagom-service-registry-client-core_2.12:1.6.7 (depends on 1.0.2)
[error] +- com.typesafe.play:play-ahc-ws-standalone_2.12:2.1.6 (depends on 1.0.2)
[error] +- com.typesafe.play:play_2.12:2.8.11 (depends on 0.9.1)
[error] +- com.typesafe.play:play-streams_2.12:2.8.11 (depends on 0.9.1)
[error] +- com.typesafe.play:play-java_2.12:2.8.11 (depends on 0.9.1)
[error] +- com.typesafe.akka:akka-actor_2.12:2.6.17 (depends on 0.8.0)
using the standard hello world example with no modifications
1.6.5 working finde
1 reply
Bartosz Kumorek

Hello i have a question about lagom topic pubSub and websocket.
For example i have simple endpoint :

def websocket: ServerServiceCall[ NotUsed, Source[ String, NotUsed ] ] =  ServerServiceCall { ( _, _ ) =>
    val topic = pubSub.refFor( TopicId[ TopicMessage ]( "SomeTopic" ) )

    val stream = topic.subscriber.log( "WS", x => {
        log.warn( s"sending WS message $x" )
    } )
    .withAttributes( Attributes.logLevels( onElement = Logging.InfoLevel, onFinish = Logging.WarningLevel ) )

    Future.successful( (ResponseHeader.Ok, stream) )

How to detect that websocket disconnected or ended?
For example i need to detect if WS disconnected and save information about it.
I can see that .log function from akka stream with attributes detects that downstream has ended and logs about it.
I tried handling with .recover{} or via Sink.onComplete but nothing happened.

Any tips?

1 reply
Marin Vila
Hi all, is it possible to set jmx port to lagom? Just trying to make a simple service and tring to see how would i export some simple metrics, at first in runAll. Simply adding those com.sun.management.jmxremote settings to javaOptions doesn't seem to work. Probably missing some scope or something.
Robert D. Blanchet Jr.
I'm trying to run ServiceTest.startServer using ServiceTest.defaultSetup.withJdbc(true) and i'm getting an error "DefaultDB not found". I've got other services that I've written that do this and it works just fine. I've been up and down the configurations and build.sbt and I can't for the life of me figure out what is different
Brian Miller
General question here about this distributed Lagom framework (especially with Kafka in the middle)- and apologies if this is "dumb", but does Lagom not have a mechanism by which it back-propagates statuses to the call originator when there is more than 1 service entity in the chain? (I am not seeing able to find anything in the documentation nor forums about this) or is this left as an "exercise to the reader" to implement a validation check at the originator? or at each party in the chain to check its downstream peer?
Chris Wong
DDD question: my apology if this is not the right channel for this. A customer has multiple accounts and he can deposit, withdraw, and transfer money between accounts. If I make Account an aggregate, how would you model a "transfter money between accounts" use-case? Is Customer a better aggregate with multiple accounts in it and expose deposit/withdraw/transfer API at the Customer aggregate level?
Levi Ramsey
accounts and customer can each be aggregates; "transfer money" can be a saga managed by the customer aggregate
rani chavan
Can anyone please help me with the error which i am getting in lagom -
akka.stream.StreamTcpException: The connection closed with error: Connection reset by peer.
We are fetching huge data ( data size > 700 kb ) but while fetching this data we are getting the above posted .
Can anyone please help me with the above error which we getting for lagom 1.6
Julia Wiliam
всім привіт! Хтось налаштовував паралельні джоби в CircleCI і SimpleCov coverage? https://www.mypennmedicine.ltd/
juan pablo romero
Hi, does anyone know if it’s possible to compile lagom (or even lagom apps) on a mac M1? (and if so, which JDK is recommended?)
I tried with liberica-11.0.17+7 and got this error:
Exception in thread "sbt-socket-server" java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/d_/l31r8jq15_b3chmbhgzvkm600000gn/T/jna--1153855574/jna17675872334345649318.tmp
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2633)
    at java.base/java.lang.Runtime.load0(Runtime.java:768)
    at java.base/java.lang.System.load(System.java:1837)
    at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:947)
    at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:922)
    at com.sun.jna.Native.<clinit>(Native.java:190)
    at com.sun.jna.Pointer.<clinit>(Pointer.java:54)
    at com.sun.jna.Structure.<clinit>(Structure.java:2130)
    at sbt.internal.server.Server$$anon$1$$anon$2.$anonfun$run$1(Server.scala:65)
    at scala.util.Try$.apply(Try.scala:213)
    at sbt.internal.server.Server$$anon$1$$anon$2.run(Server.scala:60)
[warn] sbt server could not start in 10s
1 reply
(I suspect it has to do with the sbt version used: 1.3.3)
Yates Yates
I'm happy to see the issue is soon regulated. Thankful to you for supporting us with the outcome. https://www.cfa-home.com/