Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
lapidus79
@lapidus79
How exactly is the event serialized?
@schrepfler:matrix.org do you use Lagom 1.6.5?
1 reply
Levi Ramsey
@leviramsey
IIRC, in Lagom, there are at least some cases where it gzips json for persistence (or at least it supports doing that)
lapidus79
@lapidus79
@leviramsey It seems that what I have is basically hex, however when decoding both the beginning and the end of the dataset looks strange..
Is the actual event payload somehow wrapped in somekind of object containing metadata?
lapidus79
@lapidus79
Hmm seems that the message column is not only the serialized json of the actual EntityEvent object but also contains metadata such as the full EntityEvent class name
lapidus79
@lapidus79
We’ve gone with making the generic Confirmation<T> that extends Reply<T> (which we took out of the samples, so I’m puzzled how come other people didn’t notice it as well) to concrete ConfirmationConcreteReplyClass and that solved our issue. Not ideal but decided to go with it rather that block the project.
Michael Ahlers
@michaelahlers
I know you can safely not emit messages to a Topic from an entity's events, but is it safe to emit more than one for each event? If there's a definitive answer for this in the documentation, I'm missing it. :sweat_smile:
rfkeith
@rfkeith
Hello, can anyone suggest how I would broadcast a command to a list of persistent entities in Lagom. I know their actors under the hood so was hoping I could do something with an ActorSelection but wanted to know if Akka Persistence Typed provided a more idiomatic way of achieving this?
10 replies
Kyle Florence
@solarmosaic-kflorence
I'm using Akka Persistence Typed for the first time in a new service that's being used in integration tests. When I start up the service, I get an error: Caused by: javax.naming.NameNotFoundException: DefaultDB not found -- it seems that I have to make a non-lazy reference to persistentEntityRegistry to make this error go away, but the Lagom 1.6.x docs don't seem to indicate I need to use this anymore anywhere (previously I remember having to do persistentEntityRegistry.register(entity)) -- is that still needed even though it's missing from the docs? https://www.lagomframework.com/documentation/1.6.x/scala/UsingAkkaPersistenceTyped.html -- note that I do see the persistentEntityRegistry being included in the service impl class on that page, but since I never needed it in my service I didn't put it there.
2 replies
Dheeraj Karande 🇮🇳
@dheerajkarande_twitter
how can i get the ip address from where the request is send
Sriram Sundharesan
@sriramsundhar
hey!! am new to lagom.. am trying to use it in GCP with pub-sub as message broker... is there any example or samples I can look into?
schrepfler
@schrepfler:matrix.org
[m]
did anyone notice any issues with akka-management http endpoint not starting up, maybe on latest lagom, 1.6.5?
schrepfler
@schrepfler:matrix.org
[m]
found it, wasn't binding to 0.0.0.0 so localhost curl was failing
Simiil
@Simiil
Hi, I just ran into the problem that the first-time-bucket is set too far back. After looking through the logs and the offset-store tables, it seems that some parts always use this timestamp. I built a small service that has an entity with tagged events , a read side, and defines a topic. After adding some events and restarting the services, there is always at least one line in the logs like: starting with EC delay 0ms: fromOffset [51e38000-b8fe-11eb-8080-808080808080 (2021-05-20 00:00:00:000)] toOffset [None] (the time is my currently configured first-time-bucket). I am curious what part of lagom causes this, and why there is no correct offset is used. Can you explain this behaviour?
1 reply
schrepfler
@schrepfler:matrix.org
[m]
the reference documentation is kind of exclusive on how to package lagom between sbt or maven. In our case we use maven to build our system but were not quite happy with how we could build/dockerize our apps so a hybrid way is possible, add a separate sbt project which simply references the -impl services and uses the LagomJava plugin to build the universal packages
lazy val aService = (project in file("s"))
  .enablePlugins(LagomJava)
  .settings(
    resolvers += ...,
    maintainer += ...,
    libraryDependencies ++= Seq(
      "..." % "...-impl" % "..."
    )
  )
Sriram Sundharesan
@sriramsundhar

Not able to use external kafka in local or in prod mode..
lagom: 1.6
java: 11
my kafka config

lagom {
  broker.defaults.kafka {
    brokers = "localhost:9093"
    brokers = ${?KAFKA_BROKERS}
  }
}

