Hi, Igniters.

I'd like to suggest modifying `/IgniteServices.serviceProxy(String name, Class<? super T> svcItf, boolean sticky)/` so that it may return proxy even for local service. Motivation: service metrics [1]. To measure method call we need to wrap service somehow. Also, the method name says `proxy`. For local one we return direct instance. Misleading.


Solutions:

1) Let’s return a proxy (`/GridServiceProxy/`) once we need. Let’s change the javadoc to say `@return Proxy over service’. Simply works.

Pros: invocation like `/MyServiceImpl svc = serviceProxy(«myservice», MyService.class)`/ would fail. Wierd usage to me. But possible.

2) Introduce a new method with forced-proxy flag like`IgniteSerives.serviceProxy(…, boolead focedProxy)`. And add a warning to other service-obtain methods like: «`/You enabled service metrics but it doesn’t work for local service instanse. Use forced-proxy serviceProxy(…, boolean forcedProxy)/` Pros: we’ve already have about 5-6 methods to get services in `/IgniteServices/`. I doubt we need one more.

3) Fix the documentation so that it tells the service metrics would work only with proxy. Pros: service metrics just won’t work for local services. Suddenly.


My vote is for #1: let's use a proxy. WDYT?


[1] https://issues.apache.org/jira/browse/IGNITE-12464

Reply via email to