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

淘宝客网站推广备案wordpress媒体库远程上传

淘宝客网站推广备案,wordpress媒体库远程上传,wordpress添加留言,仿站怎么做版本 awsVersion ‘1.11.277’ EurekaTransport 用于客户端和服务端之间进行通信#xff0c;封装了以下接口的实现#xff1a; ClosableResolver 接口实现TransportClientFactory 接口实现EurekaHttpClient 接口实现及其对应的 EurekaHttpClientFactory 接口实现 private … 版本 awsVersion ‘1.11.277’ EurekaTransport 用于客户端和服务端之间进行通信封装了以下接口的实现 ClosableResolver 接口实现TransportClientFactory 接口实现EurekaHttpClient 接口实现及其对应的 EurekaHttpClientFactory 接口实现 private static final class EurekaTransport {// 服务端集群解析器用于获取服务端列表private ClosableResolver bootstrapResolver;// 底层工厂用于创建具体通信协议的实现private TransportClientFactory transportClientFactory;// EurekaHttpClient实现用于注册实例、取消注册、续约private EurekaHttpClient registrationClient;// 上层工厂用于创建registrationClientprivate EurekaHttpClientFactory registrationClientFactory;// EurekaHttpClient实现用于全量拉取、增量拉取服务列表private EurekaHttpClient queryClient;// 上层工厂用于创建queryClientprivate EurekaHttpClientFactory queryClientFactory; }EurekaHttpClientFactory 是上层工厂接口A top level factory interface用于创建 EurekaHttpClientDecorator 对象to create http clients for application/eurekaClient use。 public interface EurekaHttpClientFactory {EurekaHttpClient newClient();void shutdown(); }例如 DiscoveryClient # scheduleServerEndpointTask 方法 newRegistrationClientFactory EurekaHttpClients.registrationClientFactory(eurekaTransport.bootstrapResolver,eurekaTransport.transportClientFactory,transportConfig); newRegistrationClient newRegistrationClientFactory.newClient();TransportClientFactory 是底层工厂接口A low level client factory interface用于创建 JerseyApplicationClientEureka 原生实现、Jersey2ApplicationClientEureka 原生实现、RestTemplateEurekaHttpClientSpringCloud 实现等具体协议相关的实现。底层工厂创建的对象不建议直接使用Not advised to be used by top level consumers需要经过上层工厂加工。 public interface TransportClientFactory {EurekaHttpClient newClient(EurekaEndpoint serviceUrl);void shutdown(); }例如 DiscoveryClient # scheduleServerEndpointTask 方法 TransportClientFactories transportClientFactories argsTransportClientFactories null? new Jersey1TransportClientFactories(): argsTransportClientFactories; EurekaHttpClient 接口用于客户端和服务端之间进行通信封装了注册、取消注册、续约、拉取服务列表等一系列操作。 public interface EurekaHttpClient {// 注册实例服务注册EurekaHttpResponseVoid register(InstanceInfo info);// 取消注册服务下线EurekaHttpResponseVoid cancel(String appName, String id);// 发送心跳服务续约EurekaHttpResponseInstanceInfo sendHeartBeat(String appName, String id, InstanceInfo info, InstanceStatus overriddenStatus);// 更新实例的服务状态InstanceStatus服务状态更新EurekaHttpResponseVoid statusUpdate(String appName, String id, InstanceStatus newStatus, InstanceInfo info);// 删除实例的覆盖状态overriddenStatus将变成UNKNOWNEurekaHttpResponseVoid deleteStatusOverride(String appName, String id, InstanceInfo info);// 获取指定区域regions的注册表全量获取EurekaHttpResponseApplications getApplications(String... regions);// 获取指定区域regions的注册列表增量获取EurekaHttpResponseApplications getDelta(String... regions);EurekaHttpResponseApplications getVip(String vipAddress, String... regions);EurekaHttpResponseApplications getSecureVip(String secureVipAddress, String... regions);// 获取指定应用的实例列表EurekaHttpResponseApplication getApplication(String appName);// 获取指定实例EurekaHttpResponseInstanceInfo getInstance(String appName, String id);// 获取指定实例EurekaHttpResponseInstanceInfo getInstance(String id);void shutdown(); }HttpReplicationClient 用于服务端和服务端之间进行通信在 EurekaHttpClient 的基础上封装了更新服务端实例状态、批量同步数据等操作。 public interface HttpReplicationClient extends EurekaHttpClient {// 更新服务端实例的状态EurekaHttpResponseVoid statusUpdate(String asgName, ASGStatus newStatus);// 向其他服务端批量同步数据EurekaHttpResponseReplicationListResponse submitBatchUpdates(ReplicationList replicationList); }Eureka 服务端集群节点是对等节点peerNode对等节点之间进行数据同步会产生循环问题和数据冲突问题。 对于循环问题Eureka 使用 Http 请求头 x-netflix-discovery-replication 表示是否是服务端同步数据操作如果是服务端同步数据就不会再继续向其他服务端进行同步数据。 // com.netflix.eureka.resources.InstanceResource PUT public Response renewLease(HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication,QueryParam(overriddenstatus) String overriddenStatus,QueryParam(status) String status,QueryParam(lastDirtyTimestamp) String lastDirtyTimestamp) {boolean isFromReplicaNode true.equals(isReplication);boolean isSuccess registry.renew(app.getName(), id, isFromReplicaNode);// ... }// com.netflix.eureka.registry.PeerAwareInstanceRegistryImpl private void replicateToPeers(Action action,String appName,String id,InstanceInfo info /* optional */,InstanceStatus newStatus /* optional */,boolean isReplication) {// ...// If it is a replication already,// do not replicate again as this will create a poison replicationif (peerEurekaNodes Collections.EMPTY_LIST || isReplication) {return;}// ... }对于数据冲突问题Eureka 通过比较 ReplicationInstance 类的 lastDirtyTimestamp 属性解决。lastDirtyTimestamp 是服务实例 InstanceInfo 的属性表示服务实例最近一次变更时间。 例如 Server A 向 Server B 同步数据 如果 Server A 的数据比 Server B 的新Server B 返回 Status.NOT_FOUNDServer A 重新将该服务实例注册到 Server B如果 Server A 的数据比 Server B 的旧Server B 返回 Status.CONFLICT要求 Server A 同步 Server B 的数据 // com.netflix.eureka.resources.InstanceResource # renewLease private Response validateDirtyTimestamp(Long lastDirtyTimestamp,boolean isReplication) {InstanceInfo appInfo registry.getInstanceByAppAndId(app.getName(), id, false);if (appInfo ! null) {if ((lastDirtyTimestamp ! null) (!lastDirtyTimestamp.equals(appInfo.getLastDirtyTimestamp()))) {Object[] args {id,appInfo.getLastDirtyTimestamp(),lastDirtyTimestamp,isReplication};if (lastDirtyTimestamp appInfo.getLastDirtyTimestamp()) {logger.debug(Time to sync, since the last dirty timestamp differs - ReplicationInstance id : {}, Registry: {} Incoming: {} Replication: {},args);return Response.status(Status.NOT_FOUND).build();} else if (appInfo.getLastDirtyTimestamp() lastDirtyTimestamp) {// In the case of replication, // send the current instance info in the registry // for the replicating node to sync itself with this one.if (isReplication) {logger.debug(Time to sync, since the last dirty timestamp differs - ReplicationInstance id : {}, Registry: {} Incoming: {} Replication: {},args);return Response.status(Status.CONFLICT).entity(appInfo).build();} else {return Response.ok().build();}}} // end if ((lastDirtyTimestamp ! null)}// end if (appInfo ! null)return Response.ok().build(); }抽象类 EurekaHttpClientDecorator 使用装饰者模式为 EurekaHttpClient 添加新的功能。 SessionedEurekaHttpClient 为 EurekaHttpClient 设置随机的会话时间超过会话时间则调用 EurekaHttpClientFactory 的 newClient 方法创建一个新的 EurekaHttpClient 执行请求。随机的会话时间在配置 sessionedClientReconnectIntervalSeconds 的 0.5-1.5 之间。 RetryableEurekaHttpClient 为 EurekaHttpClient 提供重试功能默认重试 3 次。当服务端响应异常时将服务端添加到 quarantineSet 中并从 ClusterResolver 解析得到的服务端列表中移除 quarantineSet 选择其他的服务端创建一个新的 EurekaHttpClient 执行请求超过重试次数则抛出 TransportException 异常。 RedirectingEurekaHttpClient 为 EurekaHttpClient 提供重定向功能默认可重定向次数 10 次。当服务端响应 302 时获取响应中的 targetUrl创建一个新的 EurekaHttpClient 执行请求超过重定向次数则抛出 TransportException 异常。 MetricsCollectingEurekaHttpClient 为 EurekaHttpClient 提供指标收集功能用于集成 Netflix Servo 监控组件统计各类型请求的耗时以及不同响应码和异常的计数。
http://www.w-s-a.com/news/561713/