lagom.broker.kafka {
  service-name = ""
  service-name = ${?KAFKA_SERVICE_NAME}
  brokers = ${lagom.broker.defaults.kafka.brokers}
  client {
    default {
      offset-timeout = 5s
      failure-exponential-backoff {
        min = 3s
        max = 30s
        random-factor = 0.2
      }
    }
    producer = ${lagom.broker.kafka.client.default}
    producer.role = ""
    consumer {
      offset-timeout = ${lagom.broker.kafka.client.default.offset-timeout}
      failure-exponential-backoff = ${lagom.broker.kafka.client.default.failure-exponential-backoff}
      offset-buffer = 100
      batching-size = 20
      batching-interval = 5 seconds
      batching-parallelism = 3
    }
  }
}

error seen

10:01:52.158 [warn] org.apache.kafka.clients.NetworkClient [] - [Consumer clientId=sdmordershub-1, groupId=sdmordershub] Connection to node 2147483546 (/127.0.0.1:9092) could not be established. Broker may not be available.
10:01:53.163 [warn] org.apache.kafka.clients.NetworkClient [] - [Consumer clientId=sdmordershub-1, groupId=sdmordershub] Connection to node 101 (/127.0.0.1:9092) could not be established. Broker may not be available.
10:01:54.227 [warn] org.apache.kafka.clients.NetworkClient [] - [Consumer clientId=sdmordershub-1, groupId=sdmordershub] Connection to node 101 (/127.0.0.1:9092) could not be established. Broker may not be available.
5 replies
Per Wiklander
@PerWiklander
Given a new Scala project that will use Akka Typed, Akka Persistence, Akka Cluster etc, what does Lagom give me today over pure Akka? I know what the value of Lagom was say five years ago, but now a lot of the new stuff has trickled down into Akka. In the Lagom cake It's hard to see where one layer ends and the next one begins. So I’m trying to figure out if I still need it.
3 replies
schrepfler
@schrepfler:matrix.org
[m]
I quite like the module system that's part of Lagom
2 replies
Pawel
@odwrotnie

I can not resolve the issue, please help!

While subscribing to topic:

