Questions tagged [lagom]
Lagom is a framework for creating microservice-based systems on the Java Virtual Machine.
329
questions
1
vote
0
answers
35
views
Lagom service test to use real Cassancra
I am creating a service test based on this docs: https://www.lagomframework.com/documentation/1.6.x/scala/TestingServices.html
I don't want to use Lagom's built in Cassandra, so I have this in my sbt ...
0
votes
0
answers
32
views
Lagom - deserialize journal message
My team has a use case, where we need to expose as an API, the internal Lagom tables.
The main issue here is the Journal has a field call message that is a byte array, and I would like to deserialize ...
1
vote
0
answers
24
views
Test JDBC Read Side Processor in Lagom
I have a Read Side Processor that uses JdbcReadSide. In the globalPrepare method creates a table in the DB and in the handler map some entities from the event and inserts some records. How can i unit ...
0
votes
1
answer
139
views
Connecting Lagom to external Kafka Server (on Confluent Cloud)
I need to connect Lagom 1.6/Java/Sbt application to Confluent Cloud Kafka cluster.
From Confluent I have the following configuration:
bootstrap.servers=xxxx.us-west1.gcp.confluent.cloud:9092
security....
2
votes
0
answers
242
views
How to use lagom in scala3
I want to compile my lagom project in Scala 3.
Follow this documentation scala3 documentation, when prepare the dependencies, I change my build.sbt:
lazy val `service-api` = (project in file("...
1
vote
1
answer
268
views
Difference between Lagom and Akka Projection
Reading on Akka Projection project I can't get rid of the feeling that it serves the same purpose as Lagom (framework for building actor based reactive microservices).
Other similarities:
Same ...
0
votes
1
answer
117
views
Lagom - Add header to response in service call composition
i want to write code which will refresh cookie (via set-cookie http header) in Lagom.
For clarification Cookie is an encoded string (for example AES).
Lets take lagom service call composition for ...
0
votes
1
answer
174
views
play.application.loader [class java.lang.Class}] does not implement interface play.api.ApplicationLoader or interface play.ApplicationLoader
My service is running fine until I hit api endpoint request with this error-
Cannot load play.application.loader[play.application.loader [class java.lang.Class}] does not implement interface play.api....
0
votes
1
answer
133
views
How to externalize protobuf files in JVM ecosystem?
I stumbled upon this Akka grpc tutorial which suggests that we can create a jar from a project that has .proto file under src/main/proto and add it as a dependency in client and server projects to ...
0
votes
1
answer
82
views
How to create a lagom server with grpc service implementation only?
I am trying to create a grpc service using Lagom framework following this documentation. Here the hello service also exposes rest API besides grpc service.
Now while creating lagom server in the ...
1
vote
1
answer
305
views
The first element has not yet passed through in 5000 milliseconds
I am new to lagom scala. Created a simple crud to learn the key concept of it. First I compiled my code using sbt clean compile and it successfully compiled the code.
After that I tried to run the ...
2
votes
1
answer
368
views
In lagom: on increasing concurrent http calls, thread count (akka.actor.default-dispatcher) keeps increasing. How to control this behaviour?
We observe that on increasing concurrent http calls to our service, thread count (akka.actor.default-dispatcher) keeps increasing (see screenshot from visualVM). Also after the requests stop, the ...
0
votes
1
answer
133
views
Lagom create static µ-service cluster
i wrote a few µ-services with lagom.
I have a docker-compose file in which all µ-services will be manual created.
Now I have a problem.
If I use discovery with akka-dns their is nothing found.
If I ...
3
votes
2
answers
287
views
How to combine Source.repeat and Source.completionStage using Akka
I'm using akka with a microservice framework, so I've got a lot of completionStage requests. I want to get a list of elements from one microservice and zip them together with a single element from ...
1
vote
0
answers
35
views
How to serve static assets in Lagom?
I am trying to serve static assets with Lagom. I added a play router using additional routers because play has support for serving assets from public folder.
But I can't use Assets.at function here ...
0
votes
1
answer
87
views
How to deploy lagom scala on heroku
I am beginner in lagom scala api. I have developed rest apis using lagom scala play framework.
Now I want to deploy my services on heroku just for live testing purpose.
I followed the below link to ...
1
vote
1
answer
75
views
com.lightbend.lagom.internal.scaladsl.registry.ScalaServiceRegistryClient [] - serviceName=[elastic-search] was not found
I am new in lagom scala. Since I am using elastic-search to store my data as documents. I am also having external cassandra running. When I call an action to store my data in cassandra as well as in ...
1
vote
0
answers
160
views
How to resolve Column Family Id Mismatch Error
Caused by: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found d58d5af0-110d-11eb-9d7e-01a6151598cb; expected d550a010-110d-11eb-9d7e-01a6151598cb)
at org....
1
vote
1
answer
112
views
Migrating from Akka Persistence Classic to Akka Persistence Typed
I am looking to migrate from Classic Akka Persistence to Akka Persistence Typed. The Lagom documentation found here:1 says that " Note : the only limitation when migrating from from Lagom ...
0
votes
1
answer
64
views
PersistenceException at Kotlin Lagom service
When service starts at kube, i have error:
2020-09-16T22:01:17.370+0300 [warn] com.lightbend.lagom.internal.javadsl.persistence.jpa.JpaSessionImpl [] - Exception while initializing JPA ...
0
votes
1
answer
313
views
Lagom does not work with Postgresql as persistence database
I am trying to use Postgresql as the database for persistence in my lagom application.
Below is the configuration I did in my application.conf
db.default {
driver = "org.postgresql.Driver"
...
0
votes
1
answer
396
views
akka.pattern.AskTimeoutException is thrown while persisting an event
I just started with Lagom & Akka. I am following the design decribed in Domain Modelling with Akka Persistence Typed
I am trying to create a brand new instance of an entity (EntityState). But the ...
0
votes
1
answer
380
views
Slick PostgreSQL Integration
I'm new to scala and I'm trying to integrate a PostgreSQL database to a Lagom application written in scala.I'm trying to utilise the persistence API of Lagom. Lagom has inbuilt support for slick.
My ...
0
votes
1
answer
144
views
Lagom topic subscriber - how to retry in Future Exception?
I have a topic subscriber in lagom as bellow
fooService.fooTopic().subscribe
.atLeastOnce(
Flow[fooMsg].map {
case fooMsg(_) =>
foo()
case a =>
println(a)
}....
0
votes
2
answers
80
views
Multiple keys index leads in an PSQLException with Slick, Postgres on a lagom project
I have a lagom application and using for the readside a postgres with lagom jdbc.
Tables are created and works fine. After a restart and an already created table with a multiple key index I get always ...
0
votes
2
answers
510
views
How to implement kafka consumer using lagom framework
Tried different documentation but not able to implement kafka consumer api using lagom.
Followed Message broker and getting Object creation impossible, since member lagomServer: LagomServer in com....
0
votes
1
answer
105
views
Embedding Lagom read-side processor in a non-Lagom application
I have a Lagom service which writes events for persistent entities to cassandra.
I would like to process those events from another application (not lagom-based) by embedding a read-side processor ...
0
votes
2
answers
11k
views
How to create kubernetes secret as json object and load the same in kubernetes environment as json
I need to pass a JWK as kubernetes environment variable to my app.
I created a file to store my key like so:
cat deploy/keys/access-signature-public-jwk
{
algorithm = "RS256"
jwk = {"kty":"RSA",...
0
votes
1
answer
377
views
How to write logs to a file in a lagom application
As part of deploying my lagom application to the kubernetes production environment, I am trying to publish all my logs to a file besides writing to the standard output. For this I created a logback....
1
vote
1
answer
156
views
Deploy a dynamic Service Gateway for Lagom in production
I have developed a set of Lagom microservices. The development environment provides with default Service Gateway and Service Locator.
In a production environment I would like my services to:
...
0
votes
1
answer
380
views
How do you test the read-side processor in Lagom?
I have a read-side that is supposed to write entries to Cassandra, I would like to write a test that ensure that sends an event to the read-side and then check in Cassandra that the row has indeed ...
1
vote
1
answer
74
views
How to setup a domain model with Lagom?
I'm currently trying to build an application that handles personal finances. I'm struggling with Lagom ways of doing because I can't find any example of "real" application built with Lagom. I have to ...
-1
votes
1
answer
272
views
Error ( No implicits found for parameter responseSerializer: MessageSerializer[Seq[SearchFormData], _] )
enter image description here
Getting error in scala rest API while passing Seq[] in response. And when I remove Seq it works fine.
Thank You
0
votes
1
answer
225
views
Lagom - how to post a x-www-form-urlencoded
I have a service locator, which link to external URL. Then I want to invoke that service inside my implementation.
here is the idea, in my build.sbt, I put the URL of my service
...
0
votes
0
answers
50
views
Error in setting up a service using lagom
I am nearly replicating the shopping crt example of GitHub. I am getting the following error:
Error:(41, 32) type mismatch;
found : akka.actor.typed.ActorRef[com.rddSpTrMS.api.RDDSpTrView]
...
1
vote
1
answer
531
views
Where exactly does application.conf live in the project directory structure?
The Play website says it should be in "conf", but the Lagom default HelloeWorld example places it under the "resources" directory within /applicationProject/src/main". "conf/" does not even show up ...
0
votes
2
answers
87
views
how to copy a class inside of a state?
Its quite simple if all of the val in the State is basic data type. if we want to copy a specific value inside of it, it would just be
copy(specificValue = newValue)
but how if this specific value, ...
0
votes
1
answer
289
views
how to Throw a customize http error in Scala Lagom
I know how to throw a bad request in Lagom by using
throw BadRequest("Bad Request")
but this will return with an http error code of 400.
how do I return with a http error code of 409 (Conflict) for ...
0
votes
1
answer
490
views
JsonValidationError is not an object error interpretation
Does any one have any idea what the cause of this error might be?
Future(
Success(
JsError(
List(
(,List(
JsonValidationError(
List(
[{"...
2
votes
0
answers
118
views
Kafka quits unexpectedly in Intellij but not in bash
When I try to run "runAll" in Lagom from within Intellij, Kafka server is closed unexpectedly right after starting Cassandra. Once I get to the line that reads "Services started, press enter to stop ...
1
vote
1
answer
579
views
Connecting to AWS Managed Cassandra Service from Lagom
I'm having problems connecting to AWS Managed Cassandra Service from my Lagom environment. Here's what I have tried, with what results.
(1) Amazon provides instructions for connecting to AWS MCS from ...
0
votes
1
answer
115
views
Lagom Serialization for Static Assets
I'm developing a Lagom microservice. In addition to its meat, it has a few static files to serve (index.html, *.css, *.js, and favicon.ico). I know how to set the response's Content-Type header using ...
1
vote
1
answer
197
views
Scala Lagom development mode & Docker
we have a Scala service built on top of Lagom. We use JWT to authenticate the connections when deployed.
Locally we developers use sbt runAll to run our service. This works fine and it circumvents ...
1
vote
2
answers
792
views
Using environment variables to configure Docker deployment of Lagom Scala application
We're developing several Lagom-based Scala micro-services. They are configured using variable replacement in application.conf, eg.
mysql = {
url = "jdbc:mysql://"${?ENV_MYSQL_DATABASE_URL}
During ...
0
votes
1
answer
206
views
Lagom how to decide on the entity id
I am trying to add user and friend services using lagom framework. I read lagom persistent doc but still not able to understand how should I decide on entity id? Since it should be unique to retrieve ...
0
votes
1
answer
579
views
Cannot use lagom on IntelliJ for my Maven project
I started a new Maven project and try to get lagom to work on my Maven project. On my Run Configurations I have inputted lagom:runAll under Command Line. However, when I run my project I get the ...
0
votes
1
answer
79
views
Prepared Statement and Bind in lagom framework?
Q1. What is prepared statement?
for eg below:
var userStatmt: PreparedStatement = _
for {
insert <- cassandraSession.prepare(
"INSERT INTO usertable(id, name) VALUES(?, ?)")
} ...
0
votes
1
answer
163
views
How is shard number related with tagging an event in lagom?
Q1. Is it so that every event gets different sharded number?
Q2. What if there are 3 shards but only one event, then is it so that it will be sharded into one of the three? What about the leftover 2 ...
1
vote
1
answer
163
views
What is an Event Tag in lagom framework?
From the doc : https://www.lagomframework.com/documentation/1.5.x/scala/ReadSide.html
It says :
Event tags In order to consume events from a read-side, the events need to be tagged. All events ...
0
votes
0
answers
42
views
How to browse methods,classes,values within a library,api or a framework in Intellij?
The below picture is the code for lagom framework, now browsing within that file is not working as it should like in your project.
Here on Ctrl click on LagomServiceBinder is showing as No usages ...