You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ratis.apache.org by Anish Sneh <an...@gmail.com> on 2024/09/13 00:27:01 UTC
Adding One Custom GRPC Service to Ratis 3.1 Server
Hi team
Is it possible to add custom GRPC functionality lets say a custom service
HelloWorldService to Ratis GRPC server ?
Basically I need to add some extra endpoint for GRPC but want to run Ratis
Raft and custom service in same server and same port.
Kind regards
--
Anish Sneh
Re: Adding One Custom GRPC Service to Ratis 3.1 Server
Posted by Tsz Wo Sze <sz...@gmail.com>.
Hi Aish,
RATIS-2168 <https://issues.apache.org/jira/browse/RATIS-2168> is merged.
As an example of adding a custom service, see
https://github.com/apache/ratis/blob/master/ratis-test/src/test/java/org/apache/ratis/grpc/TestCustomGrpcServices.java
Tsz-Wo
On Sat, Oct 5, 2024 at 10:12 AM Anish Sneh <an...@gmail.com> wrote:
> Thanks Tsz, that's really helpful to add such feature.
> I am still in process of understanding the code, but love to contribute at
> some stage.
>
> Kind regards
>
> On Thu, Oct 3, 2024, 19:37 Tsz Wo Sze <sz...@gmail.com> wrote:
>
>> Filed https://issues.apache.org/jira/browse/RATIS-2168 "Support custom
>> gRPC services"
>>
>> Anish, thanks for the great idea!
>>
>> Tsz-Wo
>>
>> On Fri, Sep 13, 2024 at 2:06 PM Tsz Wo Sze <sz...@gmail.com> wrote:
>>
>>> Hi Anish,
>>>
>>> Currently, the Ratis GrpcService does not allow adding a custom gRPC
>>> service.
>>>
>>> Just have checked the code. It seems possible to add such a feature by
>>> passing a Consumer<NettyServerBuilder> object as a parameter (via the
>>> Parameters class) and apply the consumer to the NettyServerBuilder object
>>> in GrpcService constructor. Then, the consumer can add the custom gRPC
>>> service to NettyServerBuilder. Are you interested in contributing it?
>>>
>>> Tsz-Wo
>>>
>>>
>>>
>>> On Thu, Sep 12, 2024 at 5:27 PM Anish Sneh <an...@gmail.com>
>>> wrote:
>>>
>>>> Hi team
>>>>
>>>> Is it possible to add custom GRPC functionality lets say a custom
>>>> service HelloWorldService to Ratis GRPC server ?
>>>> Basically I need to add some extra endpoint for GRPC but want to run
>>>> Ratis Raft and custom service in same server and same port.
>>>>
>>>> Kind regards
>>>> --
>>>> Anish Sneh
>>>>
>>>
Re: Adding One Custom GRPC Service to Ratis 3.1 Server
Posted by Anish Sneh <an...@gmail.com>.
Thanks Tsz, that's really helpful to add such feature.
I am still in process of understanding the code, but love to contribute at
some stage.
Kind regards
On Thu, Oct 3, 2024, 19:37 Tsz Wo Sze <sz...@gmail.com> wrote:
> Filed https://issues.apache.org/jira/browse/RATIS-2168 "Support custom
> gRPC services"
>
> Anish, thanks for the great idea!
>
> Tsz-Wo
>
> On Fri, Sep 13, 2024 at 2:06 PM Tsz Wo Sze <sz...@gmail.com> wrote:
>
>> Hi Anish,
>>
>> Currently, the Ratis GrpcService does not allow adding a custom gRPC
>> service.
>>
>> Just have checked the code. It seems possible to add such a feature by
>> passing a Consumer<NettyServerBuilder> object as a parameter (via the
>> Parameters class) and apply the consumer to the NettyServerBuilder object
>> in GrpcService constructor. Then, the consumer can add the custom gRPC
>> service to NettyServerBuilder. Are you interested in contributing it?
>>
>> Tsz-Wo
>>
>>
>>
>> On Thu, Sep 12, 2024 at 5:27 PM Anish Sneh <an...@gmail.com>
>> wrote:
>>
>>> Hi team
>>>
>>> Is it possible to add custom GRPC functionality lets say a custom
>>> service HelloWorldService to Ratis GRPC server ?
>>> Basically I need to add some extra endpoint for GRPC but want to run
>>> Ratis Raft and custom service in same server and same port.
>>>
>>> Kind regards
>>> --
>>> Anish Sneh
>>>
>>
Re: Adding One Custom GRPC Service to Ratis 3.1 Server
Posted by Tsz Wo Sze <sz...@gmail.com>.
Filed https://issues.apache.org/jira/browse/RATIS-2168 "Support custom gRPC
services"
Anish, thanks for the great idea!
Tsz-Wo
On Fri, Sep 13, 2024 at 2:06 PM Tsz Wo Sze <sz...@gmail.com> wrote:
> Hi Anish,
>
> Currently, the Ratis GrpcService does not allow adding a custom gRPC
> service.
>
> Just have checked the code. It seems possible to add such a feature by
> passing a Consumer<NettyServerBuilder> object as a parameter (via the
> Parameters class) and apply the consumer to the NettyServerBuilder object
> in GrpcService constructor. Then, the consumer can add the custom gRPC
> service to NettyServerBuilder. Are you interested in contributing it?
>
> Tsz-Wo
>
>
>
> On Thu, Sep 12, 2024 at 5:27 PM Anish Sneh <an...@gmail.com> wrote:
>
>> Hi team
>>
>> Is it possible to add custom GRPC functionality lets say a custom service
>> HelloWorldService to Ratis GRPC server ?
>> Basically I need to add some extra endpoint for GRPC but want to run
>> Ratis Raft and custom service in same server and same port.
>>
>> Kind regards
>> --
>> Anish Sneh
>>
>
Re: Adding One Custom GRPC Service to Ratis 3.1 Server
Posted by Tsz Wo Sze <sz...@gmail.com>.
Hi Anish,
Currently, the Ratis GrpcService does not allow adding a custom gRPC
service.
Just have checked the code. It seems possible to add such a feature by
passing a Consumer<NettyServerBuilder> object as a parameter (via the
Parameters class) and apply the consumer to the NettyServerBuilder object
in GrpcService constructor. Then, the consumer can add the custom gRPC
service to NettyServerBuilder. Are you interested in contributing it?
Tsz-Wo
On Thu, Sep 12, 2024 at 5:27 PM Anish Sneh <an...@gmail.com> wrote:
> Hi team
>
> Is it possible to add custom GRPC functionality lets say a custom service
> HelloWorldService to Ratis GRPC server ?
> Basically I need to add some extra endpoint for GRPC but want to run Ratis
> Raft and custom service in same server and same port.
>
> Kind regards
> --
> Anish Sneh
>