SlideShare ist ein Scribd-Unternehmen logo
1 von 107
Downloaden Sie, um offline zu lesen
Cloud Messaging with
                           Cloud Foundry
                           Álvaro Videla - VMware




                           © 2012 VMware, Inc. All rights reserved.
Tuesday, November 13, 12
About Me


                • Developer Advocate for Cloud Foundry
                • Blog: http://videlalvaro.github.com/
                • Twitter: @old_sound




                                                         2
Tuesday, November 13, 12
About Me


                •   Developer Advocate for Cloud Foundry
                •   Blog: http://videlalvaro.github.com/
                •   Twitter: @old_sound
                •   I created gifsockets™




                                                           3
Tuesday, November 13, 12
About Me



            Co-authored

            RabbitMQ in Action




              http://bit.ly/rabbitmq




                                       4
Tuesday, November 13, 12
Classic Apps



                                          5
Tuesday, November 13, 12
Implement a
                           Photo Gallery


Tuesday, November 13, 12
Two Parts:




Tuesday, November 13, 12
Pretty Simple



Tuesday, November 13, 12
‘Till new
                           requirements arrive


Tuesday, November 13, 12
The Product Owner



Tuesday, November 13, 12
Can we also notify the
                   user friends when she
                   uploads a new image?


Tuesday, November 13, 12
Can we also notify the
                   user friends when she
                   uploads a new image?
      I forgot to mention we need it for tomorrow…

Tuesday, November 13, 12
Tuesday, November 13, 12
The Social Media Guru



Tuesday, November 13, 12
We need to give badges
                  to users for each
                   picture upload


Tuesday, November 13, 12
We need to give badges
                  to users for each
                   picture upload
                           and post uploads to Twitter

Tuesday, November 13, 12
Tuesday, November 13, 12
The Sysadmin



Tuesday, November 13, 12
Dumb! You’re delivering
                   full size images!
                The bandwidth bill has
                        tripled!

Tuesday, November 13, 12
Dumb! You’re delivering
                   full size images!
                The bandwidth bill has
                        tripled!
                           We need this fixed for yesterday!
Tuesday, November 13, 12
Tuesday, November 13, 12
The Developer in the
                          other team


Tuesday, November 13, 12
I need to call your PHP
                  stuff but from Python


Tuesday, November 13, 12
I need to call your PHP
                  stuff but from Python

                           And also Java starting next week
Tuesday, November 13, 12
Tuesday, November 13, 12
The User



Tuesday, November 13, 12
I don’t want to wait
                           till your app resizes
                                 my image!


Tuesday, November 13, 12
You



Tuesday, November 13, 12
Tuesday, November 13, 12
Let’s see the
                           code evolution



                                            30
Tuesday, November 13, 12
Pseudo Code

                               Comments


           %% image_controller
           handle('PUT', "/user/image", ReqData) ->
             image_handler:do_upload(ReqData:get_file()),
             ok.




Tuesday, November 13, 12
Pseudo Code

                             Function Name


           %% image_controller
           handle('PUT', "/user/image", ReqData) ->
             image_handler:do_upload(ReqData:get_file()),
             ok.




Tuesday, November 13, 12
Pseudo Code

                               Arguments


           %% image_controller
           handle('PUT', "/user/image", ReqData) ->
             image_handler:do_upload(ReqData:get_file()),
             ok.




Tuesday, November 13, 12
Pseudo Code

                             Function Body


           %% image_controller
           handle('PUT', "/user/image", ReqData) ->
             image_handler:do_upload(ReqData:get_file()),
             ok.




Tuesday, November 13, 12
Pseudo Code

                              Return Value


           %% image_controller
           handle('PUT', "/user/image", ReqData) ->
             image_handler:do_upload(ReqData:get_file()),
             ok.




Tuesday, November 13, 12
First Implementation:

           %% image_controller
           handle('PUT', "/user/image", ReqData) ->
             image_handler:do_upload(ReqData:get_file()),
             ok.




Tuesday, November 13, 12
Second Implementation:

           %% image_controller
           handle('PUT', "/user/image", ReqData) ->
             {ok, Image} = image_handler:do_upload(ReqData:get_file()),
             resize_image(Image),
             ok.




