SlideShare a Scribd company logo
1 of 11
Bucharest PHP
Meetup #3 Agenda
18:45 - 19:00 Meet & Greet
19:00 - 19:30 RabbitMQ
19:30 - 20:00 Search in eMAG
20:00 - 21:00 Pizza, Beer &
Networking
Powered by
Join the discussion at
http://bit.ly/phpbucharest
#phpbucharest
Getting started with
RabbitMQ
Bucharest PHP Meetup #3
Andrei Pirvulet
@andreipirvulet
@overdeath
linkedin.com/in/andreipirvulet
● 10 years exp. with PHP
● Software Development Manager
@ eMAG
Agenda
1. Common architecture for a queue system
2. Common use cases for queues
3. RabbitMQ demo
a. Setting up an exchange
b. Setting up a queue
c. Publishing a message
d. Consuming a message
4. PHP usage demo
a. Setting up an exchange
b. Setting up a queue
c. Publishing messages
d. Consuming messages
5. Tales from production
Queue system basic architecture
Examples
1. Resizing images
2. Sending emails
3. Crawling websites
4. Video Encoding
5. Exporting/Importing data
Common use cases
1. Communication between apps/components
a. Data sync
b. Using different languages
2. Asynchronous processing
a. Off loading web servers of heavy requests
b. Handle spikes without crashing
c. Handling systems with different SLAs
d. Scaling when needed
3. Batching
Benefits
1. Decoupling
2. Redundancy
3. Scalability
4. Resiliency
Installing RabbitMQ
1. Install erlang
a. wget -O - 'https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc' | sudo apt-key add -
b. echo "deb http://dl.bintray.com/rabbitmq/debian bionic erlang" | sudo tee /etc/apt/sources.list.d/bintray.erlang.list
c. sudo apt-get update
d. sudo apt-get install erlang-nox
2. Install Rabbit mq
a. wget -O - 'https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc' | sudo apt-key add -
b. echo "deb https://dl.bintray.com/rabbitmq/debian bionic main" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list
c. sudo apt-get update
d. sudo apt-get install rabbitmq-server
3. Enable rabbit mq management-ui:
a. rabbitmq-plugins enable rabbitmq_management
4. Create a new user
a. rabbitmqctl add_user test test
b. rabbitmqctl set_user_tags test administrator
c. rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
Demo
Tales from production
1. Publish rate and consume rate should be similar
2. Entity deduplication
3. Publish order is not always the same as processing order
4. Processing messages more than once
5. One message can hang up the whole system
6. Loss of messages is inevitable
7. Long running processes in PHP can be a handful

More Related Content

What's hot

Instalar un repositorio_centos
Instalar un repositorio_centosInstalar un repositorio_centos
Instalar un repositorio_centos
James Jara
 
Kick-off Project 2: Presentatie Linux
Kick-off Project 2: Presentatie LinuxKick-off Project 2: Presentatie Linux
Kick-off Project 2: Presentatie Linux
Patrick Koning
 

What's hot (17)

60
6060
60
 
Why Bundler 1.1 will be much faster
Why Bundler 1.1 will be much fasterWhy Bundler 1.1 will be much faster
Why Bundler 1.1 will be much faster
 
Swift on raspberry pi
Swift on raspberry piSwift on raspberry pi
Swift on raspberry pi
 
57
5757
57
 
58
5858
58
 
Open web mail setup
Open web mail setupOpen web mail setup
Open web mail setup
 
论文答辩
论文答辩论文答辩
论文答辩
 
Jas bitbucket
Jas bitbucketJas bitbucket
Jas bitbucket
 
Zookeper
ZookeperZookeper
Zookeper
 
Instalar un repositorio_centos
Instalar un repositorio_centosInstalar un repositorio_centos
Instalar un repositorio_centos
 
Build-a-Gem Workshop
Build-a-Gem WorkshopBuild-a-Gem Workshop
Build-a-Gem Workshop
 
Kick-off Project 2: Presentatie Linux
Kick-off Project 2: Presentatie LinuxKick-off Project 2: Presentatie Linux
Kick-off Project 2: Presentatie Linux
 
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019
 
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019
 
vagrant-php
vagrant-phpvagrant-php
vagrant-php
 
Teledoom by Matt Williams for TADHack Orlando online 2020
Teledoom by Matt Williams for TADHack Orlando online 2020Teledoom by Matt Williams for TADHack Orlando online 2020
Teledoom by Matt Williams for TADHack Orlando online 2020
 
Ruby on Windows - HOW TO install and set up
Ruby on Windows - HOW TO install and set upRuby on Windows - HOW TO install and set up
Ruby on Windows - HOW TO install and set up
 

Similar to Getting started with rabbitmq

Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
Iker Coranti
 

Similar to Getting started with rabbitmq (20)

Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Proactive monitoring with Monit
Proactive monitoring with MonitProactive monitoring with Monit
Proactive monitoring with Monit
 
From the internet of things to the web of things course
From the internet of things to the web of things courseFrom the internet of things to the web of things course
From the internet of things to the web of things course
 
DevOPS training - Day 1/2
DevOPS training - Day 1/2DevOPS training - Day 1/2
DevOPS training - Day 1/2
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Salting new ground one man ops from scratch
Salting new ground   one man ops from scratchSalting new ground   one man ops from scratch
Salting new ground one man ops from scratch
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
 
Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023
 
Mcollective introduction
Mcollective introductionMcollective introduction
Mcollective introduction
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
 
Linux processes control and monitoring
Linux processes control and monitoringLinux processes control and monitoring
Linux processes control and monitoring
 
HyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdfHyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdf
 
SoHo Honeypot (LUGS)
SoHo Honeypot (LUGS)SoHo Honeypot (LUGS)
SoHo Honeypot (LUGS)
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
Making Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixMaking Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch Fix
 
Devoxx Maroc 2015 HTTP 1, HTTP 2 and folks
Devoxx Maroc  2015 HTTP 1, HTTP 2 and folksDevoxx Maroc  2015 HTTP 1, HTTP 2 and folks
Devoxx Maroc 2015 HTTP 1, HTTP 2 and folks
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Deep dive into Verdaccio - NodeTLV 2022 - Israel
Deep dive into Verdaccio - NodeTLV 2022 - IsraelDeep dive into Verdaccio - NodeTLV 2022 - Israel
Deep dive into Verdaccio - NodeTLV 2022 - Israel
 
HTTP/3 for everyone
HTTP/3 for everyoneHTTP/3 for everyone
HTTP/3 for everyone
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Getting started with rabbitmq

  • 1. Bucharest PHP Meetup #3 Agenda 18:45 - 19:00 Meet & Greet 19:00 - 19:30 RabbitMQ 19:30 - 20:00 Search in eMAG 20:00 - 21:00 Pizza, Beer & Networking Powered by Join the discussion at http://bit.ly/phpbucharest #phpbucharest
  • 3. Andrei Pirvulet @andreipirvulet @overdeath linkedin.com/in/andreipirvulet ● 10 years exp. with PHP ● Software Development Manager @ eMAG
  • 4. Agenda 1. Common architecture for a queue system 2. Common use cases for queues 3. RabbitMQ demo a. Setting up an exchange b. Setting up a queue c. Publishing a message d. Consuming a message 4. PHP usage demo a. Setting up an exchange b. Setting up a queue c. Publishing messages d. Consuming messages 5. Tales from production
  • 5. Queue system basic architecture
  • 6. Examples 1. Resizing images 2. Sending emails 3. Crawling websites 4. Video Encoding 5. Exporting/Importing data
  • 7. Common use cases 1. Communication between apps/components a. Data sync b. Using different languages 2. Asynchronous processing a. Off loading web servers of heavy requests b. Handle spikes without crashing c. Handling systems with different SLAs d. Scaling when needed 3. Batching
  • 8. Benefits 1. Decoupling 2. Redundancy 3. Scalability 4. Resiliency
  • 9. Installing RabbitMQ 1. Install erlang a. wget -O - 'https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc' | sudo apt-key add - b. echo "deb http://dl.bintray.com/rabbitmq/debian bionic erlang" | sudo tee /etc/apt/sources.list.d/bintray.erlang.list c. sudo apt-get update d. sudo apt-get install erlang-nox 2. Install Rabbit mq a. wget -O - 'https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc' | sudo apt-key add - b. echo "deb https://dl.bintray.com/rabbitmq/debian bionic main" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list c. sudo apt-get update d. sudo apt-get install rabbitmq-server 3. Enable rabbit mq management-ui: a. rabbitmq-plugins enable rabbitmq_management 4. Create a new user a. rabbitmqctl add_user test test b. rabbitmqctl set_user_tags test administrator c. rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
  • 10. Demo
  • 11. Tales from production 1. Publish rate and consume rate should be similar 2. Entity deduplication 3. Publish order is not always the same as processing order 4. Processing messages more than once 5. One message can hang up the whole system 6. Loss of messages is inevitable 7. Long running processes in PHP can be a handful

Editor's Notes

  1. Interfata rabbitMq Creeare vhost Creeare exchange fanout + o coada Adaugare inca o coada la exchange fanout Creeare exchange topic + 2 cozi Publicare mesaj care merge pe una din cozi Publicare mesaje care merg alternativ pe anumite cozi Cod PHP Instalare librarie amqp Config Publicare mesaje Citire mesaje cu 1 worker Folosire supervisor.d si scalare la 10 workeri