## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
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)

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())
.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()))
}

I am able to confirm the following:

• exception is thrown during persist()
• the event is not present in Cassandra
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
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]

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$FSM$processMsg(FSM.scala:701) at akka.actor.FSM$anonfun$receive$1.applyOrElse(FSM.scala:673)
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)
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.

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 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
3 replies
brabo-hi
@brabo-hi
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.
13 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
9 replies
Nikhil Arora
@nikhilaroratgo_gitlab

@ignasi35 I am trying to update from Lagom 1.5.4 to Lagom 1.6.4 and getting errors during cluster formation. In 1.5.4, we added

akka {

remote {
netty.tcp {
hostname = ${KUBERNETES_POD_IP} port =${REMOTING_PORT}
}
}

and it worked. But since artery is now default. Do I have to adde some similar config to make it work?

3 replies
Nikhil Arora
@nikhilaroratgo_gitlab

@ignasi35 I was able to start the cluster but now I see lots of messages like

[thread-application-akka.actor.default-dispatcher-58] [akka.actor.LocalActorRefProvider.Deserialization] [akkaAddress=akka://application@100.70.4.143:2552, kamonSpanId=d92bf43eeec6570f, sourceThread=application-akka.actor.internal-dispatcher-3, akkaSource=akka.actor.LocalActorRefProvider.Deserialization, sourceActorSystem=application, kamonTraceId=50dabe2c14105b5df4203cfe0e1d3848, kamonSpanName=tell(ActorGraphInterpreter, AsyncInput), akkaTimestamp=16:40:48.451UTC] - Resolve (deserialization) of path [system/ddataReplicator/$d#1712639334] doesn't match an active actor. It has probably been stopped, using deadLetters. and [thread-application-akka.actor.default-dispatcher-50] [akka.http.impl.util.StreamUtils$DelayCancellationStage$$anon11] [akkaAddress=akka://application@100.70.4.143:2552, kamonSpanId=136be1e6e5cdd9a6, sourceThread=application-akka.actor.default-dispatcher-50, akkaSource=StreamUtilsDelayCancellationStage$$anon\$11(akka://application), sourceActorSystem=application, kamonTraceId=4853603745c8559796677d5e92fbd153, kamonSpanName=tell(ActorGraphInterpreter, AsyncInput), akkaTimestamp=16:40:49.244UTC] - Delaying cancellation for 1 minute

Any idea where I should check ?
These are continuously repeating. On the other hand other cluster with 1.5.x is quite stable.

3 replies
Nikhil Arora
@nikhilaroratgo_gitlab
@ignasi35 I created https://discuss.lightbend.com/t/lagom1-6-4-reason-for-debug-messages-resolve-deserialization-of-path-and-delaying-cancellation-for-1-minute/7274 . I would be thankful if you spare some time and can help me out on this. Thank in advance.
javierfvargas
@javierfvargas
Hi guys, I wonder how could I personalize how Json Parsing errors are logged in Lagom. I have a set of sensors sending data and being able to add more information to serialization errors would be of great help to diagnose potential misbehaviours in our sensor. I'd like to be able to print at least some excerpt of the message that failed to parse and the parameter in the path of the request. Any clue would be muh appreciated!