{"id":13413381,"url":"https://github.com/kak-tus/ami","last_synced_at":"2026-03-10T03:34:21.025Z","repository":{"id":144201722,"uuid":"154952533","full_name":"kak-tus/ami","owner":"kak-tus","description":"Go client to reliable queues based on Redis Cluster Streams","archived":false,"fork":false,"pushed_at":"2020-04-02T22:56:51.000Z","size":160,"stargazers_count":33,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T01:41:33.697Z","etag":null,"topics":["go","redis","streams"],"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/kak-tus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-10-27T10:38:16.000Z","updated_at":"2025-07-12T05:04:54.000Z","dependencies_parsed_at":"2023-06-18T04:30:35.085Z","dependency_job_id":null,"html_url":"https://github.com/kak-tus/ami","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/kak-tus/ami","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Fami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Fami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Fami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Fami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kak-tus","download_url":"https://codeload.github.com/kak-tus/ami/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kak-tus%2Fami/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30323230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"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":["go","redis","streams"],"created_at":"2024-07-30T20:01:39.023Z","updated_at":"2026-03-10T03:34:21.002Z","avatar_url":"https://github.com/kak-tus.png","language":"Go","funding_links":[],"categories":["Messaging","消息","Relational Databases","消息系统","Go","机器学习"],"sub_categories":["Search and Analytic Databases","检索及分析资料库","Advanced Console UIs","SQL 查询语句构建库"],"readme":"# Ami\n\nGo client to reliable queues based on [Redis Cluster Streams](https://redis.io/topics/streams-intro).\n\n[![Godoc](https://godoc.org/github.com/kak-tus/ami?status.svg)](http://godoc.org/github.com/kak-tus/ami)\n[![Coverage Status](https://coveralls.io/repos/github/kak-tus/ami/badge.svg)](https://coveralls.io/github/kak-tus/ami)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kak-tus/ami)](https://goreportcard.com/report/github.com/kak-tus/ami)\n![Go](https://github.com/kak-tus/ami/workflows/Go/badge.svg)\n\n## Consume/produce performance\n\nPerformance is dependent from:\n- Redis Cluster nodes count;\n- ping RTT from client to Redis Cluster master nodes;\n- network speed between nodes;\n- message sizes;\n- Ami configuration.\n\nAs example, 10-nodes Redis Cluster with half of nodes in other datacenter (50 msec ping), 1 master/1 slave, with message \"{}\" got:\n```\n$ go run examples/performance/main.go\nProduced 1000000 in 3.423883 sec, rps 292066.022156\nConsumed 151000 in 1.049238 sec, rps 143913.931722\nAcked 151000 in 0.973587 sec, rps 155096.612263\n```\n\n## Producer example\n\n```\n\ttype errorLogger struct{}\n\n\tfunc (l *errorLogger) AmiError(err error) {\n\t\tprintln(\"Got error from Ami:\", err.Error())\n\t}\n\n\tpr, err := ami.NewProducer(\n\t\tami.ProducerOptions{\n\t\t\tErrorNotifier:     \u0026errorLogger{},\n\t\t\tName:              \"ruthie\",\n\t\t\tPendingBufferSize: 10000000,\n\t\t\tPipeBufferSize:    50000,\n\t\t\tPipePeriod:        time.Microsecond * 1000,\n\t\t\tShardsCount:       10,\n\t\t},\n\t\t\u0026redis.ClusterOptions{\n\t\t\tAddrs:        []string{\"172.17.0.1:7001\", \"172.17.0.1:7002\"},\n\t\t\tReadTimeout:  time.Second * 60,\n\t\t\tWriteTimeout: time.Second * 60,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor i := 0; i \u003c 10000; i++ {\n\t\tpr.Send(\"{}\")\n\t}\n\n\tpr.Close()\n```\n\n## Consumer example\n\n```\n\ttype errorLogger struct{}\n\n\tfunc (l *errorLogger) AmiError(err error) {\n\t\tprintln(\"Got error from Ami:\", err.Error())\n\t}\n\n\tcn, err := ami.NewConsumer(\n\t\tami.ConsumerOptions{\n\t\t\tConsumer:          \"alice\",\n\t\t\tErrorNotifier:     \u0026errorLogger{},\n\t\t\tName:              \"ruthie\",\n\t\t\tPendingBufferSize: 10000000,\n\t\t\tPipeBufferSize:    50000,\n\t\t\tPipePeriod:        time.Microsecond * 1000,\n\t\t\tPrefetchCount:     100,\n\t\t\tShardsCount:       10,\n\t\t},\n\t\t\u0026redis.ClusterOptions{\n\t\t\tAddrs:        []string{\"172.17.0.1:7001\", \"172.17.0.1:7002\"},\n\t\t\tReadTimeout:  time.Second * 60,\n\t\t\tWriteTimeout: time.Second * 60,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tc := cn.Start()\n\n\twg := sync.WaitGroup{}\n\twg.Add(1)\n\n\tgo func() {\n\t\tfor {\n\t\t\tm, more := \u003c-c\n\t\t\tif !more {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tprintln(\"Got\", m.Body, \"ID\", m.ID)\n\t\t\tcn.Ack(m)\n\t\t}\n\t\twg.Done()\n\t}()\n\n\ttime.Sleep(time.Second)\n\n\tcn.Stop()\n\twg.Wait()\n\n\tcn.Close()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkak-tus%2Fami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkak-tus%2Fami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkak-tus%2Fami/lists"}