问题:TenantRoutingProperties 定义了配置但未被使用 解决方案: 1. TenantAwareLoadBalancer 注入 TenantRoutingProperties - 使用配置的 tenantHeader 名称 - 使用配置的 buildTenantGroup 方法 - 使用配置的 isSharedService 判断 - 使用配置的 isFallbackToShared 策略 2. 新增功能 - 支持 enabled=false 禁用租户路由 - 共享服务跳过租户过滤 - 可配置是否回退到共享实例 3. 更新测试适配新构造函数
77 lines
13 KiB
Plaintext
77 lines
13 KiB
Plaintext
2026-02-18 16:15:49.822 [background-preinit] [] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 8.0.1.Final
|
|
2026-02-18 16:15:50.469 [main] [] INFO com.fundplatform.receipt.ReceiptApplication - Starting ReceiptApplication v0.0.1-SNAPSHOT using Java 21 with PID 233189 (/home/along/MyCode/wanjiabuluo/fundplatform/fund-receipt/target/fund-receipt-0.0.1-SNAPSHOT.jar started by along in /home/along/MyCode/wanjiabuluo/fundplatform)
|
|
2026-02-18 16:15:50.482 [main] [] INFO com.fundplatform.receipt.ReceiptApplication - No active profile set, falling back to 1 default profile: "default"
|
|
2026-02-18 16:15:53.905 [main] [] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode
|
|
2026-02-18 16:15:53.916 [main] [] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
|
2026-02-18 16:15:53.984 [main] [] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 28 ms. Found 0 Redis repository interfaces.
|
|
2026-02-18 16:15:54.532 [main] [] INFO o.springframework.cloud.context.scope.GenericScope - BeanFactory id=fcf0e9f2-fd45-3572-8b47-6f65110f2c1c
|
|
2026-02-18 16:15:56.502 [main] [] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8150 (http)
|
|
2026-02-18 16:15:56.516 [main] [] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8150"]
|
|
2026-02-18 16:15:56.519 [main] [] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
|
2026-02-18 16:15:56.520 [main] [] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.16]
|
|
2026-02-18 16:15:56.595 [main] [] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
|
2026-02-18 16:15:56.596 [main] [] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 5805 ms
|
|
2026-02-18 16:16:01.382 [main] [] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8150"]
|
|
2026-02-18 16:16:01.432 [main] [] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8150 (http) with context path ''
|
|
2026-02-18 16:16:01.456 [main] [] INFO com.alibaba.nacos.client.naming - initializer namespace from ans.namespace attribute : null
|
|
2026-02-18 16:16:01.459 [main] [] INFO com.alibaba.nacos.client.naming - initializer namespace from ALIBABA_ALIWARE_NAMESPACE attribute :null
|
|
2026-02-18 16:16:01.461 [main] [] INFO com.alibaba.nacos.client.naming - initializer namespace from namespace attribute :null
|
|
2026-02-18 16:16:01.466 [Thread-3] [] INFO c.a.n.client.auth.ram.identify.CredentialWatcher - null No credential found
|
|
2026-02-18 16:16:01.527 [main] [] INFO com.alibaba.nacos.client.utils.ParamUtil - [settings] [req-serv] nacos-server port:8848
|
|
2026-02-18 16:16:01.527 [main] [] INFO com.alibaba.nacos.client.utils.ParamUtil - [settings] [http-client] connect timeout:1000
|
|
2026-02-18 16:16:01.529 [main] [] INFO com.alibaba.nacos.client.utils.ParamUtil - PER_TASK_CONFIG_SIZE: 3000.0
|
|
2026-02-18 16:16:01.538 [main] [] INFO c.a.n.p.auth.spi.client.ClientAuthPluginManager - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
|
2026-02-18 16:16:01.538 [main] [] INFO c.a.n.p.auth.spi.client.ClientAuthPluginManager - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
|
2026-02-18 16:16:01.565 [main] [] INFO com.alibaba.nacos.common.remote.client - [RpcClientFactory] create a new rpc client of 1587361e-d50c-47c1-81d0-2fb5e365ec6a
|
|
2026-02-18 16:16:01.621 [main] [] INFO com.alibaba.nacos.client.naming - Create naming rpc client for uuid->1587361e-d50c-47c1-81d0-2fb5e365ec6a
|
|
2026-02-18 16:16:01.622 [main] [] INFO com.alibaba.nacos.common.remote.client - [1587361e-d50c-47c1-81d0-2fb5e365ec6a] RpcClient init, ServerListFactory = com.alibaba.nacos.client.naming.core.ServerListManager
|
|
2026-02-18 16:16:01.623 [main] [] INFO com.alibaba.nacos.common.remote.client - [1587361e-d50c-47c1-81d0-2fb5e365ec6a] Registry connection listener to current client:com.alibaba.nacos.client.naming.remote.gprc.redo.NamingGrpcRedoService
|
|
2026-02-18 16:16:01.624 [main] [] INFO com.alibaba.nacos.common.remote.client - [1587361e-d50c-47c1-81d0-2fb5e365ec6a] Register server push request handler:com.alibaba.nacos.client.naming.remote.gprc.NamingPushRequestHandler
|
|
2026-02-18 16:16:01.629 [main] [] INFO com.alibaba.nacos.common.remote.client - [1587361e-d50c-47c1-81d0-2fb5e365ec6a] Try to connect to server on start up, server: {serverIp = 'localhost', server main port = 8848}
|
|
2026-02-18 16:16:01.700 [main] [] INFO c.a.nacos.common.remote.client.grpc.GrpcClient - grpc client connection server:localhost ip,serverPort:9848,grpcTslConfig:{"sslProvider":"","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
|
2026-02-18 16:16:03.393 [main] [] INFO c.a.n.common.ability.AbstractAbilityControlManager - Ready to get current node abilities...
|
|
2026-02-18 16:16:03.397 [main] [] INFO c.a.n.common.ability.AbstractAbilityControlManager - Ready to initialize current node abilities, support modes: [SDK_CLIENT]
|
|
2026-02-18 16:16:03.398 [main] [] INFO c.a.n.common.ability.AbstractAbilityControlManager - Initialize current abilities finish...
|
|
2026-02-18 16:16:03.399 [main] [] INFO c.a.n.c.ability.discover.NacosAbilityManagerHolder - [AbilityControlManager] Successfully initialize AbilityControlManager
|
|
2026-02-18 16:16:03.529 [main] [] INFO com.alibaba.nacos.common.remote.client - [1587361e-d50c-47c1-81d0-2fb5e365ec6a] Success to connect to server [localhost:8848] on start up, connectionId = 1771402563135_127.0.0.1_38262
|
|
2026-02-18 16:16:03.531 [main] [] INFO com.alibaba.nacos.common.remote.client - [1587361e-d50c-47c1-81d0-2fb5e365ec6a] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
|
2026-02-18 16:16:03.532 [main] [] INFO com.alibaba.nacos.common.remote.client - [1587361e-d50c-47c1-81d0-2fb5e365ec6a] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x000073b8a884e648
|
|
2026-02-18 16:16:03.532 [com.alibaba.nacos.client.remote.worker] [] INFO com.alibaba.nacos.common.remote.client - [1587361e-d50c-47c1-81d0-2fb5e365ec6a] Notify connected event to listeners.
|
|
2026-02-18 16:16:03.532 [com.alibaba.nacos.client.remote.worker] [] INFO com.alibaba.nacos.client.naming - Grpc connection connect
|
|
2026-02-18 16:16:03.535 [main] [] INFO com.alibaba.nacos.client.naming - [REGISTER-SERVICE] fund-platform registering service fund-receipt with instance Instance{instanceId='null', ip='10.244.21.185', port=8150, weight=1.0, healthy=true, enabled=true, ephemeral=true, clusterName='DEFAULT', serviceName='null', metadata={IPv6=[240e:424:de80:1a9:599:504b:b1cd:8e3b], preserved.register.source=SPRING_CLOUD}}
|
|
2026-02-18 16:16:03.586 [main] [] INFO c.a.cloud.nacos.registry.NacosServiceRegistry - nacos registry, DEFAULT_GROUP fund-receipt 10.244.21.185:8150 register finished
|
|
2026-02-18 16:16:03.700 [main] [] INFO com.fundplatform.receipt.ReceiptApplication - Started ReceiptApplication in 15.556 seconds (process running for 16.546)
|
|
2026-02-18 16:23:32.492 [http-nio-8150-exec-1] [] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
|
2026-02-18 16:23:32.493 [http-nio-8150-exec-1] [] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
|
|
2026-02-18 16:23:32.495 [http-nio-8150-exec-1] [] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 2 ms
|
|
2026-02-18 16:23:32.742 [http-nio-8150-exec-1] [] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
|
|
2026-02-18 16:23:33.511 [http-nio-8150-exec-1] [] INFO com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@62284901
|
|
2026-02-18 16:23:33.516 [http-nio-8150-exec-1] [] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
|
|
2026-02-18 17:21:07.074 [SpringApplicationShutdownHook] [] INFO c.a.cloud.nacos.registry.NacosServiceRegistry - De-registering from Nacos Server now...
|
|
2026-02-18 17:21:07.075 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - [DEREGISTER-SERVICE] fund-platform deregistering service fund-receipt with instance: Instance{instanceId='null', ip='10.244.21.185', port=8150, weight=1.0, healthy=true, enabled=true, ephemeral=true, clusterName='DEFAULT', serviceName='null', metadata={}}
|
|
2026-02-18 17:21:07.101 [SpringApplicationShutdownHook] [] INFO c.a.cloud.nacos.registry.NacosServiceRegistry - De-registration finished.
|
|
2026-02-18 17:21:07.102 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.cache.ServiceInfoHolder do shutdown begin
|
|
2026-02-18 17:21:07.108 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.backups.FailoverReactor do shutdown begin
|
|
2026-02-18 17:21:07.110 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.backups.FailoverReactor do shutdown stop
|
|
2026-02-18 17:21:07.110 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.cache.ServiceInfoHolder do shutdown stop
|
|
2026-02-18 17:21:07.111 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate do shutdown begin
|
|
2026-02-18 17:21:07.112 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.core.ServiceInfoUpdateService do shutdown begin
|
|
2026-02-18 17:21:07.112 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.core.ServiceInfoUpdateService do shutdown stop
|
|
2026-02-18 17:21:07.113 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.core.ServerListManager do shutdown begin
|
|
2026-02-18 17:21:07.118 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.core.ServerListManager do shutdown stop
|
|
2026-02-18 17:21:07.118 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.remote.http.NamingHttpClientProxy do shutdown begin
|
|
2026-02-18 17:21:07.121 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.remote.http.NamingHttpClientProxy do shutdown stop
|
|
2026-02-18 17:21:07.121 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - Shutdown naming grpc client proxy for uuid->1587361e-d50c-47c1-81d0-2fb5e365ec6a
|
|
2026-02-18 17:21:07.122 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - Shutdown grpc redo service executor java.util.concurrent.ScheduledThreadPoolExecutor@3f87780b[Running, pool size = 1, active threads = 0, queued tasks = 1, completed tasks = 1301]
|
|
2026-02-18 17:21:07.122 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.common.remote.client - Shutdown rpc client, set status to shutdown
|
|
2026-02-18 17:21:07.122 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.common.remote.client - Shutdown client event executor java.util.concurrent.ScheduledThreadPoolExecutor@4f9213d2[Running, pool size = 2, active threads = 2, queued tasks = 0, completed tasks = 0]
|
|
2026-02-18 17:21:07.122 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.common.remote.client - Close current connection 1771402563135_127.0.0.1_38262
|
|
2026-02-18 17:21:07.143 [nacos-grpc-client-executor-localhost-1112] [] INFO c.a.nacos.common.remote.client.grpc.GrpcClient - [1771402563135_127.0.0.1_38262]Ignore complete event,isRunning:false,isAbandon=false
|
|
2026-02-18 17:21:07.154 [SpringApplicationShutdownHook] [] INFO c.a.nacos.common.remote.client.grpc.GrpcClient - Shutdown grpc executor java.util.concurrent.ThreadPoolExecutor@60861e5d[Running, pool size = 5, active threads = 0, queued tasks = 0, completed tasks = 1113]
|
|
2026-02-18 17:21:07.156 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - shutdown and remove naming rpc client for uuid ->1587361e-d50c-47c1-81d0-2fb5e365ec6a
|
|
2026-02-18 17:21:07.157 [SpringApplicationShutdownHook] [] INFO c.a.n.client.auth.ram.identify.CredentialWatcher - [null] CredentialWatcher is stopped
|
|
2026-02-18 17:21:07.161 [SpringApplicationShutdownHook] [] INFO c.a.n.client.auth.ram.identify.CredentialService - [null] CredentialService is freed
|
|
2026-02-18 17:21:07.169 [SpringApplicationShutdownHook] [] INFO com.alibaba.nacos.client.naming - com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate do shutdown stop
|
|
2026-02-18 17:21:07.177 [SpringApplicationShutdownHook] [] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated...
|
|
2026-02-18 17:21:07.200 [SpringApplicationShutdownHook] [] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed.
|