{"id":37121729,"url":"https://github.com/workiva/thrift-nats","last_synced_at":"2026-01-14T14:00:49.561Z","repository":{"id":57525516,"uuid":"42884356","full_name":"Workiva/thrift-nats","owner":"Workiva","description":"A library that adds support for using NATS as a Thrift RPC transport.","archived":true,"fork":false,"pushed_at":"2016-10-25T15:38:53.000Z","size":64,"stargazers_count":14,"open_issues_count":3,"forks_count":2,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-06-21T04:26:29.757Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Workiva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-21T18:06:54.000Z","updated_at":"2024-02-06T04:19:15.000Z","dependencies_parsed_at":"2022-09-04T11:42:10.174Z","dependency_job_id":null,"html_url":"https://github.com/Workiva/thrift-nats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Workiva/thrift-nats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workiva%2Fthrift-nats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workiva%2Fthrift-nats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workiva%2Fthrift-nats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workiva%2Fthrift-nats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Workiva","download_url":"https://codeload.github.com/Workiva/thrift-nats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workiva%2Fthrift-nats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-14T14:00:48.708Z","updated_at":"2026-01-14T14:00:49.543Z","avatar_url":"https://github.com/Workiva.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# thrift-nats\n\n__Disclaimer: This repo is no longer maintained.__\n\nSupport for using [NATS](http://nats.io/) as a [Thrift](https://thrift.apache.org/) RPC transport.\n\n## Server Usage\n\n```go\noptions := nats.DefaultOptions\nconn, err := options.Connect()\nif err != nil {\n    panic(err)\n}\n\nvar (\n    transportFactory = thrift.NewTBufferedTransportFactory(8192)\n    protocolFactory  = thrift.NewTJSONProtocolFactory()\n    server           = thrift_nats.NewNATSServer(conn, \"my-service\", -1, 5*time.Second,\n        processor, transportFactory, protocolFactory)\n)\n\nif err := server.Serve(); err != nil {\n    panic(err)\n}\n```\n\n## Client Usage\n\n```go\noptions := nats.DefaultOptions\nconn, err := options.Connect()\nif err != nil {\n    panic(err)\n}\n\nvar (\n    transportFactory = thrift.NewTBufferedTransportFactory(8192)\n    protocolFactory  = thrift.NewTJSONProtocolFactory()\n)\n\ntransport, err := thrift_nats.NATSTransportFactory(conn, \"my-service\", time.Second, time.Second)\nif err != nil {\n    panic(err)\n}\ntransport = transportFactory.GetTransport(transport)\n\ndefer transport.Close()\nif err := transport.Open(); err != nil {\n    panic(err)\n}\n\nhandleClient(tutorial.NewCalculatorClientFactory(transport, protocolFactory))\n```\n\n## How It Works\n\nA thrift-nats server has a specified NATS subject which it listens on. A client publishes a handshake message on this subject containing the inbox it expects responses to requests on. The handshake is delivered round-robin to a server which then responds and provides an inbox for the client to send requests on and, optionally, a heartbeat deadline. The server then begins accepting requests on the inbox, and the client can begin sending requests. If a heartbeat deadline is specified, the client periodically emits a heartbeat telling the server that it's still alive within the specified interval. If the client misses more than three heartbeats, the server closes the client's session and attempts to signal the client of the disconnect. When the client transport is closed, it attempts to signal the server so the session can be closed. The heartbeat acts as a fail-safe in the event that the disconnect signal is missed by the server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkiva%2Fthrift-nats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkiva%2Fthrift-nats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkiva%2Fthrift-nats/lists"}