Tuesday, November 13, 12
Third Implementation:

           %% 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.




Tuesday, November 13, 12
Fourth Implementation:

           %% 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.




Tuesday, November 13, 12
Final Implementation:

           %% 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.




Tuesday, November 13, 12
Can our code scale to
                   new requirements?



                                          41
Tuesday, November 13, 12
What if




                           42
Tuesday, November 13, 12
What if



                • We need to speed up image conversion




                                                         43
Tuesday, November 13, 12
What if



                • We need to speed up image conversion
                • User notification has to be sent by email




                                                              44
Tuesday, November 13, 12
What if



                • We need to speed up image conversion
                • User notification has to be sent by email
                • Stop tweeting about new images




                                                              45
Tuesday, November 13, 12
What if



                •   We need to speed up image conversion
                •   User notification has to be sent by email
                •   Stop tweeting about new images
                •   Resize in different formats




                                                                46
Tuesday, November 13, 12
What if



                •   We need to speed up image conversion
                •   User notification has to be sent by email
                •   Stop tweeting about new images
                •   Resize in different formats
                •   Swap Language / Technology




                                                                47
Tuesday, November 13, 12
What if



                •   We need to speed up image conversion
                •   User notification has to be sent by email
                •   Stop tweeting about new images
                •   Resize in different formats
                •   Swap Language / Technology (No Down Time)




                                                                48
Tuesday, November 13, 12
Can we do better?



                                               49
Tuesday, November 13, 12
Sure.
                           Using messaging



                                             50
Tuesday, November 13, 12
Design
                           Publish / Subscribe Pattern




Tuesday, November 13, 12
First Implementation:
           %% 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).




Tuesday, November 13, 12
First Implementation:
           %% 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).

           %% friends notifier
           on('new_image', Msg) ->
             notify_friends(Msg.user, Msg.image).




Tuesday, November 13, 12
First Implementation:
           %% 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).

           %% friends notifier
           on('new_image', Msg) ->
             notify_friends(Msg.user, Msg.image).

           %% points manager
           on('new_image', Msg) ->
             add_points(Msg.user, 'new_image').




Tuesday, November 13, 12
First Implementation:
           %% 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).

           %% 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).


Tuesday, November 13, 12
Second Implementation:




Tuesday, November 13, 12
Second Implementation:




                           THIS PAGE INTENTIONALLY LEFT BLANK




Tuesday, November 13, 12
Tuesday, November 13, 12
Messaging




                           59
Tuesday, November 13, 12
Messaging



                • Share data across processes




                                                60
Tuesday, November 13, 12
Messaging



                • Share data across processes
                • Processes can be part of different apps




                                                            61
Tuesday, November 13, 12
Messaging



                • Share data across processes
                • Processes can be part of different apps
                • Apps can live in different machines




                                                            62
Tuesday, November 13, 12
Messaging



                •   Share data across processes
                •   Processes can be part of different apps
                •   Apps can live in different machines
                •   Communication is Asynchronous




                                                              63
Tuesday, November 13, 12
Main Concepts




                           64
Tuesday, November 13, 12
Main Concepts



                • Messages are sent by Producers




                                                   65
Tuesday, November 13, 12
Main Concepts



                • Messages are sent by Producers
                • Messages are delivered to Consumers




                                                        66
Tuesday, November 13, 12
How can we
                 start using messaging
                         today?


                                         67
Tuesday, November 13, 12
Enter




                                   68
Tuesday, November 13, 12
Why Cloud Foundry is
                        Good™
                    for Messaging?


                                         69
Tuesday, November 13, 12
Key aspects of Cloud Foundry




                                    70
Tuesday, November 13, 12
Key aspects of Cloud Foundry

     • Supports many apps per account




                                        71
Tuesday, November 13, 12
Key aspects of Cloud Foundry

     • Supports many apps per account
     • Supports many services per account




                                            72
Tuesday, November 13, 12
Key aspects of Cloud Foundry

     • Supports many apps per account
     • Supports many services per account
     • Services can be shared across apps




                                            73
Tuesday, November 13, 12
Key aspects of Cloud Foundry

     •   Supports many apps per account
     •   Supports many services per account
     •   Services can be shared across apps
     •   Supports RabbitMQ by default




                                              74
