Filas com PHP
Ivan Rosolen
Graduado em Sistemas de Informação
Pós-graduado em Gerência de Projetos
Desenvolvedor a 15+ anos
Autor de vários PHPT (testes para o PHP)
Entusiasta de novas tecnologias
Head of Innovation @ Arizona
CTO @ Mokation
@ivanrosolen
AMQP
- Advanced Message Queueing Protocol
- Messaging Broker
- Network Protocol
- Platform Agnostic
- Port 5672
Advantages
- Get data from a to b
- Asynchronous
- Load balance and scalability
- System integrations
- Retry
Model
Publisher ConsumerExchange QueueRoutes ConsumesPublish
Components
- Exchanges
- Message Queues
- Bindings
- Channel
- Virtual Host
Exchange
- Routing agent
- Binding
- Routing key
- Direct exchange
- Fanout exchange
- Topic exchange
- Headers exchange
Exchange
Queue 1
routing_key: key1
Queue 2
Queue 3
routing_key: key2
routing_key: key3
Direct
Exchange
Queue 1
Queue 2
Queue 3
Fanout
Exchange
Queue 1
routing_key: app1.upload
Queue 2
routing_key: *.download
routing_key: #.download
Topic
- Headers
- Slower
- More than one criteria for forwarding
Queue
- Durable or Temporary (server shutdown)
- Fifo?
- Dead letter
- Named by client or Server
- reply_to
Bindings
- Relationship
- Queue X Exchange X Virtual Host
Channel
- TCP
- SSL
- Share the same connection
Virtual Host
- /virtual_host
- Queue/exchange groups
Producer
- Batch
- Send message to an exchange/queue
Consumer
- basic_ack
- worker
RabbitMQ
- PECL and Composer
- Easy to install, use and monitor
- Great docs
- Plugins
- Open source and commercially supported
Code
Refs
Github
https://github.com/ivanrosolen/queues-and-php
RabbitMQ
https://www.rabbitmq.com
https://www.rabbitmq.com/getstarted.html
https://www.rabbitmq.com/devtools.html
https://github.com/rabbitmq
PHP AMQP
https://github.com/php-amqplib/php-amqplib
????
Obrigado!
https://joind.in/talk/d3ecc
Visite phpsp.org.br

Filas com php