by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
venkateshzifo
@venkateshzifo
Please someone help me with this. I am planning to upload this in GitHub for the community
Jamal Saad
@slipxnot
Hi, why Lagom is not working with ebean instead of Cassandra as its main event sourcing db and data store?
Vasile Gorcinschi
@vasigorc
One cornerstone thing that I cannot find in Lagom is this. So the framework will provide an unique id for an entity and I can list these ids using read-side. But... how can I create an entity with client supplied data? For example in (this presentation on Lagom)[https://www.youtube.com/watch?v=98FBYrc3720] by Renato I would need to provide a checkingAccountId or savingsAccountId as vals to PersistentEntity as part of its state. This would be a minimal business requirement before being able to interact with such a persistent entity.
4 replies
lapidus79
@lapidus79
What is the best way to unit test schema migrations in Lagom (Java)? I would somehow like to run migration tests but haven't really found any way to perform this? W
4 replies
Nikhil Arora
@nikhilaroratgo_gitlab
does anyone know that how to read this compressed event (lagom.serialization.json.compress-larger-than ) in pgadmin4 client ?
Nikhil Arora
@nikhilaroratgo_gitlab
I mean how does lagom compress the event?
Nikhil Arora
@nikhilaroratgo_gitlab
I have a PROD issue and I need to read the events but they are compressed and stored in bytea format in Postgresql. Is there any way I can decompress and read the events?
Ignasi Marimon-Clos
@ignasi35
The events in the database are only compressed if the Array[Byte] of the serialized (uncompressed) event is larger than lagom.serialization.json.compress-larger-than. In any case (compressde or not) the data is stored as a PG BLOB. Reading the uncompressed events is trivial since that is BLOB of a Array[Byte] of a JSON. Reading the compressed ones requires using gunzip. The de/compression in Lagom serializers uses Javaโ€™s GZIP(In|Out)putStream (https://github.com/lagom/lagom/blob/e84c28bbfa27c1f8a13295cf86b6167ce5a441eb/play-json/src/main/scala/com/lightbend/lagom/scaladsl/playjson/PlayJsonSerializer.scala#L183-L217) .
3 replies
Srepfler Srdan
@schrepfler
congrats on 1.6.4!
Ignasi Marimon-Clos
@ignasi35
๐Ÿš€ Lagom 1.6.4 artifacts are out (we're still finishing the release ๐Ÿ˜…)
Srepfler Srdan
@schrepfler
๐Ÿš€๐Ÿš€๐Ÿš€
Robert D. Blanchet Jr.
@blanchet4forte
I'm getting serialization errors using the EventSourcedBehaviorTestkit even though the commands and events I define are setup correctly with a trait that is registered in serialization bindings.
Not sure how to proceed.
Vasile Gorcinschi
@vasigorc
Based on the currently supported JDK versions is it fair to assume that no new versions would be supported until JDK 17 (i.e. next LTS)?
malrawi
@malrawi

I just started with Lagom & Akka. I am following the design described in Domain Modeling with Akka Persistence Typed

I am trying to create a brand new instance of an entity (EntityState). But the event is not getting persisted, and I am getting the following error:

00:54:27.862 [error] com.example.impl.entity.EntityClass [persistencePhase=running-cmd, akkaAddress=akka://XXX@127.0.0.1:60685, akkaSource=akka://XXX/system/sharding/StateClass/186/ID1, sourceActorSystem=XXX, persistenceId=StateClass|ID1] - Supervisor StopSupervisor saw failure: null
java.lang.NullPointerException: null
at akka.persistence.typed.javadsl.EventSourcedBehavior.$anonfun$apply$4(EventSourcedBehavior.scala:195)
at akka.persistence.typed.internal.Running$RunningState.applyEvent(Running.scala:78)
at akka.persistence.typed.internal.Running$HandlingCommands.applyEffects(Running.scala:153)
at akka.persistence.typed.internal.Running$HandlingCommands.onCommand(Running.scala:123)
at akka.persistence.typed.internal.Running$HandlingCommands.onMessage(Running.scala:105)
at akka.persistence.typed.internal.Running$HandlingCommands.onMessage(Running.scala:100)
at akka.actor.typed.scaladsl.AbstractBehavior.receive(AbstractBehavior.scala:83)

I have a Create command, which invokes onCreate(), and eventually attempts to persist an EntityCreated event.

Service Impl method

@Override
public ServiceCall<CreateMessage, StateView> createState(){
    return message ->
            entityRef(message.getName())
                    .<EntityClass.Accepted>ask(replyTo -> new EntityClass.Create(message, replyTo), askTimeout)
                    .thenApply(accepted -> toStateView(accepted.getSummary()));
}

Command handler:

private ReplyEffect<Event, StateClass> onCreate(StateClass state, Create cmd) {
    return Effect()
            .persist(new EntityCreated(cmd.getDetails().getName(), Instant.now()))
            .thenReply(cmd.replyTo, e -> new Accepted(EntityClass.toSummary(e)));
}

I am able to confirm the following:

  • exception is thrown during persist()
  • the event is not present in Cassandra
    Your help is appreciated. Thank you in advance!
1 reply
sparlampe
@sparlampe
Hi all, I am trying to figure out how to activate OpenTracing with Zipkin in a lagom app. I have adjusted the official shopping-cart sample app according to Lightbend Telemetry documentation but there are not traces to be found in Zipkin. Could somebody please give me a pointer here?
The adjustments can be inspected in the following commit:
https://github.com/sparlampe/lagom-samples/commit/2ae91703d3571ad0004f2410fbaa0fea9ecf2668
2 replies
Robert D. Blanchet Jr.
@blanchet4forte

Using Lagom w/ Akka Typed. What is the preferred method for passing cake dependencies to a clustered actor? Is it fine to do something like this in the app loader?

  lazy val someService = ... // some api/service from application loader cake
  clusterSharding.init(
    Entity(ShoppingCart.typeKey) { entityContext =>
      ShoppingCart(entityContext, someService)
    }
  )

Another option I can think of is to create some kind of Behavior wrapper. Like Behaviors.withService but I don't know how I'd get a reference to the particular service. If anyone has ideas.

Arsene
@Tochemey
Hello does anyone know how to fix this issue I have defined a field in the service trait and inject it via macwire. However I am getting
https://github.com/lagom/lagom/blob/3a5bd80946fdd8a81fca0c30482d1ac47c42b751/service/scaladsl/client/src/main/scala/com/lightbend/lagom/internal/scaladsl/client/ScaladslClientMacroImpl.scala#L48-L52
This is a sample:
trait Service {
  def field: Field
.....

class ServiceImpl(val field: Field) extends Service
5 replies
brabo-hi
@brabo-hi
I am having this issue when running lagom on Mac BigSur
java.lang.NoClassDefFoundError: Could not initialize class io.methvin.watchservice.jna.CarbonAPI
5 replies
lapidus79
@lapidus79
anyone familiar with the following error (quite common when running tests against h2 database). Everything seems to be working fine, but the stacktraces are quite annoying
com.lightbend.lagom.internal.javadsl.persistence.PersistentEntityActor - Persistence failure when replaying events for persistenceId [XXXX]. Last known sequence number [0]
        org.h2.jdbc.JdbcSQLDataException: Numeric value out of range: "9223372036854775807" in column ; SQL statement:
        select "ordering", "deleted", "persistence_id", "sequence_number", "message", "tags" from "journal" where ((("persistence_id" = ?) and ("deleted" = false)) and ("sequence_number" >= ?)) and ("sequence_number" <= ?) order by "sequence_number" limit ? [22004-200]
Andrey Ladniy
@AndreyLadniy

I can't figure out when I add pac4j-http 4.0.x dependency in my lagom project, it breaks with

[error] java.lang.RuntimeException: No main class detected.
[error]     at scala.sys.package$.error(package.scala:30)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
[error] (Compile / bgRun) No main class detected.

with pac4j-http 3.8.x dependency all is fine. Why can this happen?

Nikhil Arora
@nikhilaroratgo_gitlab
during rolling updates on kubernetes running on Amazon, my app fails with error
2020-09-10 12:31:05.602 [thread-application-akka.actor.default-dispatcher-3] [akka.remote.EndpointWriter] [sourceThread=application-akka.remote.default-remote-dispatcher-44, akkaTimestamp=12:31:05.601UTC, akkaSource=akka.tcp://application@100.64.72.148:2552/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fapplication%40100.64.57.57%3A2552-1/endpointWriter, sourceActorSystem=application] - AssociationError [akka.tcp://application@100.64.72.148:2552] -> [akka.tcp://application@100.64.57.57:2552]: Error [Association failed with [akka.tcp://application@100.64.57.57:2552]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://application@100.64.57.57:2552]
Caused by: java.util.concurrent.TimeoutException: No response from remote for outbound association. Associate timed out after [15000 ms].
at akka.remote.transport.ProtocolStateActor
KaTeX parse error: Can't use function '$' in math mode at position 8: anonfun$̲2.applyOrElse(A…: anonfun$2.applyOrElse(AkkaProtocolTransport.scala:425)
    at akka.remote.transport.ProtocolStateActor
anonfun$2.applyOrElse(AkkaProtocolTransport.scala:395)
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
at akka.actor.FSM.processEvent(FSM.scala:707)
at akka.actor.FSM.processEvent$(FSM.scala:704)
at akka.remote.transport.ProtocolStateActor.processEvent(AkkaProtocolTransport.scala:327)
at akka.actor.FSM.akka$actor$FSMprocessMsg(FSM.scala:701)atakka.actor.FSMprocessMsg(FSM.scala:701) at akka.actor.FSManonfun$receive$1.applyOrElse(FSM.scala:673)
at akka.actor.Actor.aroundReceive(Actor.scala:539)
at akka.actor.Actor.aroundReceive$(Actor.scala:537)
at akka.remote.transport.ProtocolStateActor.aroundReceive(AkkaProtocolTransport.scala:327)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:612)
at akka.actor.ActorCell.invoke(ActorCell.scala:581)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268)
at akka.dispatch.Mailbox.run(Mailbox.scala:229)
at akka.dispatch.Mailbox.exec(Mailbox.scala:241)
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)
Does anyone know why this is happening. The app starts normally but when I do rolling updates, I get these messages in all pods.
36 replies
tthanhsang
@tthanhsang
I wonder if someone could clarify the difference between Lagom readside processor and akka projection.
Arsene
@Tochemey
@tthanhsang lagom readside processor is mainly tie to lagom. However the same concept has been enhanced into a solid library that can help you use it in any akka based system.
So you can see lagom readside processor as an Akka projection bundled with lagom
You can ignore lagom readside processor and use Akka Projection which I have been doing a while now.
2 replies
Domantas Petrauskas
@dope9967

Note: the only limitation when migrating from from Lagom Persistence (classic) to Akka Persistence Typed is that a full cluster shutdown is required. Even though all durable data is compatible, Lagom Persistence (classic) and Akka Persistence Typed canโ€™t coexist.

Does this mean that same type of entity can't run on both Lagom classic and Akka Typed implementations, or that whole service has to either have Lagom classic or Akka Typed entities? I have a service with multiple entites, and one of them would benefit from some of the Akka Typed features, was wondering if I'll have to migrate all of them.

1 reply
Pawel
@odwrotnie
How can I force Lagom to return full description of the Exceptions on production?
4 replies
Shubham Girdhar
@girdharshubham
Hi @all
I'm using Lagom version 1.6.3 with mixed persistence. I took reference from the lagom-samples repo. Here's my conf
lagom {

  cluster.exit-jvm-when-system-terminated = on

  persistence {
    jdbc {
      create-tables.auto = true
    }
  }
}
ludington.postgres {
  host = ${?POSTGRES_HOST}
  database = ${?POSTGRES_DATABASE}
  user = ${?POSTGRES_USER}
  password = ${?POSTGRES_PASSWORD}
}

ludington.postgres {
  host = ${?POSTGRES_HOST}
  database = ${?POSTGRES_DATABASE}
  user = ${?POSTGRES_USER}
  password = ${?POSTGRES_PASSWORD}
}


db.default {
  driver = "org.postgresql.Driver"
    url = ${?POSTGRES_URL}
  username = ${ludington.postgres.user}
  password = ${ludington.postgres.password}
}

jdbc-defaults.slick.profile = "slick.jdbc.PostgresProfile$"


cassandra.default {
  ## list the contact points here
  host = ${?GLOBAL_CASSANDRA}
  contact-points = [${cassandra.default.host}]
  port = 9042
  port = ${?CASSANDRA_PORT} 
  keyspace = ${?CASSANDRA_JOURNAL_KEYSPACE}
  ## override Lagomโ€™s ServiceLocator-based ConfigSessionProvider
  session-provider = akka.persistence.cassandra.ConfigSessionProvider
}

cassandra-journal {
  keyspace = ${cassandra.default.keyspace}
  contact-points = ${cassandra.default.contact-points}
  session-provider = ${cassandra.default.session-provider}
  port = ${cassandra.default.port}
}

cassandra-snapshot-store {
  keyspace = ${cassandra.default.keyspace}
  contact-points = ${cassandra.default.contact-points}
  session-provider = ${cassandra.default.session-provider}
  port = ${cassandra.default.port}
}

akka.persistence {
  journal {
    plugin = cassandra-journal
  }

  snapshot-store {
    plugin = cassandra-snapshot-store
  }
}
And mixed persistence isn't working out as expected
abstract class Application(context: LagomApplicationContext)
  extends LagomApplication(context)
    with ReadSideJdbcPersistenceComponents
    with HikariCPComponents
    with WriteSideCassandraPersistenceComponents
    with AhcWSComponents
    with LagomKafkaClientComponents
I guess the readside is still waiting for messages in Postgres
Because when I changed the whole set up to persist events in PG, it worked like a charm. Is there something that I'm missing?
Shubham Girdhar
@girdharshubham
@all
Nikhil Arora
@nikhilaroratgo_gitlab
Could someone explain why leader cannot make decision when one of the nodes is in Unreachable state. It's written everywhere that convergence cannot be reached. But why leader cannot make decision is not mentioned anywhere. What happens if Leader is allowed to take the decision. What is the impact?
Ignasi Marimon-Clos
@ignasi35
:point_up: September 17, 2020 5:33 PM this is a very intesting question but itโ€™s a bit specific to Akka Cluster. I think a perfect place for this question (with wider audience) is https://discuss.lightbend.com/
brabo-hi
@brabo-hi
Hi all, i have a question: why is lagom always based on old version of akka-persistence-cassandra ? The lagom version 1.6.4 is using cassandra-persistence version 0.100 ? How can we update it to the latest one, currently 1.0.x
2 replies
brabo-hi
@brabo-hi
according to this link can we mix WriteSideSlickPersistenceComponents and ReadSideCassandraPersistenceComponents ??
1 reply
Pawel
@odwrotnie
I have tried everything and still getting Service app was not found by service locator Exception :(
4 replies
Pawel
@odwrotnie
Pleeease, help me!
Srepfler Srdan
@schrepfler
how are we looking with the migration to test-containers?
Nikhil Arora
@nikhilaroratgo_gitlab
@ignasi35 I am running a Lagom App in prod and start 3 pods in the cluster. Everything worked fine for a month and now 1 App started to consume more heap compared to others and was reaching the limit of the max heapSize, Major GC was not able to free up the resources, so I restarted this app. The issue got fixed in that pod. Now, another node in the cluster has started to show the same behaviour. could it be that Lagom framework internals are using more heap? How much memory does the cache of ShardCoordinator consume ? I know this is difficult to answer. It's difficult to say if there is problem in Application code as the memory heap pattern is exactly same and also I know lagom has been throughly battle tested.
9 replies
Nikhil Arora
@nikhilaroratgo_gitlab
What is the minimum JVM footprint used by the cluster and Lagom?
Domantas Petrauskas
@dope9967
Is there some approximate date for when Lagom 1.7 will be out? Is https://github.com/lagom/lagom/milestone/63 up to date?
Nikhil Arora
@nikhilaroratgo_gitlab
Is there any built in async Http client in Lagom which also allows metrics monitoring via prometheus? I found one here https://www.playframework.com/documentation/2.8.x/JavaWS , but don't know how to get metrics and if this is the right one to use in lagom. Thanks for any hints.
2 replies
Nikhil Arora
@nikhilaroratgo_gitlab
By right I mean its from play framework so should be right, But is there any other opinionated way ?
Steven Matison
@ds-steven-matison
Good Morning, my name is Steven from DataStax. We have been working internally with lagom and Astra (cassandra database as a service) and are wondering what it will take to get lagom master branch to cassandra 3.8 driver? This is a simple 1 line change from the current version of embedded cassandra which then makes connecting to astra easy. We have also made progress as far as 4.x driver, but this is a larger codebase change. Would love to open dialouge with interested parties. TIA