Tuesday, November 13, 12
Intermission:




                            What is
                           RabbitMQ

                                      75
Tuesday, November 13, 12
RabbitMQ




                           76
Tuesday, November 13, 12
RabbitMQ

     • Multi Protocol Messaging Server




                                         77
Tuesday, November 13, 12
RabbitMQ

     • Multi Protocol Messaging Server
     • Open Source (MPL)




                                         78
Tuesday, November 13, 12
RabbitMQ

     • Multi Protocol Messaging Server
     • Open Source (MPL)
     • Part of Spring Source




                                         79
Tuesday, November 13, 12
RabbitMQ

     •   Multi Protocol Messaging Server
     •   Open Source (MPL)
     •   Part of Spring Source
     •   Supports AMQP, STOMP, MQTT




                                           80
Tuesday, November 13, 12
RabbitMQ

     •   Multi Protocol Messaging Server
     •   Open Source (MPL)
     •   Part of Spring Source
     •   Supports AMQP, STOMP, MQTT
     •   Has Clients for Many Platforms: Java, Ruby, node.js, PHP,
         Erlang, .Net., more




                                                                     81
Tuesday, November 13, 12
TELL ME MORE



                                          82
Tuesday, November 13, 12
TELL ME MORE
                             RabbitMQ Simulator Demo




                                                       83
Tuesday, November 13, 12
Sample App: CloudStagram




                                84
Tuesday, November 13, 12
Sample App: CloudStagram




                                85
Tuesday, November 13, 12
Sample App: CloudStagram




                                86
Tuesday, November 13, 12
Sample App: CloudStagram




                                87
Tuesday, November 13, 12
Sample App: CloudStagram




                                88
Tuesday, November 13, 12
Sample App: CloudStagram




                                89
Tuesday, November 13, 12
Sample App: CloudStagram




                                90
Tuesday, November 13, 12
Sample App: CloudStagram


    Frontend App
          node.js




                                91
Tuesday, November 13, 12
Sample App: CloudStagram


    Frontend App
          node.js




            Image Resizers
                   node.js


                                92
Tuesday, November 13, 12
Sample App: CloudStagram


    Frontend App
          node.js




            Image Resizers
                   Clojure


                                93
Tuesday, November 13, 12
CODE OR
        IT DIDN’T HAPPEN

                           94
Tuesday, November 13, 12
CODA

                                  95
Tuesday, November 13, 12
Messaging

                                96
Tuesday, November 13, 12
Scale



                    Messaging

                                97
Tuesday, November 13, 12
Scale      Decoupling



                    Messaging

                                        98
Tuesday, November 13, 12
Scale             Decoupling



                    Messaging
                           Polyglot
                                               99
Tuesday, November 13, 12
100
Tuesday, November 13, 12
Heavy
                  Lifting




                            101
Tuesday, November 13, 12
Heavy     Multi
                  Lifting   Apps




                                    102
Tuesday, November 13, 12
Heavy     Multi
                  Lifting   Apps




             Multi
            Services
                                    103
Tuesday, November 13, 12
Heavy       Multi
                  Lifting     Apps




             Multi            Cloud
            Services        Messaging
                                        104
Tuesday, November 13, 12
Sign Up Today



                     https://my.cloudfoundry.com/signup



                                                          105
Tuesday, November 13, 12
Questions?



                                        106
Tuesday, November 13, 12
Thanks!
                                    Álvaro Videla
                              http://twitter.com/old_sound
                              http://github.com/videlalvaro
                           http://www.slideshare.net/old_sound




                                                                 107
Tuesday, November 13, 12

Weitere ähnliche Inhalte

Ähnlich wie Cloud Messaging With Cloud Foundry

Adapt and respond: keeping responsive into the future
Adapt and respond: keeping responsive into the futureAdapt and respond: keeping responsive into the future
Adapt and respond: keeping responsive into the futureChris Mills
 
component: ruby gems for the browser
component: ruby gems for the browsercomponent: ruby gems for the browser
component: ruby gems for the browserTimothy Oxley
 
Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5C4Media
 
Html5 Audio & video
Html5 Audio & videoHtml5 Audio & video
Html5 Audio & videoCarlos Solis
 
