{"id":15063289,"url":"https://github.com/krakphp/symfony-messenger-redis","last_synced_at":"2026-03-01T13:03:06.893Z","repository":{"id":47331282,"uuid":"151273723","full_name":"krakphp/symfony-messenger-redis","owner":"krakphp","description":"Messenger Redis Adapter","archived":false,"fork":false,"pushed_at":"2023-02-28T20:30:41.000Z","size":47,"stargazers_count":8,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T09:42:24.703Z","etag":null,"topics":["messenger","redis","symfony-bundle","symfony-messenger","symfony4"],"latest_commit_sha":null,"homepage":null,"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/krakphp.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-10-02T15:01:09.000Z","updated_at":"2025-04-02T11:49:22.000Z","dependencies_parsed_at":"2025-02-17T02:33:50.429Z","dependency_job_id":"d8687115-ac27-4c75-a85c-a54d0e55e8a7","html_url":"https://github.com/krakphp/symfony-messenger-redis","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/krakphp/symfony-messenger-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krakphp%2Fsymfony-messenger-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krakphp%2Fsymfony-messenger-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krakphp%2Fsymfony-messenger-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krakphp%2Fsymfony-messenger-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krakphp","download_url":"https://codeload.github.com/krakphp/symfony-messenger-redis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krakphp%2Fsymfony-messenger-redis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29969700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T12:56:10.327Z","status":"ssl_error","status_checked_at":"2026-03-01T12:55:24.744Z","response_time":124,"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":["messenger","redis","symfony-bundle","symfony-messenger","symfony4"],"created_at":"2024-09-24T23:54:35.272Z","updated_at":"2026-03-01T13:03:06.878Z","avatar_url":"https://github.com/krakphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony Messenger Redis Adapter\n\n![PHP Tests](https://github.com/krakphp/symfony-messenger-redis/workflows/PHP%20Tests/badge.svg?branch=master\u0026event=push)\n\nThis provides custom Redis List Integration with the Symfony Messenger ^4.4 system.\n\nThe standard redis implementation requires redis 5.0 and utilizes the streams feature, this adapter uses redis lists to power the queue functionality.\n\n## Installation\n\nInstall with composer at `krak/symfony-messenger-redis`.\n\nIf symfony's composer install doesn't automatically register the bundle, you can do so manually:\n\n```php\n\u003c?php\n\nreturn [\n  //...\n  Krak\\SymfonyMessengerRedis\\MessengerRedisBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\n## Usage\n\nYou can use this queue with the following config for the framework messenger:\n\n```yaml\nframework:\n  messenger:\n    transports:\n      acme_redis:\n        dsn: '%env(MESSENGER_TRANSPORT_DSN)%'\n        options: { queue: queue_acme }\n```\n\nWhere `MESSENGER_TRANSPORT_DSN` env is like: `redis://localhost:6379`\n\nThis will register a transport named `acme_redis` which will properly use the configured Redis transport from this library.\n\n### Unique Messages\n\nIf you ever need to ensure that you a specific job needs to be unique while waiting in the queue, you can use the UniqueStamp.\n\n```php\nuse Symfony\\Component\\Messenger\\Envelope;\nuse Krak\\SymfonyMessengerRedis\\Stamp\\UniqueStamp;\nEnvelope::wrap($message)-\u003ewith(new UniqueStamp('optional-unique-id'));\n```\n\nIf you don't pass an identifier to enforce uniqueness, the transport will perform an md5 hash of the message body to create an identifier.\n\nExample usage of this stamp:\n\n- You dispatch a ProductUpdatedMessage every time a product is saved in one system.\n- You have message handlers that then do some expensive operation based off of that product information\n- In the event a single product gets saved rapidly without effectively changing, it makes no sense to enqueue the same job for that product 100 times\n- Using the unique stamp ensures that if a message is already in the queue for that specific product, don't add in another message since the original message hasn't been processed yet.\n\n### Delayed Messages\n\nThis library supports the DelayStamp provided by the core SF messenger.\n\n### Debounce Messages\n\nYou can use DebounceStamp to debounce message sending to  transport.\n\nDebounceStamp is similar to the DelayStamp, but essentially, if a debounced message is new, we enter it into the queue exactly like a unique \u0026 delayed message would. But if there is a similar message still waiting to be queued, then we would remove it, and re-add it with the new delay. For anyone not aware of what debounce is, https://redd.one/blog/debounce-vs-throttle\n\n```php\nuse Symfony\\Component\\Messenger\\Envelope;\nuse Krak\\SymfonyMessengerRedis\\Stamp\\DebounceStamp;\nEnvelope::wrap($message)-\u003ewith(new DebounceStamp('delay-in-ms', 'optional-unique-id'));\n```\n\n### Available Options\n\nHere are the available options that can be provided to the transport options array or as query parameters:\n\n- **queue:**\n  - *required:* yes\n  - *default:* N/A\n  - *description:* The internal list name to use for storing the messages in redis. The system will also create a processing queue named `{queue}_processing` for storing the processed messages.\n- **db:**\n  - *required:* no\n  - *default:* N/A\n  - *description:* The redis database to select when performing redis operations. This value can also be set from the dsn via a query parameter or by setting the path in the dsn (`redis//redis:6379?db=1` or `redis://redis:6379/1`).\n\n### TLS Support\n\nTo enable TLS support, make the DSN schema `rediss://` instead of `redis://` to note that the redis client should connect with TLS.\n\n### Processed Queue\n\nThis library uses the [rpoplpush reliable queue pattern](https://redis.io/commands/rpoplpush#pattern-reliable-queue). It's important to note however that this library does not make any attempt to clean up that processed queue.\n\nWe've made great strides to make sure that when everything is working right, that the processing queue is always cleaned up, even when using the autoscaling receiver.\n\nHowever, if for some reason a worker is killed via `SIGKILL` (aka `kill -9`), there are chances the worker process could leave a processing item in the queue because it didn't finish it's process. Overtime, this might cause the `_processing` to accrue messages that don't need to be there.\n\nIt won't hurt anything other than storage to have those `_processing` lists take up space. It also *shouldn't* hurt anything to periodically just wipe out those lists using the `DEL` command. But that would need to be verified that it wouldn't hurt any running workers (which I don't think it will).\n\n### Using Symfony's Redis Transport at the same time\n\nBoth symfony's redis and the krak redis transport register the dsn prefix: `redis://`. In the scenario that you want to support both transports, you'll need to use the `use_krak_redis` option to disable this libraries redis transport.\n\n```yaml\nframework:\n  messenger:\n    transports:\n      krak_redis:\n        dsn: '%env(MESSENGER_TRANSPORT_DSN)%'\n        options: { queue: queue_acme }\n      sf_redis:\n        dsn: '%env(MESSENGER_TRANSPORT_DSN)%'\n        options: { use_krak_redis: false } # this allows symfony's redis transport factory to take precedence\n```\n\n## Testing\n\nYou can run the test suite with: `composer test`\n\nYou'll need to start the redis docker container locally in order for the Feature test suite to pass.\n\nKeep in mind that you will need to have the redis-ext installed on your local php cli, and will need to start up the redis instance in docker via `docker-compose`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrakphp%2Fsymfony-messenger-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrakphp%2Fsymfony-messenger-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrakphp%2Fsymfony-messenger-redis/lists"}