Introduction to RabbitMQ | Meetup at Pivotal Labs
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Introduction to RabbitMQ | Meetup at Pivotal Labs

  • 2,305 views
Uploaded on

The Pub/Sub Pattern image form slide 51 is taken from here: http://www.eaipatterns.com/PublishSubscribeChannel.html

The Pub/Sub Pattern image form slide 51 is taken from here: http://www.eaipatterns.com/PublishSubscribeChannel.html

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,305
On Slideshare
2,286
From Embeds
19
Number of Embeds
1

Actions

Shares
Downloads
55
Comments
0
Likes
5

Embeds 19

https://twitter.com 19

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Introduction to RabbitMQ AlvaroVidela - Pivotal / RabbitMQ Friday, September 13, 13
  • 2. AlvaroVidela • Developer Advocate at Pivotal / RabbitMQ • Co-Author of RabbitMQ in Action • Creator of the RabbitMQ Simulator • Blogs about RabbitMQ Internals: http://videlalvaro.github.io/internals.html • @old_sound | avidela@gopivotal.com github.com/videlalvaro Friday, September 13, 13
  • 3. About Me Co-authored RabbitMQ in Action http://bit.ly/rabbitmq Friday, September 13, 13
  • 4. Why do we need messaging? Friday, September 13, 13
  • 5. Classic Web Apps Friday, September 13, 13
  • 6. Implement a Photo Gallery Friday, September 13, 13
  • 7. Two Parts: Friday, September 13, 13
  • 8. Pretty Simple Friday, September 13, 13
  • 9. ‘Till new requirements arrive Friday, September 13, 13
  • 10. The Product Owner Friday, September 13, 13
  • 11. Can we also notify the user friends when she uploads a new image? Friday, September 13, 13
  • 12. Can we also notify the user friends when she uploads a new image? I forgot to mention we need it for tomorrow… Friday, September 13, 13
  • 13. The Social Media Guru Friday, September 13, 13
  • 14. We need to give badges to users for each picture upload Friday, September 13, 13
  • 15. We need to give badges to users for each picture upload and post uploads to Twitter Friday, September 13, 13
  • 16. The Sysadmin Friday, September 13, 13
  • 17. Dumb!You’re delivering full size images! The bandwidth bill has tripled! Friday, September 13, 13
  • 18. Dumb!You’re delivering full size images! The bandwidth bill has tripled! We need this fixed for yesterday! Friday, September 13, 13
  • 19. The Developer in the other team Friday, September 13, 13
  • 20. I need to call your Java stuff but from Python Friday, September 13, 13
  • 21. I need to call your Java stuff but from Python And also PHP starting next week Friday, September 13, 13
  • 22. The User Friday, September 13, 13
  • 23. I don’t want to wait till your app resizes my image! Friday, September 13, 13
  • 24. You Friday, September 13, 13
  • 25. (╯°□°)╯︵ ┻━┻ Friday, September 13, 13
  • 26. Let’s see the code evolution Friday, September 13, 13
  • 27. %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Pseudo Code Comments Friday, September 13, 13
  • 28. %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Pseudo Code Function Name Friday, September 13, 13
  • 29. %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Pseudo Code Arguments Friday, September 13, 13
  • 30. %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Pseudo Code Function Body Friday, September 13, 13
  • 31. %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Pseudo Code ReturnValue Friday, September 13, 13
  • 32. %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. First Implementation: Friday, September 13, 13
  • 33. %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), resize_image(Image), ok. Second Implementation: Friday, September 13, 13
  • 34. %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), resize_image(Image), notify_friends(ReqData:get_user()), ok. Third Implementation: Friday, September 13, 13
  • 35. %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), resize_image(Image), notify_friends(ReqData:get_user()), add_points_to_user(ReqData:get_user()), ok. Fourth Implementation: Friday, September 13, 13
  • 36. %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), resize_image(Image), notify_friends(ReqData:get_user()), add_points_to_user(ReqData:get_user()), tweet_new_image(User, Image), ok. Final Implementation: Friday, September 13, 13
  • 37. Can our code scale to new requirements? Friday, September 13, 13
  • 38. What if Friday, September 13, 13
  • 39. • We need to speed up image conversion What if Friday, September 13, 13
  • 40. • We need to speed up image conversion • User notifications sent by email What if Friday, September 13, 13
  • 41. • We need to speed up image conversion • User notifications sent by email • Stop tweeting about new images What if Friday, September 13, 13
  • 42. • We need to speed up image conversion • User notifications sent by email • Stop tweeting about new images • Resize in different formats What if Friday, September 13, 13
  • 43. • We need to speed up image conversion • User notifications sent by email • Stop tweeting about new images • Resize in different formats • Swap Language / Technology (No Down Time) What if Friday, September 13, 13
  • 44. Can we do better? Friday, September 13, 13
  • 45. Sure. Using messaging Friday, September 13, 13
  • 46. Design Publish / Subscribe Pattern Friday, September 13, 13
  • 47. %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), Msg = #msg{user = ReqData:get_user(), image = Image}, publish_message('new_image', Msg). First Implementation: Friday, September 13, 13
  • 48. %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), Msg = #msg{user = ReqData:get_user(), image = Image}, publish_message('new_image', Msg). First Implementation: %% friends notifier on('new_image', Msg) -> notify_friends(Msg.user, Msg.image). Friday, September 13, 13
  • 49. %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), Msg = #msg{user = ReqData:get_user(), image = Image}, publish_message('new_image', Msg). First Implementation: %% friends notifier on('new_image', Msg) -> notify_friends(Msg.user, Msg.image). %% points manager on('new_image', Msg) -> add_points(Msg.user, 'new_image'). Friday, September 13, 13
  • 50. %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), Msg = #msg{user = ReqData:get_user(), image = Image}, publish_message('new_image', Msg). First Implementation: %% friends notifier on('new_image', Msg) -> notify_friends(Msg.user, Msg.image). %% points manager on('new_image', Msg) -> add_points(Msg.user, 'new_image'). %% resizer on('new_image', Msg) -> resize_image(Msg.image). Friday, September 13, 13
  • 51. Second Implementation: Friday, September 13, 13
  • 52. Second Implementation: THIS PAGE INTENTIONALLY LEFT BLANK Friday, September 13, 13
  • 53. What is RabbitMQ Friday, September 13, 13
  • 54. RabbitMQ Friday, September 13, 13
  • 55. RabbitMQ • Multi Protocol Messaging Server Friday, September 13, 13
  • 56. RabbitMQ • Multi Protocol Messaging Server • Open Source (MPL) Friday, September 13, 13
  • 57. RabbitMQ • Multi Protocol Messaging Server • Open Source (MPL) • Polyglot Friday, September 13, 13
  • 58. RabbitMQ • Multi Protocol Messaging Server • Open Source (MPL) • Polyglot • Written in Erlang/OTP Friday, September 13, 13
  • 59. Multi Protocol http://bit.ly/rmq-protocols Friday, September 13, 13
  • 60. Polyglot Friday, September 13, 13
  • 61. Polyglot • Java Friday, September 13, 13
  • 62. Polyglot • Java • node.js Friday, September 13, 13
  • 63. Polyglot • Java • node.js • Erlang Friday, September 13, 13
  • 64. Polyglot • Java • node.js • Erlang • PHP Friday, September 13, 13
  • 65. Polyglot • Java • node.js • Erlang • PHP • Ruby Friday, September 13, 13
  • 66. Polyglot • Java • node.js • Erlang • PHP • Ruby • .Net Friday, September 13, 13
  • 67. Polyglot • Java • node.js • Erlang • PHP • Ruby • .Net • Haskell Friday, September 13, 13
  • 68. Polyglot Even COBOL!!!11 Friday, September 13, 13
  • 69. Some users of RabbitMQ Friday, September 13, 13
  • 70. Some users of RabbitMQ • Instagram Friday, September 13, 13
  • 71. Some users of RabbitMQ • Instagram • Indeed.com Friday, September 13, 13
  • 72. Some users of RabbitMQ • Instagram • Indeed.com • MailboxApp Friday, September 13, 13
  • 73. Some users of RabbitMQ • Instagram • Indeed.com • MailboxApp • Mercado Libre Friday, September 13, 13
  • 74. Friday, September 13, 13
  • 75. Messaging with RabbitMQ A demo with the RabbitMQ Simulator https://github.com/RabbitMQSimulator/RabbitMQSimulator Friday, September 13, 13
  • 76. Thanks AlvaroVidela - @old_sound Friday, September 13, 13