{"id":18382867,"url":"https://github.com/e-commit/messenger-supervisor-bundle","last_synced_at":"2025-04-06T23:32:01.587Z","repository":{"id":56974784,"uuid":"330187002","full_name":"e-commit/messenger-supervisor-bundle","owner":"e-commit","description":"The EcommitMessengerSupervisorBundle bundle (for Symfony) manages Messenger component with Supervisor.","archived":false,"fork":false,"pushed_at":"2025-03-14T14:36:10.000Z","size":105,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T09:03:14.066Z","etag":null,"topics":["messenger","supervisor","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/e-commit.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":"2021-01-16T14:58:57.000Z","updated_at":"2025-03-14T14:35:43.000Z","dependencies_parsed_at":"2023-02-15T11:46:06.389Z","dependency_job_id":"0e5457b0-2abe-4c12-8a3b-3a0cbfdf9815","html_url":"https://github.com/e-commit/messenger-supervisor-bundle","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"7d1e444f8b4f974aabb13c69e5b6d3737940b454"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-commit%2Fmessenger-supervisor-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-commit%2Fmessenger-supervisor-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-commit%2Fmessenger-supervisor-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-commit%2Fmessenger-supervisor-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e-commit","download_url":"https://codeload.github.com/e-commit/messenger-supervisor-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569124,"owners_count":20959758,"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":["messenger","supervisor","symfony","symfony-bundle"],"created_at":"2024-11-06T01:08:56.023Z","updated_at":"2025-04-06T23:32:01.576Z","avatar_url":"https://github.com/e-commit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EcommitMessengerSupervisorBundle\n\nThe EcommitMessengerSupervisorBundle bundle (for Symfony) manages [Messenger component](https://symfony.com/doc/current/components/messenger.html)\nwith [Supervisor](http://supervisord.org).\n\n\n![Tests](https://github.com/e-commit/messenger-supervisor-bundle/workflows/Tests/badge.svg)\n\n\nAvailable features :\n* Start Supervisor programs (workers)\n* Stop Supervisor programs (workers)\n* Show Supervisor programs (workers) status\n* Show Supervisor programs (workers) status with Nagios format\n* After worker failure :\n    * Stop Supervisor program (can be disabled)\n    * Send email (can be disabled)\n\n\n## Installation ##\n\nInstall the bundle with Composer : In your project directory, execute the following command :\n\n```bash\n$ composer require ecommit/messenger-supervisor-bundle\n```\n\nEnable the bundle in the `config/bundles.php` file for your project :\n\n```php\nreturn [\n    //...\n    Ecommit\\MessengerSupervisorBundle\\EcommitMessengerSupervisorBundle::class =\u003e ['all' =\u003e true],\n    //...\n];\n```\n\nIn Supervisor configuration enable the API and add your workers (See the [Supervisor doc](http://supervisord.org) for more details):\n\n```ini\n;eg in /etc/supervisor/conf.d/myconf.conf\n[inet_http_server]\nport = 127.0.0.1:9001\nusername = user\npassword = 123\n\n[program:program_async]\ncommand=php /path/to/your/app/bin/console messenger:consume async\nprocess_name=%(program_name)s_%(process_num)02d\nnumprocs=1\nautostart=true\nautorestart=true\nuser=ubuntu\n\n;You can define others programs (workers) :\n;[program:program_async2]\n;command=php /path/to/your/app/bin/console messenger:consume async2\n;process_name=%(program_name)s_%(process_num)02d\n;numprocs=2\n;autostart=true\n;autorestart=true\n;user=ubuntu\n```\n\nConfigure Messenger (See the [doc](https://symfony.com/doc/current/messenger.html) for more details) and \nMailer (See the [doc](https://symfony.com/doc/current/mailer.html) for more details).\n\nIn your project, add the configuration file `config/packages/ecommit_messenger_supervisor.yaml` :\n\n```yaml\necommit_messenger_supervisor:\n    supervisor:\n        #Supervisor API configuration\n        host: '127.0.0.1' #IP address - Required\n        username: user #Username - Not required - Default value: null\n        password: 123 #Password - Not required - Default value: null\n        #port: 9001 #Port - Not required - Default value: 9001\n        #timeout: 3600 #API timeout (in seconds) - Not required - Default value: 3600\n\n    #Transports / Programs configuration :\n    #Mapping \"Messenger transport name\" -\u003e \"Supervisor program name (group name)\"\n    transports:\n        async: program_async #async = Messenger transport name | program_async = Supervisor program (group) name\n        #Or you can set options :\n        #async:\n        #   failure:\n        #       stop_program: true #Stop program after failure - Not required - Available values: \"always\", \"will-not-retry\" (only if the message cannot be retried), \"never\" - Default value : \"always\"\n        #       send_mail: true #Send mail after failure - Not required - Available values: \"always\", \"will-not-retry\" (only if the message cannot be retried), \"never\" - Default value : \"always\"\n\n        #You can define others programs :\n        #async2: program_async2\n\n    #Mailer configuration\n    mailer:\n        from: from@domain.com #Sender - Required if a program is setting with send_mail=true option\n        to: to@domain.com #Recipient - Required if a program is setting with send_mail=true option\n        #You can use multiple recipients:\n        #to: ['to1@domain.com', 'to2@domain.com']\n        #subject: \"[Supervisor][\u003cserver\u003e][\u003cprogram\u003e] Error\" #Suject - Not required - Default value : \"[Supervisor][\u003cprogram\u003e] Error\"\n        #\u003cprogram\u003e is replaced by Supervisor program (group) name\n        #\u003cserver\u003e is replaced by server name\n```\n\n\n## Usage ##\n\n```bash\n#Start a program\nphp bin/console ecommit:supervisor start program_async\n#Start multiple programs\nphp bin/console ecommit:supervisor start program_async program_async2\n#Start all programs\nphp bin/console ecommit:supervisor start  all\n\n\n#Stop a program\nphp bin/console ecommit:supervisor stop program_async\n#Stop many programs\nphp bin/console ecommit:supervisor stop program_async program_async2\n#Stop all programs\nphp bin/console ecommit:supervisor stop  all\n\n\n#Get status on a single program\nphp bin/console ecommit:supervisor status program_async\n#Get status on multiple programs\nphp bin/console ecommit:supervisor status program_async program_async2\n#Get status on all programs\nphp bin/console ecommit:supervisor status all\n#Use can use Nagios format\nphp bin/console ecommit:supervisor status all --nagios\n```\n\nYou can also use the `Ecommit\\MessengerSupervisorBundle\\Supervisor\\Supervisor` service :\n\n```php\nuse Ecommit\\MessengerSupervisorBundle\\Supervisor\\Supervisor;\n\nclass MyClass\n{\n    protected $supervisor;\n    \n    public function __construct(Supervisor $supervisor) //Supervisor service is injected\n    {\n        $this-\u003esupervisor = $supervisor;\n    }\n\n    public function myMethod(): void\n    {\n        //$this-\u003esupervisor-\u003estartProgram('program_async');\n        //$this-\u003esupervisor-\u003estopProgram('program_async');\n        //$status = $this-\u003esupervisor-\u003egetProgramsStatus(['program_async']);\n    }\n}\n```\n\n## License ##\n\nThis bundle is available under the MIT license. See the complete license in the *LICENSE* file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-commit%2Fmessenger-supervisor-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe-commit%2Fmessenger-supervisor-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-commit%2Fmessenger-supervisor-bundle/lists"}