tonypiper / qpush-demo

Demonstration for QPush bundle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QPush Demo

Tony Piper tpiper@inviqa.com 2014-07-01

This is a very rough and ready demo of using IronMQ push queues with the uecode/qpush-bundle.

Installation

  1. run composer install to install symfony and the other dependencies
  2. create an account on http://www.iron.io/ (it's free for 10 million API calls per month)
  3. create an IronMQ project
  4. copy the Token and Project ID and put them into app/config/parameters.yml

e.g.

ironmq_token: <token here>
ironmq_project_id: <project id here>
  1. install ngrok from https://ngrok.com/ - we'll use this to tunnel from the internet to your machine
  2. start the symfony built in webserver in a new terminal window - app/console server:run
  3. start ngrok in a new terminal window - ngrok 8000
  4. paste the nrgok url into app/config/parameters.yml

eg.

ironmq_endpoint1_url: http://<something>.ngrok.com
  1. all being well, you can run app/console app:demo1. This will post 10 messages to IronMQ.

If you examine app/logs/dev.log (try tail -f dev.log | grep --line-buffered app.INFO) you'll see the messages being posted, and then the inbound messages being processed by src/Inviqa/Bundle/QPushDemoBundle/Service/Queue1Service.php.

The implementation simulates random failures, and you should see that IronMQ retries. Ultimately it will give up.

IronMQ by default gives a job 60 seconds to complete. After that it'll be put back on the queue.

IronMQ will send one job at a time to the pool or endpoints.

TODO:

About

Demonstration for QPush bundle

License:MIT License


Languages

Language:PHP 100.0%