【问题标题】:Can ReactiveMongo can be used in Lagom framework?ReactiveMongo 可以在 Lagom 框架中使用吗?
【发布时间】:2018-10-30 13:21:24
【问题描述】:

我需要将现有的 Play + Scala + Mongodb 应用程序转换为 Lagom 微服务。但我测试过的所有例子都是使用 Cassadra。

如其文档中所述,对 mongodb 有读取支持。 There is plugin too.

这意味着,我们可以不写入 mongodb 集合吗?

【问题讨论】:

    标签: mongodb playframework-2.6 lagom


    【解决方案1】:

    是的,您理论上可以创建 MongoDB 持久性 API。你需要实现:

    com.lightbend.lagom.scaladsl.persistence.{ 
        PersistenceComponents, 
        PersistentEntityRegistry, 
        ReadSidePersistenceComponents,
        WriteSidePersistenceComponents 
    }
    

    play.api.db.DBComponents

    您可以查看 JDBC 的示例实现 here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-14
      • 1970-01-01
      • 1970-01-01
      • 2015-05-08
      • 1970-01-01
      • 1970-01-01
      • 2013-03-11
      相关资源
      最近更新 更多