07 2015 档案

摘要:def handleActorResponse: PartialFunction[Try[Any], (StatusCode, ResponseResult)] = { case Failure(exp) => (InternalServerError, ResponseResul... 阅读全文
posted @ 2015-07-28 14:29 SangS 阅读(236) 评论(0) 推荐(0) 编辑
摘要:测了一个小时的 Pubsub 模式,发现这个模式和自己预期的不太一样,具体表现在:1. 当 subscriber 订阅了某个 topic 并附带 groupName 时,如果 publish 发布的消息只含有 topic 而没有 groupName,那么该 subscriber 不会收到消息。而按照... 阅读全文
posted @ 2015-07-21 17:34 SangS 阅读(432) 评论(0) 推荐(0) 编辑
摘要:public class HTTPClient { public static final String GET = "GET"; public static final String POST = "POST"; public static final String PUT = "PUT"; p... 阅读全文
posted @ 2015-07-16 10:30 SangS 阅读(511) 评论(0) 推荐(0) 编辑
摘要:scala 用 isInstanceOf 会报错(instanceof 这个函数就没有),java 下使用 instanceof 来判断是否是 Inet4Addresstest("get ipv4 address") { val ipAddr = InetAddress.getLocalHost.... 阅读全文
posted @ 2015-07-14 08:27 SangS 阅读(600) 评论(0) 推荐(0) 编辑
摘要:cluster singleton 需要注意的一点是ClusterSingletonProxy 必须和 ClusterSingletonManager 一起工作尝试过通过 path 来获得 singleton actor 的 actorRef,但是结果和期望的不同,具体的表现是,在 main 方法中... 阅读全文
posted @ 2015-07-02 17:02 SangS 阅读(848) 评论(0) 推荐(0) 编辑
摘要:cluster sharding 的目的在于提供一个框架,方便实现 DDD,虽然我至今也没搞明白 DDD 到底适用于是什么场合,但是 cluster sharding 却是我目前在做的一个 project 扩展到集群上非常需要的工具。sharding 要做这么几件事1. 对于每一个 entity,创... 阅读全文
posted @ 2015-07-02 14:30 SangS 阅读(1577) 评论(0) 推荐(0) 编辑
摘要:cluster 配置akka { actor { provider = "akka.cluster.ClusterActorRefProvider" } remote { log-remote-lifecycle-events = off enabled-transports... 阅读全文
posted @ 2015-07-02 11:18 SangS 阅读(2040) 评论(0) 推荐(0) 编辑
摘要:1. 在使用 akka cluster singleton 时,我需要知道被创建的 singleton proxy 的 actorRef,通过绝对路径加 actorSelection 方法,应该很容易得到此 actor 的 actorRefmain() { system.actorOf(Clu... 阅读全文
posted @ 2015-07-02 10:35 SangS 阅读(923) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示