RTV Rijnmond slides voor discussie
RTV Rijnmond slides voor discussieRTV Rijnmond slides voor discussie
RTV Rijnmond slides voor discussieVincent Everts
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondSpike Brehm
 
Html5 new sword for interactive app
Html5 new sword for interactive appHtml5 new sword for interactive app
Html5 new sword for interactive appYohan Totting
 
Cassandra - PHP
Cassandra - PHPCassandra - PHP
Cassandra - PHPmauritsl
 
Baking Delicious Modularity in Scala
Baking Delicious Modularity in ScalaBaking Delicious Modularity in Scala
Baking Delicious Modularity in ScalaDerek Wyatt
 
Educause - Building a Responsive Website for the Presidential Debate
Educause - Building a Responsive Website for the Presidential DebateEducause - Building a Responsive Website for the Presidential Debate
Educause - Building a Responsive Website for the Presidential DebateJon Liu
 
Working With Social APIs - SoMeT12
Working With Social APIs - SoMeT12Working With Social APIs - SoMeT12
Working With Social APIs - SoMeT12Mario Vasquez
 
Responsive Web Design & Workflow
Responsive Web Design & WorkflowResponsive Web Design & Workflow
Responsive Web Design & Workflowhouhr
 
LiveRebel + Pragmatic Continuous Delivery (Arcusys)
LiveRebel + Pragmatic Continuous Delivery (Arcusys)LiveRebel + Pragmatic Continuous Delivery (Arcusys)
LiveRebel + Pragmatic Continuous Delivery (Arcusys)Neeme Praks
 
Voices of the 4.5 Million: A Sound Visualization of the US Housing Crisis
Voices of the 4.5 Million: A Sound Visualization of the US Housing CrisisVoices of the 4.5 Million: A Sound Visualization of the US Housing Crisis
Voices of the 4.5 Million: A Sound Visualization of the US Housing CrisisLiz Khoo
 
Design process
Design processDesign process
Design processTim Wright
 
Replacing Wordpress with Cascade Server (where possible) by Mike Roy
Replacing Wordpress with Cascade Server (where possible) by Mike RoyReplacing Wordpress with Cascade Server (where possible) by Mike Roy
Replacing Wordpress with Cascade Server (where possible) by Mike Royhannonhill
 
I Love Techno - the site
I Love Techno - the siteI Love Techno - the site
I Love Techno - the sitePeter Arato
 

Ähnlich wie Cloud Messaging With Cloud Foundry (20)

Adapt and respond: keeping responsive into the future
Adapt and respond: keeping responsive into the futureAdapt and respond: keeping responsive into the future
Adapt and respond: keeping responsive into the future
 
component: ruby gems for the browser
component: ruby gems for the browsercomponent: ruby gems for the browser
component: ruby gems for the browser
 
Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5Multiplatform, Promises and HTML5
Multiplatform, Promises and HTML5
 
Html5 Audio & video
Html5 Audio & videoHtml5 Audio & video
Html5 Audio & video
 
Scrum version2
Scrum version2Scrum version2
Scrum version2
 
RTV Rijnmond slides voor discussie
RTV Rijnmond slides voor discussieRTV Rijnmond slides voor discussie
RTV Rijnmond slides voor discussie
 
Sortak
SortakSortak
Sortak
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and Beyond
 
Html5 new sword for interactive app
Html5 new sword for interactive appHtml5 new sword for interactive app
Html5 new sword for interactive app
 
Cassandra - PHP
Cassandra - PHPCassandra - PHP
Cassandra - PHP
 
Baking Delicious Modularity in Scala
Baking Delicious Modularity in ScalaBaking Delicious Modularity in Scala
Baking Delicious Modularity in Scala
 
RabbitMQ Hands On
RabbitMQ Hands OnRabbitMQ Hands On
RabbitMQ Hands On
 
Educause - Building a Responsive Website for the Presidential Debate
Educause - Building a Responsive Website for the Presidential DebateEducause - Building a Responsive Website for the Presidential Debate
Educause - Building a Responsive Website for the Presidential Debate
 
Working With Social APIs - SoMeT12
Working With Social APIs - SoMeT12Working With Social APIs - SoMeT12
Working With Social APIs - SoMeT12
 
