# code-with-quarkus **Repository Path**: sideme/code-with-quarkus ## Basic Information - **Project Name**: code-with-quarkus - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-08-02 - **Last Updated**: 2024-08-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 整合nacos2.4.0 1. 下载nacos2.4.0 2. 配置nacos2.4.0 3. 启动nacos2.4.0 注意 application.properties 文件中的配置 quarkus.rest-client.petty2-api.url=http://finance-backend 其中 finance-backend 可以是服务名字 用来注册到nacos中 AppInit 该类监听启动和停止,在启动时候将本服务注册到nacos中,在停止时候将本服务从nacos中注销,同时监听服务的状态,服务实例存储在 Constant.NACOS_INSTANCE_MAP中,MyClientRequestFilter该类通过@Provider 注解将自己注册为请求拦截器,拦截每次请求,如果 匹配到服务的url,则从Constant.NACOS_INSTANCE_MAP中获取服务实例,替换服务的ip地址和端口号,达到动态服务中心的路由目的,与openfen 功能类似。 没有实现配置中心的功能,原理是类似的AppInit 中的NamingService已经配置为bean,可以按需要自己注入。