You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Joan Pujol <jo...@gmail.com> on 2022/10/20 14:11:54 UTC
Call an operation on all deployed remote services
Hi,
Is there a way that I can call a remote service method in all of the
nodes where the service is deployed?
A lot of thanks in advance.
--
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
Re: Call an operation on all deployed remote services
Posted by Joan Pujol <jo...@joanpujol.cat>.
Thank you very much Pavel.
I will check both possibilities. In that case I'm not concerned a lot
about performance, because it's not for normal operation.
It's just a way to retrieve some information on running services to
catch some information in case of problems.
Cheers,
On Thu, 20 Oct 2022 at 16:36, Pavel Tupitsyn <pt...@apache.org> wrote:
>
> Hi, there is no such method.
>
> I suggest using IgniteCompute.broadcast - it is the way to invoke some code on multiple nodes simultaneously.
>
> If you absolutely have to do this with services:
> 1. Call IgniteServices.serviceDescriptors
> 2. Find the right service in the resulting collection
> 3. Iterate over ServiceDescriptor.topologySnapshot
> 4. Obtain a service proxy for every node from 3: ignite.services(ignite.cluster().forNodeId(uuid)).serviceProxy(...)
> 5. Invoke the method on every proxy
>
> I don't recommend this though - not a right thing to do, and perf would not be good.
>
> Pavel
>
>
>
> On Thu, Oct 20, 2022 at 5:12 PM Joan Pujol <jo...@gmail.com> wrote:
>>
>> Hi,
>>
>> Is there a way that I can call a remote service method in all of the
>> nodes where the service is deployed?
>>
>> A lot of thanks in advance.
>>
>> --
>> Joan Jesús Pujol Espinar
>> http://www.joanpujol.cat
--
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
https://play.google.com/store/apps/developer?id=lujop&hl=ca
Re: Call an operation on all deployed remote services
Posted by Pavel Tupitsyn <pt...@apache.org>.
Hi, there is no such method.
I suggest using IgniteCompute.broadcast - it is the way to invoke some code
on multiple nodes simultaneously.
If you absolutely have to do this with services:
1. Call IgniteServices.serviceDescriptors
2. Find the right service in the resulting collection
3. Iterate over ServiceDescriptor.topologySnapshot
4. Obtain a service proxy for every node from 3:
ignite.services(ignite.cluster().forNodeId(uuid)).serviceProxy(...)
5. Invoke the method on every proxy
I don't recommend this though - not a right thing to do, and perf would not
be good.
Pavel
On Thu, Oct 20, 2022 at 5:12 PM Joan Pujol <jo...@gmail.com> wrote:
> Hi,
>
> Is there a way that I can call a remote service method in all of the
> nodes where the service is deployed?
>
> A lot of thanks in advance.
>
> --
> Joan Jesús Pujol Espinar
> http://www.joanpujol.cat
>