Responsive Web Design & Workflow
Responsive Web Design & WorkflowResponsive Web Design & Workflow
Responsive Web Design & Workflow
 
LiveRebel + Pragmatic Continuous Delivery (Arcusys)
LiveRebel + Pragmatic Continuous Delivery (Arcusys)LiveRebel + Pragmatic Continuous Delivery (Arcusys)
LiveRebel + Pragmatic Continuous Delivery (Arcusys)
 
Voices of the 4.5 Million: A Sound Visualization of the US Housing Crisis
Voices of the 4.5 Million: A Sound Visualization of the US Housing CrisisVoices of the 4.5 Million: A Sound Visualization of the US Housing Crisis
Voices of the 4.5 Million: A Sound Visualization of the US Housing Crisis
 
Design process
Design processDesign process
Design process
 
Replacing Wordpress with Cascade Server (where possible) by Mike Roy
Replacing Wordpress with Cascade Server (where possible) by Mike RoyReplacing Wordpress with Cascade Server (where possible) by Mike Roy
Replacing Wordpress with Cascade Server (where possible) by Mike Roy
 
I Love Techno - the site
I Love Techno - the siteI Love Techno - the site
I Love Techno - the site
 

Mehr von Alvaro Videla

Improvements in RabbitMQ
Improvements in RabbitMQImprovements in RabbitMQ
Improvements in RabbitMQAlvaro Videla
 
Data Migration at Scale with RabbitMQ and Spring Integration
Data Migration at Scale with RabbitMQ and Spring IntegrationData Migration at Scale with RabbitMQ and Spring Integration
Data Migration at Scale with RabbitMQ and Spring IntegrationAlvaro Videla
 
RabbitMQ Data Ingestion at Craft Conf
RabbitMQ Data Ingestion at Craft ConfRabbitMQ Data Ingestion at Craft Conf
RabbitMQ Data Ingestion at Craft ConfAlvaro Videla
 
Scaling applications with RabbitMQ at SunshinePHP
Scaling applications with RabbitMQ   at SunshinePHPScaling applications with RabbitMQ   at SunshinePHP
Scaling applications with RabbitMQ at SunshinePHPAlvaro Videla
 
Unit Test + Functional Programming = Love
Unit Test + Functional Programming = LoveUnit Test + Functional Programming = Love
Unit Test + Functional Programming = LoveAlvaro Videla
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data IngestionAlvaro Videla
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureAlvaro Videla
 
Introduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal LabsIntroduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal LabsAlvaro Videla
 
Writing testable code
Writing testable codeWriting testable code
Writing testable codeAlvaro Videla
 
Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot SystemAlvaro Videla
 
Cloud Foundry Bootcamp
Cloud Foundry BootcampCloud Foundry Bootcamp
Cloud Foundry BootcampAlvaro Videla
 
Código Fácil De Testear
Código Fácil De TestearCódigo Fácil De Testear
Código Fácil De TestearAlvaro Videla
 
Theres a rabbit on my symfony
Theres a rabbit on my symfonyTheres a rabbit on my symfony
Theres a rabbit on my symfonyAlvaro Videla
 
Scaling Web Apps With RabbitMQ - Erlang Factory Lite
Scaling Web Apps With RabbitMQ - Erlang Factory LiteScaling Web Apps With RabbitMQ - Erlang Factory Lite
Scaling Web Apps With RabbitMQ - Erlang Factory LiteAlvaro Videla
 
Integrating Erlang with PHP
Integrating Erlang with PHPIntegrating Erlang with PHP
Integrating Erlang with PHPAlvaro Videla
 
Interoperability With RabbitMq
Interoperability With RabbitMqInteroperability With RabbitMq
Interoperability With RabbitMqAlvaro Videla
 
Debugging and Profiling Symfony Apps
Debugging and Profiling Symfony AppsDebugging and Profiling Symfony Apps
Debugging and Profiling Symfony AppsAlvaro Videla
 

Mehr von Alvaro Videla (20)

Improvements in RabbitMQ
Improvements in RabbitMQImprovements in RabbitMQ
Improvements in RabbitMQ
 
Data Migration at Scale with RabbitMQ and Spring Integration
Data Migration at Scale with RabbitMQ and Spring IntegrationData Migration at Scale with RabbitMQ and Spring Integration
Data Migration at Scale with RabbitMQ and Spring Integration
 
