TDC2016SP - Fillas com php

37
Filas com PHP

Transcript of TDC2016SP - Fillas com php

Filas com PHP

Ivan RosolenGraduado em Sistemas de InformaçãoPós-graduado em Gerência de Projetos

Desenvolvedor a 15+ anosAutor 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 2routing_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

????

Obrigado!

https://joind.in/talk/d3ecc

Visite phpsp.org.br