Download the PHP package cog/stupidmqbundle without Composer
On this page you can find all versions of the php package cog/stupidmqbundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cog/stupidmqbundle
More information about cog/stupidmqbundle
Files in cog/stupidmqbundle
Package stupidmqbundle
Short Description stupid message queue bundle for sf2
License MIT
Homepage https://github.com/krichprollsch/stupidMQBundle
Informations about the package stupidmqbundle
StupidMQBundle
Bundle to support stupidMessageQueue into Symfony application.
Installation
Add requirement into you composer.json
:
"cog/stupidmqbundle":"2.4.*"
Then enable the bundle into app/AppKernel.php
:
new CoG\StupidMQBundle\CoGStupidMQBundle()
Optionnaly, if you are using Doctrine Orm, you can use it to easily install message queue table :
php app/console doctrine:schema:update --force
This command will create for you a new table cog_stupidmq
to store your messages.
Creating a message queue
Edit your services.xml
to add your own queues :
<!-- Messages Queues -->
<service id="my.queue" class="%cog_stupidmq.queue.class%">
<argument type="service" id="cog_stupidmq.channel" />
<argument>my.queue</argument>
<tag name="cog_stupidmq.queue"/>
</service>
Adding message into the queue
Adding a worker
To consume messages, you have to create a worker class like this :
Then you should register your worker, edit your services.xml
:
<!-- Message Worker -->
<service id="my.worker" class="My\Bundle\Worker\MyWorker">
<tag name="cog_stupidmq.worker"/>
</service>
Running command
StupidMQBundle is coming with useful command to process messages :
$ php app/console cog:stupidmq:watch -m1
These command will watch your queue until a message have to be processed, then it will run a subprocess in order to treat it.
Command help :
$ php app/console cog:stupidmq:watch --help
All versions of stupidmqbundle with dependencies
symfony/framework-bundle Version 2.*
symfony/console Version 2.*
symfony/process Version 2.*
jms/serializer Version >=0.11.0
cog/stupidmq Version >=1.0.1
friendsofsymfony/jsrouting-bundle Version 1.*