当前位置: 首页 > news >正文

专业网站开发软件网站 怎么备案

专业网站开发软件,网站 怎么备案,销售外包公司,互联网电商公司排名1.什么是Akka remoting#xff1f; Akka-Remoting一种ActorSystem之间Actor对Actor点对点的沟通协议.通过Akka-Remoting来实现一个ActorSystem中的一个Actor与另一个ActorSystem中的另一个Actor之间的沟通 Akka Remoting限制#xff1a; 不支持NAT#xff08;Network Add…1.什么是Akka remoting Akka-Remoting一种ActorSystem之间Actor对Actor点对点的沟通协议.通过Akka-Remoting来实现一个ActorSystem中的一个Actor与另一个ActorSystem中的另一个Actor之间的沟通 Akka Remoting限制 不支持NATNetwork Address Translation不支持负载均衡器Load Balancers Akka提供了种方式来使用Remoting功能 通过调用actorSelection方法搜索一个actor该方法输入的参数的模式为akka.protocol://actor systemhostname:port/actor path通过actorOf方法创建一个actor 下面看一下Remoting系统中故障恢复模型Failure Recovery Model如下图所示 上图中连接到一个远程系统的过程中包括上面4种状态在进行任何通信之前系统处于Idle状态当第一次一个消息尝试向远程系统发送或者当远程系统连接过来这时系统状态变为Active当两个系统通信失败连接丢失这时系统变为Gated状态当系统通信过程中由于参与通信的系统的状态不一致导致系统无法恢复这时远程系统变为Quarantined状态只有重新启动系统才能恢复重启后系统变为Active状态。 Akka Remoting功能 Akka将remoting完全配置化了使用时几乎只需要修改配置文件除非自定义否则不需要动一行代码。 remoting包提供了两个功能 查找一个已存在的远程Actor在指定的远程路径上创建一个远程Actor 2.代码管理 实验目标 实现客户端和服务端通信 pom.xml !-- Akka Streams -- dependencygroupIdcom.typesafe.akka/groupIdartifactIdakka-stream_2.13/artifactIdversion2.6.0/version /dependency server server.conf akka {actor {provider akka.remote.RemoteActorRefProvider}remote {artery {enabled ontransport tcpcanonical.hostname 127.0.0.1canonical.port 2552}} } package com.et.akka.remoting;import akka.actor.AbstractActor; import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.Props; import com.typesafe.config.ConfigFactory;public class ServerApp {static class ServerActor extends AbstractActor {Overridepublic Receive createReceive() {return receiveBuilder().match(String.class, msg - {System.out.println(Server received message: msg);getSender().tell(Hello from Server, getSelf());}).build();}}public static void main(String[] args) {ActorSystem system ActorSystem.create(RemoteSystem, ConfigFactory.load(server));ActorRef serverActor system.actorOf(Props.create(ServerActor.class), serverActor);System.out.println(Server is running...);} } client client.conf akka {actor {provider akka.remote.RemoteActorRefProvider}remote {artery {enabled ontransport tcpcanonical.hostname 127.0.0.1canonical.port 0}} } package com.et.akka.remoting;import akka.actor.AbstractActor; import akka.actor.ActorRef; import akka.actor.ActorSelection; import akka.actor.ActorSystem; import akka.actor.Props; import com.typesafe.config.ConfigFactory;public class ClientApp {static class ClientActor extends AbstractActor {private final String serverActorPath;public ClientActor(String serverActorPath) {this.serverActorPath serverActorPath;}Overridepublic void preStart() {ActorSelection serverActor getContext().actorSelection(serverActorPath);serverActor.tell(Hello from Client, getSelf());}Overridepublic Receive createReceive() {return receiveBuilder().match(String.class, msg - {System.out.println(Client received message: msg);}).build();}}public static void main(String[] args) {ActorSystem system ActorSystem.create(RemoteSystem, ConfigFactory.load(client));String serverPath akka://RemoteSystem127.0.0.1:2552/user/serverActor;ActorRef clientActor system.actorOf(Props.create(ClientActor.class, serverPath), clientActor);System.out.println(Client is running...);} } 以上只是一些关键代码所有代码请参见下面代码仓库 代码仓库 GitHub - Harries/springboot-demo: a simple springboot demo with some components for example: redis,solr,rockmq and so on.(akka) 3.测试 启动server启动client产看日志 server Server is running... Server received message: Hello from Client client Client is running... Client received message: Hello from Server 4.引用 https://doc.akka.io/docs/akka/current/remoting.htmlhttps://doc.akka.io/docs/akka/current/remoting-artery.html#selecting-a-transportSpring Boot集成Akka remoting快速入门Demo | Harries Blog™
http://www.dnsts.com.cn/news/221712.html

相关文章:

  • 网站怎么添加广告drupal wordpress 性能
  • 不备案的网站需要注销吗做商业网站是否要备案
  • 哪个网站可以做会计题专业团队歌曲
  • 个人网站制作手绘wordpress更新一直下载
  • 服务器 网站打开慢cpanel做wordpress
  • 品牌推广网站策划设计品牌网站建设价位
  • 青海住房和建设厅网站制作网页的超文本标记语言
  • 网站建设三方合同范本哪个餐饮店微网站做的有特色
  • html企业网站源码乐清网站制作公司有哪些
  • 全国建筑企业资质查询平台下载外链seo软件下载
  • 旅游门户网站模板下载wordpress写代码
  • 网站建设比较好的律所教育机构网站建设
  • 上海建设网站是国家级吗做网站需要哪些人才
  • 中国建设银行网站打不开银川免费网站建设
  • 网站备案有哪些资料市场策划
  • 网站建设安全吗网站开发业绩
  • 廊坊公司网站建设企业做网站和宣传册的作用
  • 济南网站制作工具seo搜索引擎
  • 企业网站必须备案网上做问卷报酬不错的网站是
  • 网站logo怎么改wordpress 付费会员分类
  • 监控设备东莞网站建设做外贸网站用什么软件翻强的
  • 关于做好全国网站建设wordpress 父级 模板
  • 网站子目录怎么做wordpress小工具里页面
  • 网站源码客户苏州建设教育协会网站
  • 网站模板建站公司wordpress如何修改后台网址
  • 网站添加微博郑州网站seo分析
  • c 网站开发框架有一个网站如何做双语
  • aspcms园林绿化工程网站源码wordpress卢松松自适应
  • 计算机应用技术(网站开发)个人可以注册商标吗
  • 页面设计要求合肥网站搜索引擎优化