RabbitMQ Data Ingestion at Craft Conf
RabbitMQ Data Ingestion at Craft ConfRabbitMQ Data Ingestion at Craft Conf
RabbitMQ Data Ingestion at Craft Conf
 
Scaling applications with RabbitMQ at SunshinePHP
Scaling applications with RabbitMQ   at SunshinePHPScaling applications with RabbitMQ   at SunshinePHP
Scaling applications with RabbitMQ at SunshinePHP
 
Unit Test + Functional Programming = Love
Unit Test + Functional Programming = LoveUnit Test + Functional Programming = Love
Unit Test + Functional Programming = Love
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data Ingestion
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal Architecture
 
Introduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal LabsIntroduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal Labs
 
Writing testable code
Writing testable codeWriting testable code
Writing testable code
 
Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot System
 
Cloud Foundry Bootcamp
Cloud Foundry BootcampCloud Foundry Bootcamp
Cloud Foundry Bootcamp
 
Taming the rabbit
Taming the rabbitTaming the rabbit
Taming the rabbit
 
Vertx
VertxVertx
Vertx
 
Código Fácil De Testear
Código Fácil De TestearCódigo Fácil De Testear
Código Fácil De Testear
 
Messaging patterns
Messaging patternsMessaging patterns
Messaging patterns
 
Theres a rabbit on my symfony
Theres a rabbit on my symfonyTheres a rabbit on my symfony
Theres a rabbit on my symfony
 
Scaling Web Apps With RabbitMQ - Erlang Factory Lite
Scaling Web Apps With RabbitMQ - Erlang Factory LiteScaling Web Apps With RabbitMQ - Erlang Factory Lite
Scaling Web Apps With RabbitMQ - Erlang Factory Lite
 
Integrating Erlang with PHP
Integrating Erlang with PHPIntegrating Erlang with PHP
Integrating Erlang with PHP
 
Interoperability With RabbitMq
Interoperability With RabbitMqInteroperability With RabbitMq
Interoperability With RabbitMq
 
Debugging and Profiling Symfony Apps
Debugging and Profiling Symfony AppsDebugging and Profiling Symfony Apps
Debugging and Profiling Symfony Apps
 

Kürzlich hochgeladen

Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 

Kürzlich hochgeladen (20)

201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 

