如何为nodejs中发现的微服务进行客户端负载均衡

时间:2021-07-24 03:41:45

We are trying to build a microservice with nodejs in an environment with other microservices written in java/spring boot.

我们正在尝试在一个环境中使用nodejs构建一个微服务,并使用java/spring boot编写其他微服务。

The other microservices are using consul.io for service discovery and ribbon for client side load balancing. (that would be: spring-boot, spring-cloud-starter-consul-discovery, spring-cloud-starter-feign and spring-cloud-starter-ribbon projects)

其他的微服务是使用领事。用于服务发现的io和用于客户端负载平衡的ribbon。(那将是:春季启动,春季启动-咨询-发现,春季启动-启动-假装,春季启动-云启动-丝带项目)

Now in this mix, we have a consul node module to register or discover services, but what of rest of the things? How do I do a discovery-aware rest call with a load balancing handled on the client, similar to that of ribbon.

现在,我们有一个领事节点模块来注册或发现服务,但是其他的呢?我如何在客户端处理一个类似于ribbon的负载平衡时,进行发现性rest调用。

How can I achieve this in node's stack?

如何在node的堆栈中实现这一点?

2 个解决方案

#1


2  

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.

它说:弹性在概念上与Netflix的一个项目Ribbon相似。

#2


0  

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. It's a family of node modules: https://www.npmjs.com/search?q=Sarathi

我想我现在应该把它关掉,已经有一段时间了。就像我说的在上面的评论中,我建立了逻辑对应用于假装,丝带,可扩展支持服务发现框架(目前插件用于consul.in),不同的负载平衡策略,和声明式API映射在春天这样假装接口启动,可配置重试,流利hystrix API和支持。它是一个节点模块家族:https://www.npmjs.com/search?

#1


2  

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.

它说:弹性在概念上与Netflix的一个项目Ribbon相似。

#2


0  

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. It's a family of node modules: https://www.npmjs.com/search?q=Sarathi

我想我现在应该把它关掉,已经有一段时间了。就像我说的在上面的评论中,我建立了逻辑对应用于假装,丝带,可扩展支持服务发现框架(目前插件用于consul.in),不同的负载平衡策略,和声明式API映射在春天这样假装接口启动,可配置重试,流利hystrix API和支持。它是一个节点模块家族:https://www.npmjs.com/search?