{"id":19865633,"url":"https://github.com/openfaas/nats-connector","last_synced_at":"2025-05-02T05:31:46.405Z","repository":{"id":42372522,"uuid":"158574940","full_name":"openfaas/nats-connector","owner":"openfaas","description":"An OpenFaaS event-connector to trigger functions from NATS","archived":false,"fork":false,"pushed_at":"2023-11-17T12:23:02.000Z","size":339,"stargazers_count":42,"open_issues_count":4,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T23:06:01.568Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfaas.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-21T16:13:28.000Z","updated_at":"2025-02-11T21:31:11.000Z","dependencies_parsed_at":"2024-06-21T19:18:37.683Z","dependency_job_id":"8a128c86-d177-4322-bb55-21a548553c98","html_url":"https://github.com/openfaas/nats-connector","commit_stats":null,"previous_names":["openfaas-incubator/nats-connector"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fnats-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fnats-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fnats-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fnats-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfaas","download_url":"https://codeload.github.com/openfaas/nats-connector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251992916,"owners_count":21677022,"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","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":"2024-11-12T15:23:31.054Z","updated_at":"2025-05-02T05:31:41.396Z","avatar_url":"https://github.com/openfaas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nats-connector\n\n[![build](https://github.com/openfaas/nats-connector/actions/workflows/build.yml/badge.svg)](https://github.com/openfaas/nats-connector/actions/workflows/build.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/openfaas-incubator/nats-connector)](https://goreportcard.com/report/github.com/openfaas-incubator/nats-connector)\n[![GoDoc](https://godoc.org/github.com/openfaas-incubator/nats-connector?status.svg)](https://godoc.org/github.com/openfaas-incubator/nats-connector)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![OpenFaaS](https://img.shields.io/badge/openfaas-serverless-blue.svg)](https://www.openfaas.com)\n\nAn OpenFaaS event-connector to trigger functions from NATS Core pub/sub topics.\n\n## Is the nats-connector or JetStream for OpenFaaS right for you?\n\n\u003e At most once QoS: Core NATS offers an at most once quality of service. If a subscriber is not listening on the subject (no subject match), or is not active when the message is sent, the message is not received. This is the same level of guarantee that TCP/IP provides. Core NATS is a fire-and-forget messaging system. It will only hold messages in memory and will never write messages directly to disk.\n\n[From the NATS docs](https://docs.nats.io/nats-concepts/what-is-nats)\n\nIf no nats-connector is available at the time of a message being published, it will not be delivered to any functions. Likewise, if the function is unavailable or crashing, it will not receive the message. NATS Core has no durability.\n\nFor production and commercial use, see: [JetStream for OpenFaaS](https://www.openfaas.com/blog/jetstream-for-openfaas/)\n\n## Quick start\n\n### Deploy the connector to faasd\n\nSee the [eBook Serverless For Everyone Else](https://openfaas.gumroad.com/l/serverless-for-everyone-else) for instructions and sample YAML to add to your faasd host.\n\n### Or deploy the connector to Kubernetes\n\n1. Deploy the connector using arkade\n\n   ```bash\n   arkade install nats-connector\n   ```\n\n   Alternatively, see [the Helm chart](https://github.com/openfaas/faas-netes/tree/master/chart/nats-connector)\n\n2. Deploy the two test functions\n\n   ```bash\n   git clone https://github.com/openfaas/nats-connector --depth=1\n   cd nats-connector/contrib/test-functions\n   ```\n\n   Deploy the functions using `stack.yml`, see how the `receive-message` function has the `topic=nats-test` annotation? That's how a function binds itself to a particular *NATS Subject*.\n\n   ```bash\n   faas-cli template pull stack\n   faas-cli deploy\n   ```\n\n3. Now publish a message on the `nats-test` topic. \n\n   Invoke the publisher\n   ```bash\n   faas-cli invoke publish-message \u003c\u003c\u003c \"test message\"\n   ```\n\n4. Verify that the receiver was invoked by checking the logs\n\n   ```bash\n   faas-cli logs receive-message\n\n   2019-12-29T19:06:50Z 2019/12/29 19:06:50 received \"test message\"\n   ```\n\n### Configuration\n\nConfiguration of the binary is by environment variable. The names vary for the values.yaml file in [the Helm chart](https://github.com/openfaas/faas-netes/tree/master/chart/nats-connector).\n\n| Variable             | Description                   |  Default                                        |\n| -------------------- | ------------------------------|--------------------------------------------------|\n| `topics`             | Delimited list of topics    |  `nats-test,`                                   |\n| `broker_host`        | The host, but not the port for NATS | `nats` |\n| `async_invocation`   | Queue the invocation with the built-in OpenFaaS queue-worker and return immediately    |  `false` |\n| `gateway_url`        | The URL for the OpenFaaS gateway | `http://gateway:8080` |\n| `upstream_timeout`   | Timeout to wait for synchronous invocations | `60s` |\n| `rebuild_interval`   | Interval at which to rebuild the map of topics \u003c\u003e functions | `5s`  |\n| `topic_delimiter`    | Used to separate items in `topics` variable | `,` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfaas%2Fnats-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfaas%2Fnats-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfaas%2Fnats-connector/lists"}