Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPRC Rest Exposed - how to make this into Micronaut? #1008

Open
krickert opened this issue Jan 24, 2025 · 0 comments
Open

GPRC Rest Exposed - how to make this into Micronaut? #1008

krickert opened this issue Jan 24, 2025 · 0 comments

Comments

@krickert
Copy link

Feature description

https://gitlab.com/ragsearch/pipelines/grpc-rest-exposed

I created a controller class that takes grpc services and exposes the service as a REST endpoint to take in a JSON representation of the grpc service. It works with all GRPC services you'd register and have a corresponding client exposed.

You just add @GrpcRestExposed to the grpc service and it will register it as part of an endpoint that takes a POST of JSON:

/api/{service_name}/{method}

And it uses the proto buf to json API by google.

It's pretty straightforward - and it's working.

But I'd like some feedback before I start documenting and adding tests to get this added into micronaut.

I find this useful because I can define a slew of services and then they'll have a REST endpoint exposed. I'd love to expand this to create the service definition, but for now this works fine.

Thoughts?

I'll be glad to go over more detail, but my thought is to define a grpc service and allow it to be called via gRPC, rest, or a kafka listener. This way you have a single service that performs 3 flexible ways. I didn't do the kafka part yet (I'd create a topic that matches the response name), but I plan to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant