Data compatibility configuration method and device based on feign interface and medium

By rewriting Spring Boot's scanning and registration class, obtaining and rewriting the parameter values ​​in the FeignClient annotation, we can achieve compatible configuration of the Feign interface's service name and real address. This solves the configuration complexity problem of Feign remote calls in different environments and improves the efficiency of microservice development.

CN115629799BActive Publication Date: 2026-07-07SHENZHEN YLINK COMPUTING SYST

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN YLINK COMPUTING SYST
Filing Date
2022-10-26
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Feign remote calls in Java microservice development cannot simultaneously support API calls within the same registry center and API calls across registry centers. When the environment changes, the code needs to be modified and recompiled, packaged, and deployed, resulting in a complex and inefficient configuration process.

Method used

Rewrite the Spring Boot scanning and registration class, obtain the name and url parameter values ​​from the FeignClient annotation through the target scanning and registration class, rewrite according to the parameter type, generate a new SpringBean and register it in the Spring environment to achieve compatible configuration of service name and real address.

Benefits of technology

No service code needs to be modified when the environment changes, simplifying the process of handling configuration changes, improving the efficiency of microservice development, and supporting compatible calls within the same registry center and across registry centers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115629799B_ABST
    Figure CN115629799B_ABST
Patent Text Reader

Abstract

This invention discloses a data compatibility configuration method, device, and medium based on the Feign interface. The method includes: rewriting the original scanning registration class to obtain a target scanning registration class; when an interface identified by FeignClient is scanned, obtaining the name parameter value and url parameter value filled in the FeignClient annotation through the target scanning registration class; rewriting the parameter values ​​according to their types to obtain a new SpringBean, and registering it in the Spring environment context. Compared with existing technologies, this invention uses a single url parameter to configure both the service name and the IP port address, achieving compatibility for two scenarios. When the environment changes, it eliminates the need to perform the service code modification → recompile and package → deployment process, thereby simplifying the configuration change handling process and improving service development efficiency.
Need to check novelty before this filing date? Find Prior Art