相关文章:

  • 一个主机可以建设多少个网站山东高端网站建设
  • 长沙网站建设搭建网络营销做得好的公司
  • 如何做网站的后台管理石家庄seo关键词排名
  • 给自己公司做个网站山东做外贸网站的公司
  • 张家港网站建设培训江苏省建设工程网站系统
  • html个人网站桂林建站
  • 湛江网站优化快速排名wordpress文章页面宽度
  • 自己建网站怎么弄唯品会一家专门做特卖的网站
  • 做文化传播公司网站做搜狗pc网站点
  • 免费的黄冈网站有哪些平台可以聊天呢要查询一个网站在什么公司做的推广怎么查
  • 凡客建站登录入口网站建设先进部门评选标准
  • 响应式设计 手机网站政务中心建设网站
  • 如何做卖衣服的网站网站登录接口怎么做
  • 网站源码下载了属于侵权吗499全包网站建设
  • 怎样创建网站信息平台网络推广官网首页
  • 网站建设的课程网站 逻辑结构
  • 开通企业网站搬瓦工暗转wordpress
  • 成都网站建设有名的公司怎么做出有品牌感的网站
  • 中国网站的建设淘宝数据网站开发
  • 深圳建站网站模板wordpress 文章最长
  • 服务器建立网站建网站做seo
  • 帮人做彩票网站支付接口网上请人做软件的网站
  • 万全网站建设wl17581做旅游广告在哪个网站做效果好
  • 钢城网站建设安徽省住房和城乡建设厅网站
  • 协会网站建设方案大良营销网站建设好么
  • 网站引导页一般是什么格式网页设计师的应聘岗位
  • 构建网站空间网站开发与维护招聘
  • 网站建设的网页怎么做番禺网站开发哪家强
  • 网站开发是程序员吗百度网盘下载电脑版官方下载
  • 中国电力建设集团网站杭州网站运营