简体   繁体   English

如何在Node.js中为发现的微服务进行客户端负载平衡

[英]How to do client side load balancing for discovered microservices in nodejs

We are trying to build a microservice with nodejs in an environment with other microservices written in java/spring boot. 我们正在尝试在具有Java / spring boot编写的其他微服务的环境中使用nodejs构建微服务。

The other microservices are using consul.io for service discovery and ribbon for client side load balancing. 其他微服务使用consul.io进行服务发现,并使用功能区进行客户端负载平衡。 (that would be: spring-boot, spring-cloud-starter-consul-discovery, spring-cloud-starter-feign and spring-cloud-starter-ribbon projects) (这将是:spring-boot,spring-cloud-starter-consul-discovery,spring-cloud-starter-feign和spring-cloud-starter-ribbon项目)

Now in this mix, we have a consul node module to register or discover services, but what of rest of the things? 现在,在这种混合中,我们有了一个consul节点模块来注册或发现服务,但是其余的事情呢? How do I do a discovery-aware rest call with a load balancing handled on the client, similar to that of ribbon. 我如何在客户端上处理负载均衡(类似于功能区),执行发现感知的休息呼叫。

How can I achieve this in node's stack? 如何在节点的堆栈中实现此目标?

Is this any use? 这有什么用吗? https://www.npmjs.com/package/resilient https://www.npmjs.com/package/resilient

It says: Resilient is conceptually similar to Ribbon, a Netflix's project. 它说:Resilient在概念上类似于Netflix的项目Ribbon。

I think I should just close this for now, it's been a while. 我想我应该暂时关闭它,已经有一段时间了。 Like I said in the comment above, I have built and used logical counterpart for Feign, Ribbon, with extensible support for service discovery frameworks (currently plugin available for consul.in), with different strategies for load balancing, and declarative API mapping like that of feign interfaces in spring boot, configurable retries, fluent API and support for hystrix. 就像我在上面的评论中所说,我已经为Feign,Ribbon构建并使用了逻辑副本,它对服务发现框架(当前可用于consul.in)提供可扩展的支持,并采用了不同的负载平衡策略和类似的声明性API映射。 Spring Boot中的伪接口,可配置的重试,流畅的API以及对hystrix的支持。 It's a family of node modules: https://www.npmjs.com/search?q=Sarathi 它是一系列节点模块: https : //www.npmjs.com/search?q=Sarathi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM