Marcela Godoy
DarkmiraTour 2019
Full-Stack Developer @ AGV Logistic
PHPSP Campinas member
PHPWomen Evangelist
❤️📖☕
Confirm
arrival;
Unique response;
Multiple responses.
Request
Response
Applications too...
Buy a
ticket
Send confirmation
Process
payment
Send a
ticket
Buy a
ticket
Send
confirmation
Process
payment
Send a
ticket
Publisher
Message Broker
Consumer
(sender)
(recipient)
Facilitated communication between services and microservices
Performance improvement with asynchronous process
Scalability and decoupling in a easy way
Open Source
Advanced Message Queuing Protocol
Interoperability between services
Sets message patterns
Broker
Exchange
Virtual Host
Queue
Binding
Channel
Consumer
Publisher
Open Source
Written in Erlang
Huge reliability in distributed systems
Run on several operational system and languages
Has many plugins
More infos in http://www.rabbitmq.com/download.html
It works in http://<localhost>:15672
https://github.com/php-amqplib/php-amqplib
$ composer require php-amqplib/php-amqplib
Use your favorite language. There will be a library for this.
Create a connection and channel
Create your message and send to exchange =)
'Name' - Name of queue
'Durable' - Are we going to survive the restart?
'Auto_delete' - What happens after the last message?
'Nowait' - Should we wait for an answer?
Don't forget the connection and channel
Let's consume the queue items
Exchange
Queues
Exchange
Queues
Archive
Crop
Resize
Exchange
Queues
*.web
*.log
Exchange
Queues
Archive
Crop
Resize
Use header informations as routing key
Exchange
Publisher
Queue
Consumer
Exchange
Reject Queue
Exchange
Publisher
Queue
Consumer
Queue
Queue
Cloud
DB
Exchange
Publisher
Delay Queue
Exchange
Queue
http://www.rabbitmq.com/getstarted.html