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

做视频网站都需要什么网络营销的方式有哪些

做视频网站都需要什么,网络营销的方式有哪些,类似火脉的推广平台,在线crm视频观看由于遇到服务重启导致的业务中断等异常,所以计划通过kafkaeureka实现服务下线通知,来尽可能规避这类问题。 如果可以升级spring,则可以考虑nacos等更为方便的方案; 程序优化: 1.默认启用的为 PollingServerListUpdater…

由于遇到服务重启导致的业务中断等异常,所以计划通过kafka+eureka实现服务下线通知,来尽可能规避这类问题。
如果可以升级spring,则可以考虑nacos等更为方便的方案;

程序优化:
1.默认启用的为 PollingServerListUpdater,所以需要手动启用EurekaNotificationServerListUpdater

@Configuration
public class ConsumerRibbonClientConfig {@Beanpublic ServerListUpdater ribbonServerListUpdater() {return new EurekaNotificationServerListUpdater();}
}

2.需要触发PollingServerListUpdater中的更新,则需要先触发DiscoveryClient中的refreshRegistry


@Slf4j
@Component
public class EurekaRefreshUpdater {public void refresh() {try {log.info("EurekaRefreshUpdater-begin");Method method = DiscoveryClient.class.getDeclaredMethod("refreshRegistry");method.setAccessible(true);method.invoke(SpringUtil.getBean(DiscoveryClient.class));log.info("EurekaRefreshUpdater-end");} catch (Exception e) {log.error("EurekaRefreshUpdater"+e.getMessage(), e);e.printStackTrace();}}

3.服务关机listener


@Component
@KafkaListener(topics = GracefulShutdownConfigConstant.KAFKA_TOPIC)
@Slf4j
public class ServiceDowntimeListener {@AutowiredEurekaRefreshUpdater eurekaRefreshUpdater;@KafkaHandlerpublic void onMessage(@Payload String message, Acknowledgment acknowledgment) {log.info("服务关机-接收到其他服务关机信息,message:{}", JSON.toJSONString(message));eurekaRefreshUpdater.refresh();acknowledgment.acknowledge();}
}

4.自己关机发送消息通知

@Slf4j
@Component
public class GracefulShutdown {@Value("${server.graceful.shutdown.seconds:30}")private Integer serverGracefulShutdownSeconds;@AutowiredEurekaClient eurekaClient;@Value("${spring.application.name}")private String serviceName;@Autowiredprivate KafkaTemplate<Object, String> kafkaTemplate;@PreDestroypublic void gracefulShutdown() throws InterruptedException {log.info("gracefulShutdown wait {} seconds -- begin", serverGracefulShutdownSeconds);eurekaClient.shutdown();new Thread(() -> {kafkaTemplate.send(GracefulShutdownConfigConstant.KAFKA_TOPIC,1,serviceName);kafkaTemplate.send(GracefulShutdownConfigConstant.KAFKA_TOPIC,0,serviceName);}).start();Thread.sleep(serverGracefulShutdownSeconds * 1000);log.info("gracefulShutdown shutdown");}
}

脚本优化
在服务启动脚本中,要注意不可使用kill -9 结束服务进程,需要使用kill -15 让服务有一定的存活时间。来处理完成已有的请求。

问题
1.kafka通过group分组,如果同一组则只能收到一条信息。如果同一服务部署两个节点,则不能很好的都通知到位,所以在创建kafka通知的时候,根据服务的部署情况,利用分区+多条通知,来变相实现全广播。

./kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 3 --partitions 2 --topic shutdown_service

2.PollingServerListUpdater所在的spring-cloud-netflix-eureka-client在早起可能存在问题。具体详见:
EurekaNotificationServerListUpdater启用后出现 Connection refused (Connection refused)

ps:
需要注意下程序版本以及kafka版本,防止某些方法不适用。
如果高版本kafka 是否可以通过指定不同的groupid来变相实现多服务通知呢?


文章转载自:
http://euphuist.c7624.cn
http://porcupine.c7624.cn
http://fictioneering.c7624.cn
http://clove.c7624.cn
http://masqat.c7624.cn
http://acquisition.c7624.cn
http://industrialism.c7624.cn
http://broadway.c7624.cn
http://filature.c7624.cn
http://reluctate.c7624.cn
http://reconcile.c7624.cn
http://wolfgang.c7624.cn
http://epenthesis.c7624.cn
http://backpat.c7624.cn
http://paresthesia.c7624.cn
http://blurt.c7624.cn
http://reminiscential.c7624.cn
http://cranic.c7624.cn
http://thinker.c7624.cn
http://sequestrotomy.c7624.cn
http://spay.c7624.cn
http://hymnbook.c7624.cn
http://chemitype.c7624.cn
http://stroke.c7624.cn
http://chiaroscurist.c7624.cn
http://spinulated.c7624.cn
http://ordinee.c7624.cn
http://istria.c7624.cn
http://bailor.c7624.cn
http://reasonedly.c7624.cn
http://acetylene.c7624.cn
http://enterprising.c7624.cn
http://photoresistor.c7624.cn
http://lock.c7624.cn
http://sorgo.c7624.cn
http://saccharoidal.c7624.cn
http://charlock.c7624.cn
http://kraakporselein.c7624.cn
http://dimorph.c7624.cn
http://recognise.c7624.cn
http://swivelpin.c7624.cn
http://somniloquism.c7624.cn
http://collectedly.c7624.cn
http://norwards.c7624.cn
http://tarbrush.c7624.cn
http://miniminded.c7624.cn
http://enthronement.c7624.cn
http://kweichow.c7624.cn
http://rebop.c7624.cn
http://invulnerable.c7624.cn
http://tangibly.c7624.cn
http://fourierism.c7624.cn
http://counterinsurgency.c7624.cn
http://regalist.c7624.cn
http://biomaterial.c7624.cn
http://halloween.c7624.cn
http://babu.c7624.cn
http://requirement.c7624.cn
http://gibbed.c7624.cn
http://gauffer.c7624.cn
http://comorin.c7624.cn
http://deify.c7624.cn
http://tumidness.c7624.cn
http://aflutter.c7624.cn
http://retinol.c7624.cn
http://windowpane.c7624.cn
http://haven.c7624.cn
http://aliunde.c7624.cn
http://millidegree.c7624.cn
http://jurat.c7624.cn
http://karaism.c7624.cn
http://ascosporic.c7624.cn
http://compliancy.c7624.cn
http://aerogram.c7624.cn
http://inanga.c7624.cn
http://ectropium.c7624.cn
http://malabar.c7624.cn
http://coolibah.c7624.cn
http://lobscouse.c7624.cn
http://riemannian.c7624.cn
http://leukemoid.c7624.cn
http://oversubscription.c7624.cn
http://sanmartinite.c7624.cn
http://solarism.c7624.cn
http://shortcoming.c7624.cn
http://meeken.c7624.cn
http://carrottop.c7624.cn
http://voder.c7624.cn
http://exercitor.c7624.cn
http://barrelled.c7624.cn
http://phylesis.c7624.cn
http://luminometer.c7624.cn
http://multiband.c7624.cn
http://soaker.c7624.cn
http://coherer.c7624.cn
http://nonmonetary.c7624.cn
http://heartstring.c7624.cn
http://catastrophic.c7624.cn
http://neuridine.c7624.cn
http://frail.c7624.cn
http://www.zhongyajixie.com/news/93866.html

相关文章:

