PHPackages                             setono/message-scheduler-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. setono/message-scheduler-bundle

ActiveSymfony-bundle[Queues &amp; Workers](/categories/queues)

setono/message-scheduler-bundle
===============================

Schedule Symfony Messenger messages in the future

10[1 PRs](https://github.com/Setono/MessageSchedulerBundle/pulls)PHP

Since Jul 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Setono/MessageSchedulerBundle)[ Packagist](https://packagist.org/packages/setono/message-scheduler-bundle)[ RSS](/packages/setono-message-scheduler-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Message Scheduler Bundle
========================

[](#message-scheduler-bundle)

[![Latest Version](https://camo.githubusercontent.com/c7dd5afe1fb88163df41b944c200cc06e13d4a3102e2b49be466050633e17d4f/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f6d6573736167652d7363686564756c65722d62756e646c652f762f737461626c65)](https://packagist.org/packages/setono/message-scheduler-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/c2b38a5a86f29ce18906c82bd19b4bf0f3d1727933361faa2af08bc54585d6bf/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f6d6573736167652d7363686564756c65722d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/setono/message-scheduler-bundle)[![Software License](https://camo.githubusercontent.com/251ad6710e8af0d897397e9bfbbc2e5965efc1e16df6dfb6fb55a804614a6d73/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f6d6573736167652d7363686564756c65722d62756e646c652f6c6963656e7365)](LICENSE)[![Build Status](https://github.com/Setono/MessageSchedulerBundle/workflows/build/badge.svg)](https://github.com/Setono/MessageSchedulerBundle/actions)[![Coverage Status](https://camo.githubusercontent.com/179be2ea8d378564d8f19b70c1d62681c59f3a271630929b03db0fe18919fd3c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f5365746f6e6f2f4d6573736167655363686564756c657242756e646c652e737667)](https://scrutinizer-ci.com/g/Setono/MessageSchedulerBundle/code-structure)[![Quality Score](https://camo.githubusercontent.com/65c42d146a5c28647c8b09c2c288d4fb5203a8588cfad4b44a01a2bd5d5a0c6f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f5365746f6e6f2f4d6573736167655363686564756c657242756e646c652e737667)](https://scrutinizer-ci.com/g/Setono/MessageSchedulerBundle)

Schedule Symfony Messenger messages in the future.

The need for this bundle came on a project where we needed to check the expiry of an event on a per minute basis using a cron job. So an event could end in 10 days at 10:05:00, but the cron job wouldn't know this. Instead, the cron job runs every minute to check it. Checking it was a very memory intensive task, so this wasn't feasible in the long run.

Therefore, instead of checking every minute, we schedule a command to be run in the future on the time that we know the event ends.

Problem solved 🎉

Installation
------------

[](#installation)

### Step 1: Download

[](#step-1-download)

```
$ composer require setono/message-scheduler-bundle
```

### Step 2: Enable the bundle

[](#step-2-enable-the-bundle)

If you use [Symfony Flex](https://flex.symfony.com/) it will be enabled automatically. Else you need to add it to the `config/bundles.php`:

```
