Home > Technology > AMQP for phpMelb

AMQP for phpMelb

Date post: 10-May-2015
Category:
Author: wee-keat-chin
View: 1,044 times
Download: 2 times
Share this document with a friend
Description:
Shorter version of AMQP presentation for Melbourne PHP Users Group.
Embed Size (px)
Popular Tags:
of 68 /68
AMQP Advanced Message Queueing Protocol
Transcript
  • 1.AMQP Advanced Message Queueing Protocol

2. Caveats 3. Event Logging Legacy Architecture & Problem 4. Event Logging ClientClientServerMongoDBClient 5. Connection Issues 80 Client110 ClientServerMongoDB65Client 6. Connection Issues 80 Client110 Client255 ServerMongoDB65Client 7. Server MIA 0Client00ServerClientMongoDB0Client 8. Network Segmentation 0Client0ServerClientMongoDB0Client 9. Total data loss 10. DATA LOSS?! 11. Why AMQP? Stable and mature Designed for SX markets Widely supported (good interop) Modular, Fast & Flexible 12. AMQP Overview AMQPService Model WireAdvanced Message Queueing Protocol 13. AMQP Overview AMQPAMQ ModelWire 14. AMQP Overview AMQPAMQ ModelServer-side service modeldened componentsrules for wiringWire 15. AMQP Overview AMQPAMQ ModelWireNetwork wire-level protocolcommand architectureconnections, channels, etc 16. AMQ ModelAMQ Model Exchange Queues Binding 17. AMQ Model AMQ ModelExchangeQueuesBinding 18. AMQ Model Virtual HostAMQ ModelExchangeQueuesBinding 19. AMQ Model Virtual HostAMQ ModelPublisherExchangeQueuesBindingConsumer 20. AMQ Model Virtual HostExchangePublisherQueuesBindingConsumer 21. AMQ Model Virtual Host Router MessagePublisherExchangeQueuesBindingConsumer 22. AMQ Model Virtual Host Router MessagePublisherExchangeQueuesBindingConsumer 23. AMQ Model Virtual Host Router MessagePublisherExchange?BindingQueuesConsumer 24. AMQ Model Virtual Host Router MessagePublisherExchange?BindingQueuesConsumer 25. AMQ Model Virtual Host Router MessagePublisherExchangeQueuesBinding Queue: critical_error_queueExchange: errors_exchangeFilter:*.error.criticalConsumer 26. AMQ Model Virtual Host Router MessagePublisherExchangeQueuesBinding Queue: critical_error_queueExchange: errors_exchangeFilter:*.error.criticalConsumer 27. Important notes Publisher can createexchanges and queuesExchange routes messages based oncriteria doesnt store messages can inspect message content can be created at runtime consumersQueuesstore messagesnamedbound-able to exchangecriteriacan be created at runtime by consumers Binding creates a relationship betweenConsumer can createqueues and exchangesexchanges and contains criteria and properties queues can be created at runtime by consumers 28. The Exchange Exchange 29. The Exchange ExchangeTypesHeaders System Fanout Topic (routing algo) 30. The Exchange ExchangeTypes(routing algo)DirectFanoutTopicHeadersSystem 31. The Exchange ExchangeTypes(routing algo)DirectFanoutTopicHeadersSystem 32. Direct Type Exchange Exchangeevents 33. Direct Type Exchange Message event.user.clickMessage event.user.viewMessage event.user.shareExchangeevents 34. Direct Type Exchange Message event.user.click user_click_queueMessage event.user.viewMessage event.user.shareExchangeevents 35. Direct Type Exchange Message event.user.click user_click_queueMessage event.user.viewExchangeeventsMessage event.user.shareBindingQueue: user_click_queue 36. Direct Type Exchange Message event.user.click user_click_queueMessage event.user.viewExchangeeventsMessage event.user.shareBindingQueue: user_click_queue Exchange: events 37. Direct Type Exchange Message event.user.click user_click_queueMessage event.user.viewExchangeeventsMessage event.user.shareBindingQueue: user_click_queue Exchange: events Routing Key: event.user.click 38. Direct Type Exchange Message PHP Scriptevent.user.click user_click_queueMessage event.user.viewExchangeeventsPHP ScriptMessage PHP Scriptevent.user.shareBindingQueue: user_click_queue Exchange: events Routing Key: event.user.click 39. Direct Type Exchange Message event.user.click user_click_queueMessage event.user.viewMessage Exchangeevents user_view_queueevent.user.shareuser_share_queue 40. Yeah, so? 41. What if user_interaction_queueMessage event.user.clickMessage event.user.viewMessage event.user.shareExchangeeventsuser_shares_queue 42. What if user_interaction_queueMessage event.user.clickMessage event.user.viewMessage event.user.shareExchangeeventsuser_shares_queue 43. What if user_interaction_queueMessage event.user.clickMessage event.user.viewMessage event.user.shareExchangeeventsuser_shares_queue 44. Topic Exchange Message event.user.clickMessage event.user.viewuser_interaction_queueExchangeeventsMessage event.user.shareBinding 45. Topic Exchange Message PHP Scriptevent.user.clickMessage event.user.viewuser_interaction_queueExchangeeventsPHP ScriptMessage PHP Scriptevent.user.shareBindingQueue: user_interaction_queue Exchange: events Routing Key: event.user.* 46. Topic Exchange user_interaction_queueMessage event.user.clickMessage event.user.viewMessage event.user.shareMessage Messageevent.user.*Exchangeeventsevent.user.shareuser_shares_queueMessage 47. Can be done at runtime 48. Topic Exchange user_interaction_queueMessage event.user.clickMessage event.user.viewMessage Message Messageevent.user.*Exchangeeventsevent.user.shareuser_shares_queueevent.user.shareClick vs Share Conversion?Message 49. Topic Exchange user_interaction_queueMessage event.user.clickMessage event.user.viewMessage Message Messageevent.user.*Exchangeeventsevent.user.shareuser_shares_queueMessageevent.user.shareevent.user.shareevent.user.click click_share_queueClick vs Share Conversion?Message Message 50. Topic Exchange user_interaction_queueMessage event.user.clickMessage event.user.viewMessage Message Messageevent.user.*Exchangeeventsevent.user.shareuser_shares_queueMessageevent.user.shareMessage *.*.viewevent.staff.viewlive_view_queueStaff vs user views?Message Message 51. Im still pissed 52. New Event Logging Explorations & Implementation 53. Revisiting Our Logging ClientClientClientMongoDB 54. Event Logging Revised Client MQClientMongoDB MQClient MQ 55. Event Logging Revised Client MQClientMongoDB MQClient MQ 56. Event Logging Revised Client MQClientMongoDB MQClient MQ 57. No data loss! 58. SRSLY?! 59. Event Logging Revised 80Client MQ110MQClient MQ65Client MQMongoDB 60. Event Logging Revised 80Client MQ110MQClient MQ65Client MQMongoDB 61. Event Logging Revised 80Client MQ110MQClient MQ65ClientMQ MQMongoDB 62. Event Logging Revised 80Client MQMQ 110ClientMongoDB MQMQ 65Client MQ 63. Remember Topic Exchange? user_interaction_queueMessage event.user.clickMessage event.user.viewMessage Message Messageevent.user.*Exchangeeventsevent.user.shareuser_shares_queueMessageevent.user.shareMessage event.staff.view*.*.view live_view_queueMessage Message 64. Provides exibility 80MongoDBClient MQ110MQClientReportingSQLMQ65ClientNotication MQ 65. Not Covered durable auto-delete passive qos no-wait ack exclusive message recovery 66. A quick demo of AMQP with RabbitMQ 67. Thank you [email protected]


Recommended