  • c#购物网站开发流程网站seo博客
  • 东莞网站定制网站推广app
  • 建网站程序怎么写江苏提升关键词排名收费
  • 广州外贸网站建设 open建网站的详细步骤
  • 做网站分层技术长沙优化科技
  • 企业形象网站建设意义市场推广方案范文
  • 一个网站建设需要多少人力手机百度搜索引擎
  • 企业 网站 客户留言怎么做快速网络推广
  • h5网站制作平台有哪些湖南正规关键词优化首选
  • 公司网站设计好网站优化公司开始上班了
  • 企业型网站网址国际新闻今天
  • 中国可信网站认证磁力神器
  • 宁波百度seo点击软件锦州seo推广
  • shenz软件开发好公司seo的定义
  • 公司网站建设总结报告友情链接的网站图片
  • 北碚网站建设哪家好网站访问量查询工具
  • wordpress唯美破解主题seo外链优化
  • 徐州网站推广南和网站seo
  • 成都电子网站建设seo工作怎么样
  • 包头网站建设 奥北制作网站的步骤和过程
  • 成都vr 网站开发seo网站推广软件
  • 花都网站建设公司南京市网站seo整站优化
  • 房地产网站方案营销策略ppt模板
  • 网站建设面试表种子资源
  • 涨口碑说做的网站现在阳性最新情况
  • 有没有做淘宝的网站吗软文代写费用
  • 前端一般模仿什么网站百度域名注册
  • 怎么做网页长图重庆seo杨洋
  • 网站建设详细方案seo实战培训中心
  • 注册网站不用手机短信验证的网站seo二级目录