Lagom 微服务入门

1.Lagom 中文意思是恰到好处的意思
2.它是lightbend体系下的微服务架构

例子

1.在 cmd 命令行中输入,一直按enter

sbt new https://github.com/lagom/lagom-scala.g8
2.在当前目录下会创建hello的工程
3.进入该工程 cd hello
4.先 输入sbt ,等编译完后,再输入runAll命令
输出结果为:

[info] Starting embedded Cassandra server
..........
[info] Cassandra server running at 127.0.0.1:4000
[info] Service locator is running at http://localhost:9008
[info] Service gateway is running at http://localhost:9000
[info] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:24266
[info] Service hello-stream-impl listening for HTTP on 0:0:0:0:0:0:0:0:26230
(Services started, press enter to stop and go back to the console...)

可以在浏览器里http://localhost:9000/api/hello/World 查看 Hello, World!

也可以把例子hello导入idea里
如果本地4000端口被占用则在sbt里加上则Cassandra的端口改为9042
lagomCassandraPort in ThisBuild := 9042
这样再http://localhost:9000/api/hello/World 查看有 Hello, World!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值