[
https://issues.apache.org/jira/browse/IGNITE-12754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17110029#comment-17110029
]
Aleksey Plekhanov commented on IGNITE-12754:
--------------------------------------------
[~ptupitsyn] I have plans to implement service invocation in java thin client.
I've already implemented a PoC and want to discuss some details.
When invoking a service method from thin client we should pass to the server at
least: service name, interface name, timeout, nodes set, method name and args
(sticky flag is useless since we always will create a new proxy for each
request). Methods of some interface can be overloaded. In .Net thick client
implementation there is a method used that helps to find an appropriate service
method to invoke: PlatformServices.ServiceProxyHolder#getMethod. But since we
use here only args values sometimes we can get an error for overloaded methods,
for example, if you have an interface like:
{code:java}
public interface TestServiceInterface {
public String testMethod(String val);
public String testMethod(Object val);
}
{code}
And invoke service like:
{code:java}
Object arg = null;
svc.testMethod(arg);{code}
Java will resolve the correct method to call on client-side, but using only arg
value it's impossible to get exactly one method on the server-side and there
will be error: Ambiguous proxy method 'testMethod'
To solve this problem we can pass full method signature instead of method name.
Or we can additionally pass argument types to find exactly one method by
{{getMethod(String name, Class<?>... parameterTypes)}}. Also, we can support
two approaches at the same time: simple method name to simplify the
implementation of non-java thin clients, and full method signature to deal with
overloaded methods.
What do you think about it?
Should we discuss this on dev-list?
> .NET: Thin Client: Service invocation
> -------------------------------------
>
> Key: IGNITE-12754
> URL: https://issues.apache.org/jira/browse/IGNITE-12754
> Project: Ignite
> Issue Type: Bug
> Components: platforms
> Reporter: Pavel Tupitsyn
> Assignee: Pavel Tupitsyn
> Priority: Major
> Labels: .NET
> Fix For: 2.9
>
>
> Provide an API to invoke Ignite Services from Thin Clients.
> .NET API:
> {code}
> IIgniteClient.GetServices().GetServiceProxy<IFoo>("name").Bar();
> {code}
> Thin Client protocol:
> * One operation, OP_SERVICE_INVOKE
> * Takes service name, method name, optionally node ids (cluster projection),
> 0..n args
> See PlatformServices, we just have to combine OP_SERVICE_PROXY with OP_INVOKE
> from there in one call.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)