weibocom / motan

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Other
5.88k stars 1.78k forks source link

How to initilaze motan RPC client lazily? #1019

Closed SimonLiuhd closed 1 year ago

SimonLiuhd commented 1 year ago

As the motan client, we have many interfaces as the referers in the spring xml file, but some remote services for the refered interfaces may not exist, since our business is to B, and we want to keep all interfaces in one page. How to avoid the heartbeats for the not needed interfaces? Can initilazing client lazily be the solution?

If it can, how to initilaze client lazily? Or is there other way to get the target that it does not heartbeat for the interfaces which have not services to connect? If there is not configuration for it, where the source code we can mofify to achive it?

Thanks a lot.

SimonLiuhd commented 1 year ago

I did not describle it well, what we need it is initilazing motan RPC connection (the channel) lazily. Created another one protocol's lazyInit attribute does not take effect under motan-transport-netty4 for it. Close this one.