{"id":18733265,"url":"https://github.com/autom8ter/queuerpc","last_synced_at":"2025-08-22T08:10:53.492Z","repository":{"id":90303284,"uuid":"606550892","full_name":"autom8ter/queuerpc","owner":"autom8ter","description":"a protoc plugin to generate type safe RPC client and server code that use a message queue for transport/service discovery.","archived":false,"fork":false,"pushed_at":"2023-03-01T15:55:56.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-17T04:07:11.601Z","etag":null,"topics":["golang","message-queue","protobuf","protocol-buffer","pubsub"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autom8ter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-25T20:36:41.000Z","updated_at":"2023-03-05T06:10:30.000Z","dependencies_parsed_at":"2024-06-20T15:52:21.504Z","dependency_job_id":null,"html_url":"https://github.com/autom8ter/queuerpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/autom8ter/queuerpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fqueuerpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fqueuerpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fqueuerpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fqueuerpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autom8ter","download_url":"https://codeload.github.com/autom8ter/queuerpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fqueuerpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271606595,"owners_count":24788979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","message-queue","protobuf","protocol-buffer","pubsub"],"created_at":"2024-11-07T15:09:12.780Z","updated_at":"2025-08-22T08:10:53.451Z","avatar_url":"https://github.com/autom8ter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# queuerpc\n\na protoc plugin to generate type safe RPC client and server code that use a message queue for transport/service discovery.\n\n## Installation\n\n    go install github.com/autom8ter/queuerpc/protoc-gen-queuerpc\n    \n## Goals\n\nA protoc generator that feels like gRPC but communication between client and server happens over a message queue instead of http2.\n\n## Usage\n\nGiven the Following protobuf service definition:\n\n```protobuf\nsyntax = \"proto3\";\n\npackage echo.v1;\noption go_package = \"github.com/autom8ter/example/echo/v1\";\n\nmessage EchoRequest {\n  string message = 1;\n}\n\nmessage EchoResponse {\n  string message = 1;\n}\n\nservice EchoService {\n  // Echo returns the same message it receives.\n  rpc Echo(EchoRequest) returns (EchoResponse) {}\n  // EchoServerStream streams the same message it initially receives.\n  rpc EchoServerStream(EchoRequest) returns (stream EchoResponse) {}\n}\n```\n\na type safe client and server will be generated when using protoc-gen-queuerpc:\n\n```go\npackage v1\n\nimport \"context\"\nimport \"github.com/autom8ter/queuerpc\"\nimport \"github.com/golang/protobuf/proto\"\n\n// EchoServiceServer is a type safe RabbitMQ rpc server\ntype EchoServiceServer interface {\n\t// Echo returns the same message it receives.\n\tEcho(ctx context.Context, in *EchoRequest) (*EchoResponse, error)\n\t// EchoServerStream streams the same message it initially receives.\n\tEchoServerStream(ctx context.Context, in *EchoRequest) (\u003c-chan *EchoResponse, error)\n}\n\n// Serve starts the server and blocks until the context is canceled or the deadline is exceeded\nfunc Serve(srv queuerpc.IServer, handler EchoServiceServer) error {\n\treturn srv.Serve(queuerpc.Handlers{\n\t\tUnaryHandler: func(ctx context.Context, msg *queuerpc.Message) *queuerpc.Message {\n\t\t\tmeta := msg.Metadata\n\t\t\tswitch msg.Method {\n\t\t\tcase \"Echo\":\n\t\t\t\tvar in EchoRequest\n\t\t\t\tif err := proto.Unmarshal(msg.Body, \u0026in); err != nil {\n\t\t\t\t\treturn \u0026queuerpc.Message{\n\t\t\t\t\t\tId:       msg.Id,\n\t\t\t\t\t\tMethod:   msg.Method,\n\t\t\t\t\t\tMetadata: meta,\n\t\t\t\t\t\tError:    queuerpc.ErrUnmarshal,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tout, err := handler.Echo(queuerpc.NewContextWithMetadata(ctx, meta), \u0026in)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \u0026queuerpc.Message{\n\t\t\t\t\t\tId:       msg.Id,\n\t\t\t\t\t\tMethod:   msg.Method,\n\t\t\t\t\t\tMetadata: meta,\n\t\t\t\t\t\tError:    queuerpc.ErrorFrom(err),\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbody, err := proto.Marshal(out)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \u0026queuerpc.Message{\n\t\t\t\t\t\tId:       msg.Id,\n\t\t\t\t\t\tMethod:   msg.Method,\n\t\t\t\t\t\tMetadata: meta,\n\t\t\t\t\t\tError:    queuerpc.ErrMarshal,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn \u0026queuerpc.Message{\n\t\t\t\t\tId:       msg.Id,\n\t\t\t\t\tMethod:   msg.Method,\n\t\t\t\t\tMetadata: meta,\n\t\t\t\t\tBody:     body,\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \u0026queuerpc.Message{\n\t\t\t\tId:       msg.Id,\n\t\t\t\tMethod:   msg.Method,\n\t\t\t\tMetadata: meta,\n\t\t\t\tError:    queuerpc.ErrUnsupportedMethod,\n\t\t\t}\n\t\t},\n\t\tServerStreamHandler: func(ctx context.Context, msg *queuerpc.Message) (\u003c-chan *queuerpc.Message, error) {\n\t\t\tmeta := msg.Metadata\n\t\t\tch := make(chan *queuerpc.Message)\n\t\t\tswitch msg.Method {\n\t\t\tdefault:\n\t\t\t\treturn nil, queuerpc.ErrUnsupportedMethod\n\t\t\tcase \"EchoServerStream\":\n\t\t\t\tvar in EchoRequest\n\t\t\t\tif err := proto.Unmarshal(msg.Body, \u0026in); err != nil {\n\t\t\t\t\treturn nil, queuerpc.ErrUnmarshal\n\t\t\t\t}\n\t\t\t\tout, err := handler.EchoServerStream(queuerpc.NewContextWithMetadata(ctx, meta), \u0026in)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tgo func() {\n\t\t\t\t\tdefer close(ch)\n\t\t\t\t\tfor {\n\t\t\t\t\t\tselect {\n\t\t\t\t\t\tcase \u003c-ctx.Done():\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\tcase out, ok := \u003c-out:\n\t\t\t\t\t\t\tif !ok {\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbody, _ := proto.Marshal(out)\n\t\t\t\t\t\t\tch \u003c- \u0026queuerpc.Message{\n\t\t\t\t\t\t\t\tId:       msg.Id,\n\t\t\t\t\t\t\t\tMethod:   msg.Method,\n\t\t\t\t\t\t\t\tMetadata: meta,\n\t\t\t\t\t\t\t\tBody:     body,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}()\n\t\t\t\treturn ch, nil\n\t\t\t}\n\t\t},\n\t})\n}\n\n// EchoServiceClient is a type safe RabbitMQ rpc client\ntype EchoServiceClient struct {\n\tclient queuerpc.IClient\n}\n\n// NewEchoServiceClient returns a new EchoServiceClientwith the given rpc client\nfunc NewEchoServiceClient(client queuerpc.IClient) *EchoServiceClient {\n\treturn \u0026EchoServiceClient{client: client}\n}\n\n// Echo returns the same message it receives.\nfunc (c *EchoServiceClient) Echo(ctx context.Context, in *EchoRequest) (*EchoResponse, error) {\n\tmeta := queuerpc.MetadataFromContext(ctx)\n\tvar out EchoResponse\n\tbody, err := proto.Marshal(in)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmsg, err := c.client.Request(ctx, \u0026queuerpc.Message{Method: \"Echo\", Body: body, Metadata: meta})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif msg.Error != nil {\n\t\treturn nil, msg.Error\n\t}\n\tif err := proto.Unmarshal(msg.Body, \u0026out); err != nil {\n\t\treturn nil, err\n\t}\n\treturn \u0026out, nil\n}\n\n// EchoServerStream streams the same message it initially receives.\nfunc (c *EchoServiceClient) EchoServerStream(ctx context.Context, in *EchoRequest, handler func(*EchoResponse)) error {\n\tmeta := queuerpc.MetadataFromContext(ctx)\n\tbody, err := proto.Marshal(in)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.client.ServerStream(ctx, \u0026queuerpc.Message{Method: \"EchoServerStream\", Body: body, Metadata: meta}, func(msg *queuerpc.Message) {\n\t\tvar out EchoResponse\n\t\tif err := proto.Unmarshal(msg.Body, \u0026out); err != nil {\n\t\t\treturn\n\t\t}\n\t\thandler(\u0026out)\n\t})\n}\n\n```\n\nsee [example](example) for a full example of a client and server\nexample code generated using [Makefile](Makefile)\n\n## Limitations\n- only supports proto3\n- only supports unary and server streaming rpcs\n- only supports rabbitmq and nats as a transport (for now)\n- only supports generating clients and servers for go (for now)\n\n## TODO\n- [ ] kafka message queue provider\n- [x] nats message queue provider\n- [ ] google pubsub message queue provider\n- [ ] aws sqs message queue provider\n- [ ] redis message queue provider\n- [ ] client -\u003e server streaming support\n- [ ] bidirectional streaming support\n- [ ] support for generating an openapi proxy\n- [ ] typescript client/server code gen\n- [ ] rust client/server code gen\n- [ ] python client/server code gen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautom8ter%2Fqueuerpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautom8ter%2Fqueuerpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautom8ter%2Fqueuerpc/lists"}