Cloud Messaging With Cloud Foundry

  • 1. Cloud Messaging with Cloud Foundry Álvaro Videla - VMware © 2012 VMware, Inc. All rights reserved. Tuesday, November 13, 12
  • 2. About Me • Developer Advocate for Cloud Foundry • Blog: http://videlalvaro.github.com/ • Twitter: @old_sound 2 Tuesday, November 13, 12
  • 3. About Me • Developer Advocate for Cloud Foundry • Blog: http://videlalvaro.github.com/ • Twitter: @old_sound • I created gifsockets™ 3 Tuesday, November 13, 12
  • 4. About Me Co-authored RabbitMQ in Action http://bit.ly/rabbitmq 4 Tuesday, November 13, 12
  • 5. Classic Apps 5 Tuesday, November 13, 12
  • 6. Implement a Photo Gallery Tuesday, November 13, 12
  • 9. ‘Till new requirements arrive Tuesday, November 13, 12
  • 10. The Product Owner Tuesday, November 13, 12
  • 11. Can we also notify the user friends when she uploads a new image? Tuesday, November 13, 12
  • 12. Can we also notify the user friends when she uploads a new image? I forgot to mention we need it for tomorrow… Tuesday, November 13, 12
  • 14. The Social Media Guru Tuesday, November 13, 12
  • 15. We need to give badges to users for each picture upload Tuesday, November 13, 12
  • 16. We need to give badges to users for each picture upload and post uploads to Twitter Tuesday, November 13, 12
  • 19. Dumb! You’re delivering full size images! The bandwidth bill has tripled! Tuesday, November 13, 12
  • 20. Dumb! You’re delivering full size images! The bandwidth bill has tripled! We need this fixed for yesterday! Tuesday, November 13, 12
  • 22. The Developer in the other team Tuesday, November 13, 12
  • 23. I need to call your PHP stuff but from Python Tuesday, November 13, 12
  • 24. I need to call your PHP stuff but from Python And also Java starting next week Tuesday, November 13, 12
  • 27. I don’t want to wait till your app resizes my image! Tuesday, November 13, 12
  • 30. Let’s see the code evolution 30 Tuesday, November 13, 12
  • 31. Pseudo Code Comments %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Tuesday, November 13, 12
  • 32. Pseudo Code Function Name %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Tuesday, November 13, 12
  • 33. Pseudo Code Arguments %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Tuesday, November 13, 12
  • 34. Pseudo Code Function Body %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Tuesday, November 13, 12
  • 35. Pseudo Code Return Value %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Tuesday, November 13, 12
  • 36. First Implementation: %% image_controller handle('PUT', "/user/image", ReqData) -> image_handler:do_upload(ReqData:get_file()), ok. Tuesday, November 13, 12
  • 37. Second Implementation: %% image_controller handle('PUT', "/user/image", ReqData) -> {ok, Image} = image_handler:do_upload(ReqData:get_file()), resize_image(Image), ok. Tuesday, November 13, 12
  • 38. Third Implementation: %% 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. Tuesday, November 13, 12
  • 39. Fourth Implementation: %% 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. Tuesday, November 13, 12
  • 40. Final Implementation: %% 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. Tuesday, November 13, 12
  • 41. Can our code scale to new requirements? 41 Tuesday, November 13, 12
  • 42. What if 42 Tuesday, November 13, 12
  • 43. What if • We need to speed up image conversion 43 Tuesday, November 13, 12
  • 44. What if • We need to speed up image conversion • User notification has to be sent by email 44 Tuesday, November 13, 12
  • 45. What if • We need to speed up image conversion • User notification has to be sent by email • Stop tweeting about new images 45 Tuesday, November 13, 12
  • 46. What if • We need to speed up image conversion • User notification has to be sent by email • Stop tweeting about new images • Resize in different formats 46 Tuesday, November 13, 12
  • 47. What if • We need to speed up image conversion • User notification has to be sent by email • Stop tweeting about new images • Resize in different formats • Swap Language / Technology 47 Tuesday, November 13, 12
  • 48. What if • We need to speed up image conversion • User notification has to be sent by email • Stop tweeting about new images • Resize in different formats • Swap Language / Technology (No Down Time) 48 Tuesday, November 13, 12
  • 49. Can we do better? 49 Tuesday, November 13, 12
  • 50. Sure. Using messaging 50 Tuesday, November 13, 12
  • 51. Design Publish / Subscribe Pattern Tuesday, November 13, 12
  • 52. First Implementation: %% 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). Tuesday, November 13, 12
  • 53. First Implementation: %% 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). %% friends notifier on('new_image', Msg) -> notify_friends(Msg.user, Msg.image). Tuesday, November 13, 12
  • 54. First Implementation: %% 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). %% friends notifier on('new_image', Msg) -> notify_friends(Msg.user, Msg.image). %% points manager on('new_image', Msg) -> add_points(Msg.user, 'new_image'). Tuesday, November 13, 12
  • 55. First Implementation: %% 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). %% 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). Tuesday, November 13, 12
  • 57. Second Implementation: THIS PAGE INTENTIONALLY LEFT BLANK Tuesday, November 13, 12
  • 59. Messaging 59 Tuesday, November 13, 12
  • 60. Messaging • Share data across processes 60 Tuesday, November 13, 12
  • 61. Messaging • Share data across processes • Processes can be part of different apps 61 Tuesday, November 13, 12
  • 62. Messaging • Share data across processes • Processes can be part of different apps • Apps can live in different machines 62 Tuesday, November 13, 12
  • 63. Messaging • Share data across processes • Processes can be part of different apps • Apps can live in different machines • Communication is Asynchronous 63 Tuesday, November 13, 12
  • 64. Main Concepts 64 Tuesday, November 13, 12
  • 65. Main Concepts • Messages are sent by Producers 65 Tuesday, November 13, 12
  • 66. Main Concepts • Messages are sent by Producers • Messages are delivered to Consumers 66 Tuesday, November 13, 12
  • 67. How can we start using messaging today? 67 Tuesday, November 13, 12
  • 68. Enter 68 Tuesday, November 13, 12
  • 69. Why Cloud Foundry is Good™ for Messaging? 69 Tuesday, November 13, 12
  • 70. Key aspects of Cloud Foundry 70 Tuesday, November 13, 12
  • 71. Key aspects of Cloud Foundry • Supports many apps per account 71 Tuesday, November 13, 12
  • 72. Key aspects of Cloud Foundry • Supports many apps per account • Supports many services per account 72 Tuesday, November 13, 12
  • 73. Key aspects of Cloud Foundry • Supports many apps per account • Supports many services per account • Services can be shared across apps 73 Tuesday, November 13, 12
  • 74. Key aspects of Cloud Foundry • Supports many apps per account • Supports many services per account • Services can be shared across apps • Supports RabbitMQ by default 74 Tuesday, November 13, 12
  • 75. Intermission: What is RabbitMQ 75 Tuesday, November 13, 12
  • 76. RabbitMQ 76 Tuesday, November 13, 12
  • 77. RabbitMQ • Multi Protocol Messaging Server 77 Tuesday, November 13, 12
  • 78. RabbitMQ • Multi Protocol Messaging Server • Open Source (MPL) 78 Tuesday, November 13, 12
  • 79. RabbitMQ • Multi Protocol Messaging Server • Open Source (MPL) • Part of Spring Source 79 Tuesday, November 13, 12
  • 80. RabbitMQ • Multi Protocol Messaging Server • Open Source (MPL) • Part of Spring Source • Supports AMQP, STOMP, MQTT 80 Tuesday, November 13, 12
  • 81. RabbitMQ • Multi Protocol Messaging Server • Open Source (MPL) • Part of Spring Source • Supports AMQP, STOMP, MQTT • Has Clients for Many Platforms: Java, Ruby, node.js, PHP, Erlang, .Net., more 81 Tuesday, November 13, 12
  • 82. TELL ME MORE 82 Tuesday, November 13, 12
  • 83. TELL ME MORE RabbitMQ Simulator Demo 83 Tuesday, November 13, 12
  • 84. Sample App: CloudStagram 84 Tuesday, November 13, 12
  • 85. Sample App: CloudStagram 85 Tuesday, November 13, 12
  • 86. Sample App: CloudStagram 86 Tuesday, November 13, 12
  • 87. Sample App: CloudStagram 87 Tuesday, November 13, 12
  • 88. Sample App: CloudStagram 88 Tuesday, November 13, 12
  • 89. Sample App: CloudStagram 89 Tuesday, November 13, 12
  • 90. Sample App: CloudStagram 90 Tuesday, November 13, 12
  • 91. Sample App: CloudStagram Frontend App node.js 91 Tuesday, November 13, 12
  • 92. Sample App: CloudStagram Frontend App node.js Image Resizers node.js 92 Tuesday, November 13, 12
  • 93. Sample App: CloudStagram Frontend App node.js Image Resizers Clojure 93 Tuesday, November 13, 12
  • 94. CODE OR IT DIDN’T HAPPEN 94 Tuesday, November 13, 12
  • 95. CODA 95 Tuesday, November 13, 12
  • 96. Messaging 96 Tuesday, November 13, 12
  • 97. Scale Messaging 97 Tuesday, November 13, 12
  • 98. Scale Decoupling Messaging 98 Tuesday, November 13, 12
  • 99. Scale Decoupling Messaging Polyglot 99 Tuesday, November 13, 12
  • 101. Heavy Lifting 101 Tuesday, November 13, 12
  • 102. Heavy Multi Lifting Apps 102 Tuesday, November 13, 12
  • 103. Heavy Multi Lifting Apps Multi Services 103 Tuesday, November 13, 12
  • 104. Heavy Multi Lifting Apps Multi Cloud Services Messaging 104 Tuesday, November 13, 12
  • 105. Sign Up Today https://my.cloudfoundry.com/signup 105 Tuesday, November 13, 12
  • 106. Questions? 106 Tuesday, November 13, 12
  • 107. Thanks! Álvaro Videla http://twitter.com/old_sound http://github.com/videlalvaro http://www.slideshare.net/old_sound 107 Tuesday, November 13, 12