{"id":21296879,"url":"https://github.com/reddec/fluent-amqp","last_synced_at":"2025-07-11T18:32:07.686Z","repository":{"id":57494251,"uuid":"135388831","full_name":"reddec/fluent-amqp","owner":"reddec","description":"fluent interface for most popular tasks on AMQP","archived":false,"fork":false,"pushed_at":"2020-06-10T07:13:56.000Z","size":123,"stargazers_count":36,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-02T11:02:00.045Z","etag":null,"topics":["amqp","fluent","fluent-amqp","golang"],"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/reddec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["http://reddec.net/about/#donate"]}},"created_at":"2018-05-30T04:40:26.000Z","updated_at":"2021-07-04T14:47:09.000Z","dependencies_parsed_at":"2022-09-02T04:23:38.108Z","dependency_job_id":null,"html_url":"https://github.com/reddec/fluent-amqp","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/reddec/fluent-amqp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ffluent-amqp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ffluent-amqp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ffluent-amqp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ffluent-amqp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec","download_url":"https://codeload.github.com/reddec/fluent-amqp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Ffluent-amqp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264870443,"owners_count":23676230,"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":["amqp","fluent","fluent-amqp","golang"],"created_at":"2024-11-21T14:30:20.229Z","updated_at":"2025-07-11T18:32:07.237Z","avatar_url":"https://github.com/reddec.png","language":"Go","funding_links":["http://reddec.net/about/#donate"],"categories":[],"sub_categories":[],"readme":"# Fluent AMQP\n\n![FA](docs/logo.svg)\n\n\n[![Docker Automated build](https://img.shields.io/docker/build/reddec/fluent-amqp.svg)](https://hub.docker.com/r/reddec/fluent-amqp/)\n[![Telegram Sender](https://img.shields.io/docker/automated/reddec/fluent-amqp-telegram-sender.svg)](https://hub.docker.com/r/reddec/fluent-amqp-telegram-sender/)\n[![Snap Status](https://build.snapcraft.io/badge/reddec/fluent-amqp.svg)](https://build.snapcraft.io/user/reddec/fluent-amqp)\n[![donate](https://img.shields.io/badge/help_by️-donate❤-ff69b4)](http://reddec.net/about/#donate)\n[![](https://godoc.org/github.com/reddec/fluent-amqp?status.svg)](https://godoc.org/github.com/reddec/fluent-amqp)\n[![Download](https://api.bintray.com/packages/reddec/debian/fluent-amqp/images/download.svg)](https://bintray.com/reddec/debian/fluent-amqp/_latestVersion)\n\n\nLibrary that provides fluent and easy wrapper over [streadway-amqp](https://github.com/streadway/amqp) API.\nAdds such features like:\n\n- Reconnectiong. Will restore all defined infrastructure\n- Non-blocking processing of messages\n- Optional auto-requeue (with delay)\n- Signing and verifiying messages by public/private pair\n\n[API documentation](https://godoc.org/github.com/reddec/fluent-amqp)\n\n## Signing and verification\n\nHash algorithm (x509) SHA512 with RSA, sign - SHA512.\n\nThe signer (producer) should use private key to sign content of message body and message id.\n\nThe validator (consumer) should use public certificate to validate content of message and message id against signature and should drops invalid or duplicated messages.\n\nThe sign should be put to a header (`X-Signature` by default: see `DefaultSignatureHeader` constant in godoc) as __binary__ object (**not hex or base64 encoded**).\n\n```\nDATA = BYTES(ID) ... BYTES(BODY)\n# SIGN via PKCS#1 v1.5\nSIGN_HEADER_BODY = SIGN_SHA512(PRIVATE_KEY, DATA)\n```\n\n\n## States\n\n![image](https://user-images.githubusercontent.com/6597086/77630218-9e932b80-6f85-11ea-8c10-eecf57920cd9.png)\n\n## Default message\n\nMessage by default has:\n\n* Delivery type - persistent\n* Time - current time in UTC\n\n\n## Templates\n\n\n\n`amqp-recv` supports templating output `-o template`. Template content read from STDIN.\n\nRoot template object is a [amqp.Delivery](https://github.com/streadway/amqp/blob/dcfad599551a8042d2e1971a496f31624a7f4738/delivery.go#L28) with functions\nfrom [Sprig](http://masterminds.github.io/sprig/) plus additional methods like:\n\n* `asText` - converts bytes to string\n\n\n1. Basic example:\n\n\nPrint same as `-o plain`.\n\n```\necho '{{- .Body | asText -}}' | amqp-recv -o template ...\n```\n\n2. Notification to telegram\n\nUse combination of basic CLI utils and templates.\n\n```bash\nTOKEN=\"xxxyyyy\"        # BotFather token for Telegram (see here: https://t.me/BotFather)\nCHAT_ID=\"1234567\"      # Target Telegram chat ID (find yours: https://t.me/MyTelegramID_bot)\nQUEUE=\"notification\"   # queue name should be defined if persistent required\nEXCHANGE=\"amqp.topic\"  # source of notification\nTYPE=\"topic\"           # exchange type\nTOPIC=\"#\"              # specify subject that will be sent over telegram (# - everything)\n\nwhile true; do\n  echo -n -e 'Subject: {{.RoutingKey}}\\n\\n{{.Body | asText}}' | amqp-recv -o template -Q $QUEUE -e $EXCHANGE -k $TYPE \"$TOPIC\" \u003e message.txt\n  curl -f -X POST --data \"text=$(cat message.txt)\" --data \"chat_id=${CHAT_ID}\" \"https://api.telegram.org/bot${TOKEN}/sendMessage\" || exit 1\ndone\n```\n\n\n## Command line utilities\n\n* [amqp-exec](cmd/amqp-exec) - CGI like daemon to listen message and run executable (and send reply)\n* [amqp-recv](cmd/amqp-recv) - Receive message from AMQP (like `cat` command)\n* [amqp-send](cmd/amqp-send) - Send message to AMQP (like `wall` command)\n\n### Installation\n\n[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/fluent-amqp)\n\n* [snapcraft: fluent-amqp](https://snapcraft.io/fluent-amqp)\n\n  after installation commands are available with `fluent-amqp.` prefixes (i.e. `fluent-amqp.amqp-exec`)\n* [pre-build binaries](https://github.com/reddec/fluent-amqp/releases) for all major platform\n\n* From bintray repository for most **debian**-based distribution (`trusty`, `xenial`, `bionic`, `buster`, `wheezy`):\n```bash\nsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61\necho \"deb https://dl.bintray.com/reddec/debian {distribution} main\" | sudo tee -a /etc/apt/sources.list\nsudo apt install amqp-send amqp-exec amqp-recv\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Ffluent-amqp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freddec%2Ffluent-amqp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Ffluent-amqp/lists"}