-1 until we finish the discussion in another thread. The original problem we're trying to solve here is related to metrics, which will still be broken because of the service() method. Therefore, in the way the change is proposed, it doesn't fix the issue, but removes an existing performance optimization.
I will be happy to change my vote once we figure this out. -Val On Thu, Jan 20, 2022 at 4:28 AM Vladimir Steshin <vlads...@gmail.com> wrote: > Hi, Igniters. > > > Should we return a proxy even for local services by > 'IgniteServices#serviceProxy()'? > > *I vote +1*, let's return proxy. > > > This question has recently raised again. Before the service > metrics, we returned direct instance for local services. With service > metrics enabled, we return proxy. With the metrics disabled, we return > direct reference. > > Pros: > 1) Would match the method name - 'proxy'. Looks reasonable. > 2) Giving proxy every time, we won't change behavior depending on > user setting like 'ServiceConfiguration#setStatisticsEnabled()' > 3) There is a dedicated method for direct reference of local > service: 'IgniteServices#service()' > > Cons: > 4) Will break declarations like `MyServiceImpl svc = > serviceProxy(«myservice», IMyService.class);` without any change.