yiqixuespring

How ServiceInstanceListSuppliers is connected with Eureka server to get the registry list of microservices?

Spring Cloud LoadBalancer and Eureka How ServiceInstanceListSuppliers Connects to Eureka 🔗 Overview In a Spring Cloud microservices architecture using Eureka and Spring Cloud LoadBalancer, service discovery and load balancing involve the following flow: The Eureka Client registers services with the Eureka Server. The client keeps a local cache of the registry information from the server.

How ServiceInstanceListSuppliers is connected with Eureka server to get the registry list of microservices? Read More »

Spring Cloud 中自定义 FeignClient 负载均衡算法:加权随机示例

Spring Cloud 中自定义 FeignClient 负载均衡算法:加权随机示例 Spring Cloud 中自定义 FeignClient 负载均衡算法:加权随机示例 🧩 场景描述 本文将介绍如何在 Spring Cloud 2023+ 中,将 RestTemplate 替换为 FeignClient,并使用自定义的 加权随机负载均衡算法 实现服务实例选择。 1️⃣ 使用 FeignClient @FeignClient(name = “my-service”) public interface MyServiceClient { @GetMapping(“/api/hello”) String sayHello(); } 2️⃣ 实现 WeightedLoadBalancer public class WeightedLoadBalancer implements ReactorServiceInstanceLoadBalancer { private final ObjectProvider<ServiceInstanceListSupplier> serviceInstanceListSupplierProvider; private final String serviceId; public WeightedLoadBalancer(ObjectProvider<ServiceInstanceListSupplier>

Spring Cloud 中自定义 FeignClient 负载均衡算法:加权随机示例 Read More »

Spring Security – Individual Realm Access Control Spring Security – Ensuring Each Customer Accesses Only Their Realm Q: In a bank online app, every individual customer has their own sole realm. How can this requirement be satisfied with Spring’s role-based security mechanism? Spring’s role-based mechanism controls access to functionality like user vs. admin, but doesn’t

Read More »

What is Eureka REST API?

Eureka REST API in Spring Cloud Spring Cloud 中的 Eureka REST API 说明 🧩 什么是 Eureka REST API? 在 Spring Cloud 生态中,Eureka 是 Netflix 提供的一个服务注册与发现组件。 Eureka REST API 是 Eureka Server 提供的基于 HTTP 的接口,用于: 服务实例注册 服务心跳续约 服务下线注销 服务查询 Spring Cloud 已封装 Eureka 的调用逻辑,但我们也可以手动调用 REST API。 🔧 Eureka REST API 使用方式 1. 注册服务实例 POST /eureka/apps/{app-name} Content-Type:

What is Eureka REST API? Read More »

What is Idempotent? What is Idempotent? The term idempotent has a specific meaning depending on the context, but the core idea is the same: an operation is idempotent if performing it multiple times has the same effect as performing it once. In Programming An operation (e.g. a function or method) is idempotent if calling it

Read More »

How to Satisfy “Only-Access-Own-Realm” in Spring Security

In a banking application where each individual customer has their own realm of data (e.g., account info, transaction history), the traditional role-based security mechanism in Spring Security (e.g., ROLE_USER, ROLE_ADMIN) is not enough on its own to enforce access control at the data level. What Role-Based Security Does Well Role-based access in Spring Security is

How to Satisfy “Only-Access-Own-Realm” in Spring Security Read More »