{"id":38530091,"url":"https://github.com/leandro-lugaresi/message-cannon","last_synced_at":"2026-01-17T06:54:02.579Z","repository":{"id":53111101,"uuid":"100650364","full_name":"leandro-lugaresi/message-cannon","owner":"leandro-lugaresi","description":":rabbit2: Consume messages from message systems (RabbitMQ) and send to other applications","archived":false,"fork":false,"pushed_at":"2023-03-30T20:18:19.000Z","size":189,"stargazers_count":29,"open_issues_count":6,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-20T15:54:31.672Z","etag":null,"topics":["consume-rabbitmq-messages","http","php","rabbitmq","rabbitmq-consumer"],"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/leandro-lugaresi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-08-17T22:33:20.000Z","updated_at":"2024-02-03T20:06:27.000Z","dependencies_parsed_at":"2024-06-20T15:52:46.946Z","dependency_job_id":null,"html_url":"https://github.com/leandro-lugaresi/message-cannon","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/leandro-lugaresi/message-cannon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandro-lugaresi%2Fmessage-cannon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandro-lugaresi%2Fmessage-cannon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandro-lugaresi%2Fmessage-cannon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandro-lugaresi%2Fmessage-cannon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leandro-lugaresi","download_url":"https://codeload.github.com/leandro-lugaresi/message-cannon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandro-lugaresi%2Fmessage-cannon/sbom","scorecard":{"id":581846,"data":{"date":"2025-08-11","repo":{"name":"github.com/leandro-lugaresi/message-cannon","commit":"14d069832bd5dbc6789237a459385a7a93ef4d63"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating alpine to alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.7.0 not signed: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/15795425","Warn: release artifact v0.6.0 not signed: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/13769560","Warn: release artifact v0.5.0 not signed: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/9710703","Warn: release artifact v0.4.0 not signed: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/9121652","Warn: release artifact v0.3.1 not signed: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/8921921","Warn: release artifact v0.7.0 does not have provenance: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/15795425","Warn: release artifact v0.6.0 does not have provenance: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/13769560","Warn: release artifact v0.5.0 does not have provenance: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/9710703","Warn: release artifact v0.4.0 does not have provenance: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/9121652","Warn: release artifact v0.3.1 does not have provenance: https://api.github.com/repos/leandro-lugaresi/message-cannon/releases/8921921"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"27 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-77vh-xpmg-72qh","Warn: Project is vulnerable to: GO-2022-0835 / GHSA-gp4j-w3vj-7299","Warn: Project is vulnerable to: GO-2021-0085 / GHSA-fgv8-vj5c-2ppq","Warn: Project is vulnerable to: GO-2021-0087 / GHSA-fh74-hm69-rqjw","Warn: Project is vulnerable to: GO-2022-0396 / GHSA-g54h-m393-cpwq","Warn: Project is vulnerable to: GO-2022-0914 / GHSA-c3xm-pvg7-gh7r","Warn: Project is vulnerable to: GHSA-v95c-p5hm-xq8f","Warn: Project is vulnerable to: GO-2022-0452 / GHSA-f3fp-gc8g-vw66","Warn: Project is vulnerable to: GO-2023-1683 / GHSA-g2j6-57v7-gm8c","Warn: Project is vulnerable to: GO-2023-1682 / GHSA-m8cg-xc2p-r3fc","Warn: Project is vulnerable to: GO-2024-3110 / GHSA-jfvp-7x6p-h2pv","Warn: Project is vulnerable to: GO-2022-0197 / GHSA-4r78-hx75-jjj2 / GHSA-mv93-wvcp-7m7r","Warn: Project is vulnerable to: GO-2020-0014 / GHSA-vfw5-hrgq-h5wf","Warn: Project is vulnerable to: GO-2022-0536 / GHSA-39qc-96h7-956f / GHSA-hgr8-6h9x-f7q9","Warn: Project is vulnerable to: GO-2022-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T19:22:46.219Z","repository_id":53111101,"created_at":"2025-08-20T19:22:46.219Z","updated_at":"2025-08-20T19:22:46.219Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["consume-rabbitmq-messages","http","php","rabbitmq","rabbitmq-consumer"],"created_at":"2026-01-17T06:54:02.484Z","updated_at":"2026-01-17T06:54:02.551Z","avatar_url":"https://github.com/leandro-lugaresi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# message-cannon\nConsume messages from message systems (RabbitMQ, NATS, Kafka) and send to other applications.\n\n\n[![Release](https://img.shields.io/github/release/leandro-lugaresi/message-cannon.svg?style=flat-square)](https://github.com/leandro-lugaresi/message-cannon/releases/latest)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://travis-ci.org/leandro-lugaresi/message-cannon.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/leandro-lugaresi/message-cannon)\n[![Coverage Status](https://img.shields.io/codecov/c/github/leandro-lugaresi/message-cannon/master.svg?style=flat-square)](https://codecov.io/gh/leandro-lugaresi/message-cannon)\n[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/leandro-lugaresi/message-cannon)\n[![Go Report Card](https://goreportcard.com/badge/github.com/leandro-lugaresi/message-cannon?style=flat-square)](https://goreportcard.com/report/github.com/leandro-lugaresi/message-cannon)\n[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/leandro-lugaresi)\n[![Powered By: GoReleaser](https://img.shields.io/badge/powered%20by-goreleaser-green.svg?style=flat-square)](https://github.com/goreleaser)\n\n---\n\n# Motivation\nIf you already tried to use some long running code with PHP you probably notice some problems like:\n- Doctrine connection closed;\n- Entities outdated;\n- A large amount of ram used by consumers sleeping;\n- The rabbitMQ connection is dead but the consumer still running (supervisor think it's alive).\n\nmessage-cannon is a binary used to solve this problem we faced in PHP projects.\nThe idea is to run the consumers in a go binary and send the messages to callbacks using `runners`.\n\n# Installation\n\n## Docker\nThe simple way to run message-cannon is to run the docker image for it. This is an example of docker-compose running the message-cannon:\n```\n  cannon:\n    image: leandrolugaresi/message-cannon:latest\n    volumes:\n      - ./app/config/cannon.yaml:/.cannon.yaml\n    command: launch --config=.cannon.yaml\n    links:\n      - rabbitmq\n      - my-app\n```\n\n## Manual\nYou can get the binaries and use it. Just go to [releases](https://github.com/leandro-lugaresi/message-cannon/releases) and download the newest binary for your SO (deb, rpm, snap are also available)\n\n# Usage\n\n## CLI Commands\n\nWe have only one command: `message-cannon launch` will open one config file and start all the consumers availlable.\n\n## Runners\n\n### Command\n\nThis is the first runner developed and it will open an executable(PHP, python, ruby, bash) and send the message using the STDIN. The executable will receive the message, process and return an exit code used to know how to handle the message.\n\n\u003e WARNING: This method is only possible if your number of messages are really low! Open system process (ie: PHP runtime) for every single message will cost a lot of resources. If a number of messages are bigger try solve your issues with PHP (good luck), change to HTTP runner or rewrite it to solve your problems.\n\n#### Example\n\n```yml\nconsumers:\n  upload_picture:\n    ...\n    runner:\n      type: command\n      options:\n        path: \"bin/app-console message:cannon\"\n        args: [\"some-param\",\"other-param\",\"fooo\"]\n```\n\n### HTTP\n\nThis is the best choice available. The runner will send the message using a POST request with the message content as the request body.\nThe runner will handle the messages depending on the request status code and content.\n\n#### Headers\nThe message-cannon send some headers when sending one message, this headers can be from the message or from the `headers` option of the consumer.runner config.\nThe rabbitMQ consumer will send this headers:\n\nHeader name | Type | From\n----------- | -----|-----\n`Content-Type` | string | message contentType header\n`Content-Encoding` | string | message contentEncoding header\n`Correlation-Id` | string | message CorrelationId param\n`Message-Id` | string | message MessageId param\n`Message-Deaths` | int | number of times the message received a NACK (this is useful with retries using dead-letters)\n\n\n#### Responses\n\nstatus code | default | override\n----------- | ------- | --------\n5xx | `4`: ExitNACKRequeue | option `return-on-5xx`\n4xx | `5`: ExitRetry | N/A\n2xx with ignore-output  | `0`: ACK | N/A\n2xx without ignore-output | N/A | expect a json response with a `response-code` field\n\n#### Example\n\nConfig file:\n```yml\nconsumers:\n  upload_picture:\n    ...\n    runner:\n      type: http\n      ignore-output: false\n      options:\n        url: \"https://localhost/receive-messages/upload-picture\"\n        return-on-5xx: 3 # ExitNACK\n        headers:\n          Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l\n          Content-Type: application/json #override the Content-Type from message\n```\n\nServer reponse:\n\n```json\n{\"response-code\": 4, \"error\": \"some nasty error here\", \"trace\": \"some trace as string\"}\n```\n\n## Return codes:\n\nWe create some constants to represent some operations available to messages, every runner has some way to get this information from the callbacks.\n\nReturn code | name | rabbitMQ\n----------- | ------- | --------\n`0`| ACK | Ack\n`1`| ExitFailed | Reject[requeue: false]\n`3`| ExitNACK | Nack[requeue: `false`]\n`4`| ExitNACKRequeue | Nack[requeue: `true`]\n`5`| ExitRetry | Nack[requeue: `true`]\n`-1`| ExitTimeout | Nack[requeue: `true`]\n`-`| invalid code | Reject[requeue: true]\n\n## Example of config file\n\nYou can see an example of config file [here](cannon.yml.dist)\n\n### Environment variables\n\nYou can use environment variables inside the yaml file. The sintax is like the syntax used inside the docker-compose file.\nTo use a required variable just use like this: `${ENV_NAME}` and to put an default value you can use: `${ENV_NAME:=some-value}`. Ie:\n```yaml\nconnections:\n    default:\n      dsn: \"amqp://${RABBITMQ_USER:=guest}:${RABBITMQ_PASSWORD}@${RABBITMQ_HOST:=rabbitmq}:${RABBITMQ_PORT:=5672}${RABBITMQ_VHOST:=/}\"\n\n```\n will use the default values when make the connection dsn.\n\n# License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fleandro-lugaresi%2Fmessage-cannon.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fleandro-lugaresi%2Fmessage-cannon?ref=badge_large)\n\n---\n\nThis project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.\nWe appreciate your contribution. Please refer to our [contributing guidelines](CONTRIBUTING.md) for further information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandro-lugaresi%2Fmessage-cannon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleandro-lugaresi%2Fmessage-cannon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandro-lugaresi%2Fmessage-cannon/lists"}