Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Sean Farrow
@SeanFarrow
Has anyone had any success importing a Lagom project individual studio code using the Metals extension? All my other projects import fine, but anything using Lagom seem to fail. I’ve even tried with the hello world guide at eight template. I think it has something to do with the SBT plug-in.
Sean Farrow
@SeanFarrow
Hi, if I use the Alpakka Kafka API publish publish messages, would this be considered an internal or external service when consuming them? Are there any examples of both publishing messages using this method and then consuming them in another service? Thanks
SynappsGiteau
@SynappsGiteau
Hello,
I encounter a strange behavior on a kubernetic cluster.
We have 2 Lagom services wich using Akka under the hood (GraphQL gateway and service01 (cassandra write side persistence + slick postgres readside). The gateway makes calls to our service01 using the invoke() method.)
First of all, we note that the first request after restarting the services is very long (about 10 to 15 seconds). Then the following requests take about 500ms.
Then, the time of exection increases proportionally to the time of inactivity of the services (500ms for calls every 1 seconds, 1s for calls every 3 minutes, 5 seconds for calls every 30 min etc...).
After lot of research, we are not able to find any explanation for this behaviour.
Does anyone here have an explanation for this?
3 replies
Srepfler Srdan
@schrepfler
@octonato noticed the announcement of akka persistance jdbc 5.x, will that trickle through to Lago?
Renato Cavalcanti
@octonato:matrix.org
[m]
not yet
it uses a new schema and upgrading Lagom with that will requires users to migrate their data.
we don't have a migration tool yet, so we prefer not to push users into using 5.0.0 yet
however, if you are starting a new Lagom application, you can bump the version to 5.0.0 and that will work fine
Srepfler Srdan
@schrepfler
cool
I don't have an existing app
or anything bothering to migrate gradually
@octonato:matrix.org I'm investigating what are my options if I'd like to go Tapir -> Play and use that as the service interface for Lagom. Is there an example project showing this and does it properly integrate with the event publishing just like the classic lagom service api?
4 replies
SynappsGiteau
@SynappsGiteau
Hello everyone, is there a way to manually reset the offset of a kafka subscriber without stopping the full service? org.apache.kafka.clients.consumer.KafkaConsumer has a seek() method that allows you to do this on an active consumer but I don't see how can i retrieve the KafkaConsumer instance of my Lagom Subscriber.
Bertil Muth
@bertilmuth
Hi everybody. As part of a library I'm developing, I'm trying to auto-generated the entityTypeKey for entites using cluster sharding. I want to do this based on the entity's class name, but in order to be safe: what is the uniqueness constraint of the entityTypeKey? Does it have to be unique inside a cluster, across clusters, immutable over the whole lifecycle? Any help appreciated, thanks.
5 replies
Bertil Muth
@bertilmuth
Another question: what’s the quickest way to inspect the raw event data written by event sourcing behavior to Cassandra in dev mode (without using a read model)?
Yuriy Vasylenko
@yvasylenko
Hi, I'm trying to create API with Lagom and Sangria. Can someone help me to figure out how to do this, specific docs or code samples? Or maybe I'm missing something in general docs
Dheeraj Karande 🇮🇳
@dheerajkarande_twitter

Hi everyone
I am implementing a Kafka consumer using lagom in my application, I followed the lagom documentation and the consumer started working but then it comes to my observation that the actors I was using before stopped getting initialized

I am initializing actor pool inside loader as follow using macwire and it was working before i introduced kafka consumer.
lazy val actorProps = wireProps[ActualActor].withRouter(RoundRobinPool(4))
lazy val actualActor: ActorRef @@ ActualActor = actorSystem.actorOf(actorProps, name = "ActualActorPool").taggedWith[ActualActor]

Someone please help me! Thanks!!!

