Discussion of Lagom project development: https://github.com/lagom/.github/blob/master/CONTRIBUTING.md | Use lagom/lagom channel for general discussion. | Code of Conduct: https://www.lightbend.com/conduct | Forums: https://discuss.lagomframework.com | Commercial support from https://www.lightbend.com/
mergify[bot] on master-jackson-databind
mergify[bot] on master
[master] bump jackson-databind … Merge pull request #3162 from l… (compare)
api
depends on dto
and messages
but dto
and messages
don’t know each others
HandlerDef
for HTTP filter. :pray:
MetricsService
bind by implementation class?MetricsService
by implementation is normal case.
MetricsService
may be removed some time in the future. It’s a service providing per-instance information so it’s weird to read that info via RPC (where you usually want to treat all instances/nodes equally). Instead, metrics should be pushed to an external aggregator to create some form of dashboard.
MetricsService
. Now we do the following. We subscribe to the stream of data from MetricsService
and push data to an external MetricRegistry
(+ graphite reporter).
validateDependencyWhitelist
worked locally, but yeah, I was considering that too.
Hi all! :) I've been wondering recently... when it comes to Scala DSL for Lagom, it feels much like the Java DSL. I can see that oftentimes the return type is a Unit
, with side-effects, we reference context in a few places, rather than simply provide a A => B
function here and there.
Namely, instead of something like a DSL in akka-ddd [source]:
def canceledOrClosed: Actions =
handleCommand {
case CloseReservation(reservationId) =>
ReservationClosed(reservationId)
case CancelReservation(reservationId) =>
ReservationCanceled(reservationId)
}
.handleEvent {
case ReservationCanceled(_) => Canceled
case ReservationClosed(_) => Closed
}
we end up writing:
case (AddPost(content), ctx, state) =>
ctx.thenPersist(PostAdded(entityId, content)) { evt =>
ctx.reply(AddPostDone(entityId))
}
or:
case (AddPost(content), ctx, state) =>
if (content.title == null || content.title.equals("")) {
ctx.invalidCommand("Title must be defined")
ctx.done
}
My questions is - is there any particular reason why Scala DSL for Lagom does not feel Scala-idiomatic and resembles patterns common for Java-like frameworks? (diverging from FP, side-effects etc.)
Wouldn't it be better if one might be able to say e.g.:
case AddPost(content) =>
PostAdded(entityId, content)
(...)
case PostAdded(entityId, _) =>
AddPostDone(entityId)
and:
case AddPost(Content(None, _)) | AddPost(Content(Some(""), _)) =>
InvalidCommand("Title must be defined")
What do you think?