itemsService.eventsTopic.subscribe
    .atLeastOnce {
      Flow[ItemsEventApi].map {...

From time to time it is throwing this exception:

2021-07-12 07:43:38,642 ERROR com.lightbend.lagom.internal.broker.kafka.KafkaSubscriberActor - Topic subscription interrupted due to failure: [org.apache.kafka.common.errors.SerializationException: Error deserializing key/value for partition instap-items-0 at offset 1. If needed, please seek past the record to continue consumption.]
2021-07-12 07:43:38,643 ERROR akka.actor.OneForOneStrategy - Error deserializing key/value for partition instap-items-0 at offset 1. If needed, please seek past the record to continue consumption.
org.apache.kafka.common.errors.SerializationException: Error deserializing key/value for partition instap-items-0 at offset 1. If needed, please seek past the record to continue consumption.
Caused by: com.lightbend.lagom.scaladsl.api.transport.DeserializationException: JsResultException(errors:List((,List(JsonValidationError(List(error.invalid),List())))))

It is nondeterministic - from time to time it is working very well so this is not an Serialization issue...

1 reply
schrepfler
@schrepfler:matrix.org
[m]
guys, I'm creating a cluster of three nodes which have a kafka topic subscriber, I've noticed they all have the same client-id, concretely event-1 on the different nodes. Is this something that can/should be overridden via config?
events-service-5457d6f978-trhn2 events-service 12:05:33.508 [r-93] [info] o.a.k.c.c.i.AbstractCoordinator [] - [Consumer clientId=event-1, groupId=event] Successfully joined group with generation 114753
events-service-5457d6f978-p7n2k events-service 12:05:33.536 [-105] [info] o.a.k.c.c.i.AbstractCoordinator [] - [Consumer clientId=event-1, groupId=event] Successfully joined group with generation 114753
events-service-5457d6f978-kmr2c events-service 12:05:33.575 [r-33] [info] o.a.k.c.c.i.AbstractCoordinator [] - [Consumer clientId=event-1, groupId=event] Successfully joined group with generation 114753
3 replies
schrepfler
@schrepfler:matrix.org
[m]
I've looked at the code, there's a bit of internals that set the client id automatically as appName-${counter} which is inited to 1. Not sure why it's not incrementing even though in the code it does some logic around that, but even so, I don't see how it would work as part of a cluster
I'm seeing some rebalancing and it's difficult to understand what might be causing this, is it a kafka problem or app problem...
events-service-5fc67b974c-q7rbd events-service 08:40:13.727 [r-75] [info] o.a.k.c.c.i.AbstractCoordinator [] - [Consumer clientId=event-1, groupId=event] Attempt to heartbeat failed since group is rebalancing
events-service-5fc67b974c-q7rbd events-service 08:40:13.727 [r-75] [info] o.a.k.c.c.i.ConsumerCoordinator [] - [Consumer clientId=event-1, groupId=event] Revoke previously assigned partitions
events-service-5fc67b974c-q7rbd events-service 08:40:13.727 [r-75] [info] o.a.k.c.c.i.AbstractCoordinator [] - [Consumer clientId=event-1, groupId=event] (Re-)joining group
schrepfler
@schrepfler:matrix.org
[m]
if a lagom app has a 3rd party kafka subscriber, should all apps in the cluster start the consumer or it should execute only on one of the nodes?
I haven't seen in the docs how to pin the subscription to one particular node (and how would that work for an elastic cluster in k8s?)
Levi Ramsey
@leviramsey
The Kafka client ID is a logical name; it can be the same for multiple consumers
The consumer ID (typically the client ID plus a UUID) needs to be unique
schrepfler
@schrepfler:matrix.org
[m]
yup, that's less of a concern now, it's the rebalancing which is puzzling
2 replies
Gabriel Harris-Rouquette
@gabizou
I'm creating a set of services in Java with Lagom and I'd like to know if it's safe to try and use akka typed actors in lieu of the classic actors as the lagom guides currently explain. Specifically, I have a various series of other tasks that are parallelizable individually and I was hoping to experiment with using actors to do said work, but my biggest question overall is "Can I make use of Akka Typed Actors w/ Lagom?"
1 reply
Scalix
@akahanek
Hi, I am using the JDBC read side with Lagom 1.6.5 and Akka Typed Persistence. The serialization of events to the event journal is done in binary format, which has been repaired to plain text json in Akka Persistence JDBC plugin version 5.0.1. I would like to use the 5.0.1 plugin, but I do not know, how to use this plugin with Lagom 1.6.5. I have tried this (https://discuss.lightbend.com/t/how-to-use-akka-persistence-jdbc-plugin-5-0-1-with-lagom-1-6-5/8503), but with no success. Does anybody here have some hints, where to start, please?
cmolinah
@cmolinah
Hi, is it possible to use slick for read side in Java? I am not able to find the equivalent for this scala doc: https://www.lagomframework.com/documentation/1.5.x/scala/ReadSideSlick.html
2 replies
Guido Contreras Woda
@guiwoda
Hi! I'm starting a couple of services in Lagom and I need to configure unmanaged services to call to from these new services. I've found some documentation that says I need to create a Service with a Descriptor for the unmanaged service, then another documentation talks about the ServiceLocator class. Could anyone point me to an example or a tutorial that can help me?
Thanks!
greatmengqi
@greatmengqi
hello everyone! I have a question about lagom. what the use of describeService method from LagomApplicationLoader ?
greatmengqi
@greatmengqi
hello
SynappsGiteau
@SynappsGiteau

Hello,
When upgrading my Lagom version from 1.6.1 to 1.6.5, I get a runtime error when querying apis:

play.api.http.DefaultHttpErrorHandler [] - Error while handling error
java.lang.ClassCastException: sbt.internal.inc.MappedVirtualFile cannot be cast to java.io.File
        at com.lightbend.lagom.sbt.run.RunSupportCompat.$anonfun$sourceMap$1(RunSupportCompat.scala:74)
        at scala.collection.MapLike$MappedValues.get(MapLike.scala:260)
        at com.lightbend.lagom.dev.Reloader.$anonfun$findSource$1(Reloader.scala:389)
        at scala.Option.flatMap(Option.scala:271)
        at com.lightbend.lagom.dev.Reloader.findSource(Reloader.scala:388)
        at play.core.server.LagomReloadableDevServerStart$$anon$1$$anon$2.sourceOf(LagomReloadableDevServerStart.scala:186)
        at play.core.SourceMapper.$anonfun$sourceFor$1(ApplicationProvider.scala:21)
        at play.core.SourceMapper.$anonfun$sourceFor$1$adapted(ApplicationProvider.scala:21)
        at scala.collection.IndexedSeqOptimized.$anonfun$find$1(IndexedSeqOptimized.scala:53)
        at scala.collection.IndexedSeqOptimized.$anonfun$find$1$adapted(IndexedSeqOptimized.scala:53)
        at scala.collection.IndexedSeqOptimized.segmentLength(IndexedSeqOptimized.scala:198)
        at scala.collection.IndexedSeqOptimized.segmentLength$(IndexedSeqOptimized.scala:195)
        at scala.collection.mutable.ArrayOps$ofRef.segmentLength(ArrayOps.scala:198)
        at scala.collection.GenSeqLike.prefixLength(GenSeqLike.scala:98)
        at scala.collection.GenSeqLike.prefixLength$(GenSeqLike.scala:98)
        at scala.collection.mutable.ArrayOps$ofRef.prefixLength(ArrayOps.scala:198)
        at scala.collection.IndexedSeqOptimized.find(IndexedSeqOptimized.scala:53)
        at scala.collection.IndexedSeqOptimized.find$(IndexedSeqOptimized.scala:52)
        at scala.collection.mutable.ArrayOps$ofRef.find(ArrayOps.scala:198)
        at play.core.SourceMapper.sourceFor(ApplicationProvider.scala:21)
        at play.core.SourceMapper.sourceFor$(ApplicationProvider.scala:20)
        at play.core.server.LagomReloadableDevServerStart$$anon$1$$anon$2.sourceFor(LagomReloadableDevServerStart.scala:184)
        at play.api.http.HttpErrorHandlerExceptions$.$anonfun$convertToPlayException$1(HttpErrorHandler.scala:379)
        at scala.Option.flatMap(Option.scala:271)
        at play.api.http.HttpErrorHandlerExceptions$.convertToPlayException(HttpErrorHandler.scala:379)
        at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:373)
        at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:264)
        at play.core.server.Server$$anonfun$handleErrors$1$1.applyOrElse(Server.scala:109)
        at play.core.server.Server$$anonfun$handleErrors$1$1.applyOrElse(Server.scala:105)
        at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
        at play.core.server.Server$.getHandlerFor(Server.scala:129)
        at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:317)
        at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:224)
        at akka.stream.impl.fusing.MapAsync$$anon$30.onPush(Ops.scala:1297)