Dheeraj Karande 🇮🇳
@dheerajkarande_twitter
replacing lazy val to val solves the problem, weird though
Dheeraj Karande 🇮🇳
@dheerajkarande_twitter
Weird in the sense that how come adding Kafka consumer affecting existing actor system
Srepfler Srdan
@schrepfler
Srepfler Srdan
@schrepfler
the documentation page https://www.lagomframework.com/documentation/1.6.x/java/JavaPrereqs.html references JDK8 as requirement, is there any problem to run it on JDK11 (or higher)?
4 replies
Michael Sluyter
@msluyter
Question about journal table pruning; I tried searching for this but didn't find anything. I see that there's a withDeleteEventsOnSnapshot retention flag. Based on the deleted column in journal and some experimentation, I see that these are soft deletes. So my question is, how does one prune the journal so that it doesn't grow without bound? (I'm using JDBC, btw). Aside from manually copying old rows and deleting them, is there any built in or automatic way of doing this?
Nikhil Arora
@nikhilaroratgo_gitlab
@ignasi35 Hello, I am struggling to find documentation which tells me how to call external non Lagom services from within Lagom. First, I started to use play WSClient which is available by default in Lagom(1.6.4) and I could inject it in my Class .Unfortunately, I could not properly work with that because it has scala API and I am using Java. Then I started to check google and landed on this page https://stackoverflow.com/questions/37508302/what-is-the-simplest-way-to-consume-an-external-rest-service-in-lagom . The answer again is not clear. I created another maven module, Defined service descriptor for external service, bindClient in my other module where I want to call the service. But where to define to proxy server settings, base url, TimeOut for the external service is still not clear? Anyway I just wanted to try and started the lagom app in IntelliJ(Dev mode) and got error that serviceName=[ex-service] was not found. Hint: Maybe it was not started? Someone says to use --external-service with lightbend orchestration and someome mentioned to use <unmanagedServices> and also mentioned not to use it in PROD. It's really not clear how to do such a basic thing and last thing I want to do is use some other http client.I want to use only Lagom/play supported http clients. Please help me here. @here Any suggestions?
4 replies
fromscalatohaskell
@fromscalatohaskell_gitlab
Can someone explain to me what are the benefits of application-level sharding (via akka cluster) -vs- sharding via data layer (such as via cassandra) and keeping services stateless?
1 reply
brabo-hi
@brabo-hi
Hi all, how can we get access to request and response body with HeaderFilter
brabo-hi
@brabo-hi
Hi all, how can i start multiple services on a lagom project ?
I know i can start one service with the command sbt myservice/run
How about starting more than one services without runAll?
Gabriel Harris-Rouquette
@gabizou
Hello, I’ve got myself into an issue, I need to run in dev, but it appears Kafka is mysteriously failing, and I’m not sure where the embedded Kafka runs locally when using maven. I’ve seen on SO that the target/lagom-generated would be where it exists, but even deleting the entire workspace and reckoning doesn’t resolve the issue.
Dheeraj Karande 🇮🇳
@dheerajkarande_twitter
@brabo-hi
i start multiple services each on different terminal
sbt lagomServiceLocatorStop lagomServiceLocatorStart module-i-want-to-start-impl/run
Dheeraj Karande 🇮🇳
@dheerajkarande_twitter
you dont need to start the service locator everytime
but it will be great if we can run a subset of micro services in one go
brabo-hi
@brabo-hi
i see it makes sens, thank you for your help @dheerajkarande_twitter
i have another question: why when you look services on service locator http://localhost:9008/services it returns an array where every service twice one with "portName":null and another one with "portName":"http” ?
Paolo Fabbro
@NewP8
Hello, can CosmoDB be used instead of Cassandra?
4 replies
Srepfler Srdan
@schrepfler
@jkoberg what was your experience with AWS Keyspaces and Lagom? Has anyone had positive experience with it?
1 reply
Srepfler Srdan
@schrepfler
Similar question, if targeting AWS, how's the experience with managed K8s and has anyone had any success using Nomad with Lagom?
BodhitavyaKashyap
@BodhitavyaKashyap
Hi , I have a use case that requires lagom services on startup to tell other services (non lagom services) that it is up and requires some data from other services. How I am thinking of approaching this is via KAFKA. I have a kafka instance which is being shared by all services (Lagom and non-lagom). I am able to read from the kafka topic but I don't know how to publish a random message on startup of the Lagom service ,so that other services can start publishing to Kafka . In the documentation I read it says that only persistence events can be published (this is what I understood).Can someone please guide me??
2 replies
Altern Egro
@alternegro
Is it a good idea to start a new project on Lagom considering the last release was in December 2019, or is one better of with a homegrown Play/AkkaHttp + Akka combo?
Per Wiklander
@PerWiklander
@alternegro The last release was 26 Aug 2020, https://github.com/lagom/lagom/releases/tag/1.6.4
Per Wiklander
@PerWiklander
Having said that, your question does have some merit. Lagom does lag behind Akka releases a little bit. My feeling is that Lagom introduced a whole lot of needed things (if you want to build your services the Lagom way) that Akka has since incorporated (with an overlap of developers it is not that strange). This makes developing in Lagom feel more and more like plain Akka now, especially with Akka Typed and Cluster Sharding for the persistent entities and Akka Projections (not officially supported in Lagom yet) for the read side. At the moment I have no will to investigate all the Akka best practices I would have to duplicate to make a plain Akka application behave like my collection of Lagom micro services though.
1 reply
Per Wiklander
@PerWiklander
A word or two on the path forwards would be very welcome @octonato:matrix.org, @ignasi35 and others.
Srepfler Srdan
@schrepfler
Considering the various announcements this period the Akka team has been quite busy which could explain that, I wouldn’t be surprised that Lagom will start taking advantage of these building blocks soon
1 reply
Per Wiklander
@PerWiklander
Oh, and the completely unrelated stuff about identifiers was me trying to reply to a thread from back in December. Thanks Gitter web client...
2 replies
brabo-hi
@brabo-hi
Hi all, i have a lagom project with a service and its implementation, Within the implementation i have a actor that should invoke a call on the same service. However whenever i call myService.invoke() it is throwing the exception ServerServiceCalls should be invoked by using invokeWithHeaders method.
How can i get access and call the method invokeWithHeaders i am only seeing invoke() method
Nikhil Arora
@nikhilaroratgo_gitlab
Hello Guys, I am using Lagom 1.6.4 and Java with PostgreSql. I want to read data from DB in a akka Streamed way ie. Create a Source for some Select query. Is there are way to get a akka stream Source ? I found that alpakka-slick is one way and I am currently experimenting with that. It works locally in DEV mode but it creates its own Hikari pool and I want to avoid that. I used SlickSession.forConfig("slick-postgres" and then Slick.source(session,query,mapper). Any suggestions on this please. Thanks
Dheeraj Karande 🇮🇳
@dheerajkarande_twitter

Hi all, i have a lagom project with a service and its implementation, Within the implementation i have a actor that should invoke a call on the same service. However whenever i call myService.invoke() it is throwing the exception ServerServiceCalls should be invoked by using invokeWithHeaders method.
How can i get access and call the method invokeWithHeaders i am only seeing invoke() method

I think you need to compose a service call
https://www.lagomframework.com/documentation/1.6.x/scala/ServiceImplementation.html#Handling-headers

David-hod
@David-hod
since lagom is not supporting multiple service anymore (look at https://www.lagomframework.com/documentation/1.6.x/scala/Migration14.html)
it seems like you must define all routes on the same class ( you can look at the macro of 'methodFor' : (s"$methodDescription must only be invoked with a reference to a function on this, for example, $methodDescription(this.someFunction _)")
which is a huge restriction because you must write all routes on the service class (which might have hundred calls).
is there any best practice to solve this issue of splitting routes into multiple classes? so it can be maintainable
AltiorBahA
@AltiorBahA

Hi everyone.

I'm trying to split my lagom scala projet into multiple builds following the doc (version 1.6).

I published my external Lagom services on Jfrog Artifactory.

I import the services by using :

lazy val myservice = lagomExternalScaladslProject("myservice", "myserviceimpl" % "myserviceimpl_version" % "1.0") .enablePlugins(LagomScala)

When i runAll in sbt shell, i get the fallowing error :

No application loader is configured. Please configure an application loader either using the play.application ...
When i add the "guice" dependency in the imported service like this :

lazy val myservice = lagomExternalScaladslProject("myservice", "myserviceimpl" % "myserviceimpl_version" % "1.0") .enablePlugins(LagomScala) .settings( publish / skip := true, libraryDependencies += guice, )

it run without run time exception but i try to request the service with Insomnia i get this :

[info] Service myserviceImpl listening for HTTP on 127.0.0.1:58213 [info] Service otherserviceImpl listening for HTTP on 127.0.0.1:53048 [info] Service currentService listening for HTTP on 127.0.0.1:49213 [info] (Services started, press enter to stop and go back to the console...) 17:56:56.204 [GATEWAY] [warn] com.lightbend.lagom.internal.scaladsl.registry.ScalaServiceRegistryClient [] - serviceName=[myservice] was not found. Hint: Maybe it was not started? 17:56:56.213 [GATEWAY] [error] home.services.gateway.internal.controllers.Main [] - [Message] Service item was not found by service locator, [TRACE] java.lang.IllegalStateException: Service myservice was not found by service locator

I don't know what i've missed.

I'm using lagom 1.6, SBT 1.4.7, IntelliJ Community 2020.2, JDK 8

AltiorBahA
@AltiorBahA
The stackoverflow link of my question is here
Chris Bowden
@cbcwebdev
@AltiorBahA if you are publishing myserviceimpl in an idiomatic way, you probably need a %% in there. you dont need to enable the lagom plugin on the external project settings. you shouldnt need to inform it to skip publishing either. not sure what you're doing with guice, sometimes i do have reason to modify dependencies / settings on an external proj.