General discussion of Lagom: https://www.lagomframework.com/ | Code of Conduct: https://www.lightbend.com/conduct | Forums: https://discuss.lagomframework.com | Commercial support from https://www.lightbend.com/
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?
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
[warn] a.s.s.RestartWithBackoffSource [akkaAddress=akka://application@10.10.10.10:25520, sourceThread=application-akka.actor.default-dispatcher-15, akkaSource=RestartWithBackoffSource(akka://application), sourceActorSystem=application, akkaTimestamp=10:07:06.606UTC] - Restarting graph due to failure. stack_trace:
EventSourcedBehaviorWithEnforcedReplies
and want to use lightbend telemetry to publish some custom metrics.. but am not find how I can access the akka system... Is there a way I can access akka system or push an ActorRef
into EventSourcedBehaviorWithEnforcedReplies
implementation?
Error injecting constructor, java.lang.NoSuchMethodError: 'akka.stream.ActorMaterializer akka.stream.SystemMaterializer.materializer()'
at tech.api.impl.MarketsServiceImpl.<init>(MarketsServiceImpl.java:42)
at com.lightbend.lagom.javadsl.server.ServiceGuiceSupport$LagomServiceBuilder.bind(ServiceGuiceSupport.java:134) (via modules: com.google.inject.util.Modules$OverrideModule -> tech.api.impl.MarketsModule)
while locating tech.api.impl.MarketsServiceImpl
Caused by: java.lang.NoSuchMethodError: 'akka.stream.ActorMaterializer akka.stream.SystemMaterializer.materializer()'
Hi all! Ive got a question about the lagom-event-streams which are emitted to kafka. Some events were missing - at first i thought that there was a problem with the consumer but i discovered that the missing events had not been published to the topic (but i saw them in the eventstore). I'm using 10 TAGs and today 9 of the TopicProducers had no lag whereas 1 Produced was stalled (i saw this in the read_side_offsets table of persistencejdbc. 9 topics on a offset of about 247xxx... 1 topic still on offset 244xxx).
I searched the logs but could not locate any messages indicating a problem.
The problem itself disappeared when i restarted both nodes of the cluster of this specific persistententity. (unfortunately i missed to check whether the problem resolved after restarting 1 of the 2 nodes).
can anybody drop me a hint what i can do if this problem occurs again?
materializer()
method, can this be some sort of MiMa issue? It sounds similar to this error akka/akka#25449
For Lagom service descriptor can I have an endpoint with a query string parameter that is defaulted to a value or do I have to specify it as Option
?
eg. can I do this?
trait MyService extends Service {
def myEndpoint(foo: String, bar: String = "someValue")
override def descriptor: Descriptor = {
// ....
restCall(Method.GET, "whatever/:foo?bar", myEndpoint _)
}
}
And call it like this: myService/whatever/test
Hello. I have a need to consume from a kafka topic (still within same cluster, but not published via events).
Documentations suggest that I create an ExternalKafkaService
with the topic defined in its descriptor, then I can write my subscriber as usual. This works, but I'm just wondering if we have any way to not depending on Lagom for this purpose.
logger.info("Starting the subscriber")
externalKafkaService.externalTopic.subscribe.atLeastOnce(Flow[ExternalRequest].mapAsync(1) {
request =>
logger.info("Executing {}", request)
Future.successful(Done)
})
If I implement the subscriber like this, I can see the "starting" log on startup, but not the "executing" log when I produce the messages to the topic (works fine if using Lagom way)
private val consumerSettings = ConsumerSettings(actorSystem, new StringDeserializer, new StringDeserializer)
logger.info("Starting the subscriber")
Consumer
.plainSource(consumerSettings, Subscriptions.topics(ExternalTopic))
.mapAsync(1)(message => {
val request = Json.parse(message.value).as[ExternalRequest]
logger.info("Executing {}", request)
Future.successful(Done)
})
.run()
Could you help me understand what is missing in 2nd approach? Is there any preferences/advantages to use Lagom way instead, even if we can make 2nd approach work? (I can change 2nd approach to use commitableSource to achieve the atLeastOnce behaviour later)
Thank you in advance.
Hello i have a question about lagom topic pubSub and websocket.
For example i have simple endpoint :
def websocket: ServerServiceCall[ NotUsed, Source[ String, NotUsed ] ] = ServerServiceCall { ( _, _ ) =>
val topic = pubSub.refFor( TopicId[ TopicMessage ]( "SomeTopic" ) )
val stream = topic.subscriber.log( "WS", x => {
log.warn( s"sending WS message $x" )
} )
.withAttributes( Attributes.logLevels( onElement = Logging.InfoLevel, onFinish = Logging.WarningLevel ) )
Future.successful( (ResponseHeader.Ok, stream) )
}
How to detect that websocket disconnected or ended?
For example i need to detect if WS disconnected and save information about it.
I can see that .log
function from akka stream with attributes detects that downstream has ended and logs about it.
I tried handling with .recover{}
or via Sink.onComplete
but nothing happened.
Any tips?
ServiceTest.startServer
using ServiceTest.defaultSetup.withJdbc(true)
and i'm getting an error "DefaultDB not found". I've got other services that I've written that do this and it works just fine. I've been up and down the configurations and build.sbt and I can't for the life of me figure out what is different
liberica-11.0.17+7
and got this error:Exception in thread "sbt-socket-server" java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/d_/l31r8jq15_b3chmbhgzvkm600000gn/T/jna--1153855574/jna17675872334345649318.tmp
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2633)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:947)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:922)
at com.sun.jna.Native.<clinit>(Native.java:190)
at com.sun.jna.Pointer.<clinit>(Pointer.java:54)
at com.sun.jna.Structure.<clinit>(Structure.java:2130)
at sbt.internal.server.Server$$anon$1$$anon$2.$anonfun$run$1(Server.scala:65)
at scala.util.Try$.apply(Try.scala:213)
at sbt.internal.server.Server$$anon$1$$anon$2.run(Server.scala:60)
[warn] sbt server could not start in 10s
1.3.3
)