Lagom 1.6.5
Scala 2.12.13
Sbt 1.4.7
Java 8 (same problem when compiling/running on Java 11)

Thank you for your help.

1 reply
Bartosz Kumorek
@Randerspl

Hello i have a question about ServiceCall composition.
For example when writing composition for authentication i want to add response header (for example "Set-Cookie" to refresh after successfull authentication).
I found function handleResponseHeader that i can use on serviceCall but this function wants only T type as result without header. Can i edit response header here or i need to pass parameters to serviceCall function and set header for every ServerServiceCall below which uses this function?

Below example code:

ServerServiceCall.composeAsync { requestHeader =>
    val user:Option[User] = getUser()
    if(user.isDefined){
        serviceCall( user ) // here i would like to add header
    }else{
        throw Forbidden("You cannot")
    }
}
Gabriel Harris-Rouquette
@gabizou
Eder Ruiz
@drrzmr
Hello, I have a question about Content-Type. I do a simple request using curl without content-type, and I see in ServerServiceCall the content-type: application/octet-stream, I'm tring use a message serializer that use a json serializer/deserializar for requests that not pass the content-type (there are a client that do this :/). I think that is possible to use json for octet-stream, but it's a ugly solution in my opinion. There are somo way to configure lagom to not overwrite a empty content-type request?
1 reply
ldeck
@ldeck
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
@michaelahlers
@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.
ldeck
@ldeck
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.
sfsmicm
@sfsmicm
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
@sriramsundhar

hey.. When I try a subscribe only service as mentioned here
https://www.lagomframework.com/documentation/1.6.x/java/KafkaClient.html#Subscriber-only-Services
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
@leviramsey
This message was deleted
1 reply
Jeremy Pollock
@jpollock
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!
Boon
@laiboonh

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

Boon
@laiboonh
Things worked after i took out cassandra dependency...Mind Blown! Having unused dependency shouldn't matter
libraryDependencies ++= Seq(
//      lagomScaladslPersistenceCassandra,
      lagomScaladslKafkaBroker,
      lagomScaladslTestKit,
      macwire,
      scalaTest,
      lagomScaladslPersistenceJdbc,
      postgres
    )