SlideShare une entreprise Scribd logo
1  sur  60
Télécharger pour lire hors ligne
vert.x
                         Polyglot and Scalable Apps on the JVM


                              Álvaro Videla | VMware

Tuesday, October 9, 12
About Me
                     •   Developer Advocate for Cloud Foundry

                     •   Blog: http://videlalvaro.github.com/

                     •   Twitter: @old_sound




Tuesday, October 9, 12
About Me
                     •   Developer Advocate for Cloud Foundry

                     •   Blog: http://videlalvaro.github.com/

                     •   Twitter: @old_sound

                     •   I created gifsockets™




Tuesday, October 9, 12
About Me
                         Co-authored

                RabbitMQ in Action
               http://bit.ly/rabbitmq




Tuesday, October 9, 12
vert.x
Tuesday, October 9, 12
vert.x

                     • VMware sponsored OS project




Tuesday, October 9, 12
vert.x

                     • VMware sponsored OS project
                     • JVM Based




Tuesday, October 9, 12
vert.x

                     • VMware sponsored OS project
                     • JVM Based
                     • 1+ year



Tuesday, October 9, 12
vert.x

                     • VMware sponsored OS project
                     • JVM Based
                     • 1+ year
                     • By @timfox from HornetMQ fame


Tuesday, October 9, 12
vert.x

                          Framework to write
                                 polyglot,
                         highly concurrent apps.



Tuesday, October 9, 12
vert.x

                          Framework to write
                                polyglot,
                         highly concurrent apps.



Tuesday, October 9, 12
Javascript
             load('vertx.js')

             vertx.createHttpServer().requestHandler(function(req) {
                 var file = req.path === '/' ? 'index.html' : req.path;
                 req.response.sendFile('webroot/' + file);
             }).listen(8080)




Tuesday, October 9, 12
Javascript
             load('vertx.js')

             vertx.createHttpServer().requestHandler(function(req) {
                 var file = req.path === '/' ? 'index.html' : req.path;
                 req.response.sendFile('webroot/' + file);
             }).listen(8080)


                 $ vertx run server.js




Tuesday, October 9, 12
Javascript
             load('vertx.js')

             vertx.createHttpServer().requestHandler(function(req) {
                 var file = req.path === '/' ? 'index.html' : req.path;
                 req.response.sendFile('webroot/' + file);
             }).listen(8080)


                 $ vertx run server.js -instances 32




Tuesday, October 9, 12
Ruby
             require "vertx"

             Vertx::HttpServer.new.request_handler do |req|
                 file = req.uri == "/" ? "index.html" : req.uri
                 req.response.send_file "webroot/#{file}"
             end.listen(8080)



                 $ vertx run server.rb -instances 32




Tuesday, October 9, 12
Python
             import vertx

             server = vertx.create_http_server()

             @server.request_handler
             def request_handler(req):
                 file = "index.html" if req.uri == "/" else req.uri
                 req.response.send_file("webroot/%s"%file)
             server.listen(8080)


                $ vertx run server.py -instances 32




Tuesday, October 9, 12
Groovy

             vertx.createHttpServer().requestHandler { req ->
                 def file = req.uri == "/" ? "index.html" : req.uri
                 req.response.sendFile "webroot/$file"
             }.listen(8080)




                $ vertx run Server.groovy -instances 32




Tuesday, October 9, 12
Java
                import org.vertx.java.core.Handler;
                import org.vertx.java.core.http.HttpServerRequest;
                import org.vertx.java.deploy.Verticle;

                public class Server extends Verticle {
                    public void start() {
                        vertx.createHttpServer().requestHandler(new
                Handler<HttpServerRequest>() {
                            public void handle(HttpServerRequest req) {
                                String file = req.path.equals("/") ? "index.html" :
                req.path;
                                req.response.sendFile("webroot/" + file);
                            }
                        }).listen(8080);
                    }
                }


                 $ vertx run Server.java -instances 32



Tuesday, October 9, 12
vert.x
                          Framework to write
                               polyglot,
                         highly concurrent
                                apps.



Tuesday, October 9, 12
Core Concepts



Tuesday, October 9, 12
Core Concepts

                     • Verticle




Tuesday, October 9, 12
Core Concepts

                     • Verticle
                     • vert.x instances




Tuesday, October 9, 12
Core Concepts

                     • Verticle
                     • vert.x instances
                     • Event Bus



Tuesday, October 9, 12
Verticles run inside a
                             vert.x instance.
                         A single vert.x instance
                            runs inside its own
                              JVM instance.


Tuesday, October 9, 12
Tuesday, October 9, 12
vertx run server.js -instances 32




Tuesday, October 9, 12
Programming Model
                     • Event Based (similar to node.js)
                     • Event Handlers
                     • Small set of threads per vert.x instance
                     • Verticles are executed using the same
                         thread.
                     • Message Passing Communication

Tuesday, October 9, 12
vert.x core



Tuesday, October 9, 12
vert.x core
                     •   TCP/SSL Servers




Tuesday, October 9, 12
vert.x core
                     •   TCP/SSL Servers

                     •   HTTP/HTTPS Servers




Tuesday, October 9, 12
vert.x core
                     •   TCP/SSL Servers

                     •   HTTP/HTTPS Servers

                     •   Websockets and Sock.js




Tuesday, October 9, 12
vert.x core
                     •   TCP/SSL Servers

                     •   HTTP/HTTPS Servers

                     •   Websockets and Sock.js

                     •   Distributed Event Bus Access




Tuesday, October 9, 12
vert.x core
                     •   TCP/SSL Servers

                     •   HTTP/HTTPS Servers

                     •   Websockets and Sock.js

                     •   Distributed Event Bus Access

                     •   Shared Maps and Sets




Tuesday, October 9, 12
vert.x core
                     •   TCP/SSL Servers

                     •   HTTP/HTTPS Servers

                     •   Websockets and Sock.js

                     •   Distributed Event Bus Access

                     •   Shared Maps and Sets

                     •   Logging



Tuesday, October 9, 12
Event Bus



Tuesday, October 9, 12
Event Bus
                     •   Allows Verticles to talk to each other




Tuesday, October 9, 12
Event Bus
                     •   Allows Verticles to talk to each other

                     •   Works cross language




Tuesday, October 9, 12
Event Bus
                     •   Allows Verticles to talk to each other

                     •   Works cross language

                     •   Works across the cluster




Tuesday, October 9, 12
Event Bus
                     •   Allows Verticles to talk to each other

                     •   Works cross language

                     •   Works across the cluster

                     •   Spans from server to client side




Tuesday, October 9, 12
Event Bus - How
                     •   Register Handlers




Tuesday, October 9, 12
Event Bus - How
                     •   Register Handlers

                     •   Unregister Handlers




Tuesday, October 9, 12
Event Bus - How
                     •   Register Handlers

                     •   Unregister Handlers

                     •   Addresses




Tuesday, October 9, 12
Event Bus - How
                     •   Register Handlers

                     •   Unregister Handlers

                     •   Addresses

                     •   Messages (Transient)




Tuesday, October 9, 12
Register Handler

                         var eb = vertx.eventBus;

                         var myHandler = function(message)) {
                           log.info('I received a message ' + message);
                         }

                         eb.registerHandler('test.address', myHandler);




Tuesday, October 9, 12
Register Handler

                         var eb = vertx.eventBus;

                         var myHandler = function(message)) {
                           log.info('I received a message ' + message);
                         }

                         eb.registerHandler('test.address', myHandler);

                         eb.unregisterHandler('test.address', myHandler);




Tuesday, October 9, 12
Publish Subscribe

       eb.publish('test.address', 'hello world');




Tuesday, October 9, 12
Point to Point

       eb.send('test.address', 'hello world');




Tuesday, October 9, 12
RPC Server
                         var myHandler = function(message, replier) {
                           log.info('I received a message ' + message);

                             // Do some stuff

                             // Now reply to it

                             replier('This is a reply');
                         }

                         eb.registerHandler('test.address', myHandler);




Tuesday, October 9, 12
RPC Client

         eb.send('test.address', 'This is a message', function(reply) {
             log.info('I received a reply ' + reply);
         });




Tuesday, October 9, 12
Shared Data

                     •   Shared Maps




Tuesday, October 9, 12
Shared Data

                     •   Shared Maps

                     •   Shared Sets




Tuesday, October 9, 12
Shared Set Example
    load('vertx.js')

    var	
  conns	
  =	
  vertx.getSet('conns')

    var	
  server	
  =	
  vertx.createNetServer().connectHandler(function(socket)	
  {
    	
  	
  conns.add(socket.writeHandlerID)
    	
  	
  socket.dataHandler(function(data)	
  {
    	
  	
  	
  	
  var	
  aconns	
  =	
  conns.toArray();
    	
  	
  	
  	
  for	
  (var	
  i	
  =	
  0;	
  i	
  <	
  aconns.length;	
  i++)	
  {
    	
  	
  	
  	
  	
  	
  vertx.eventBus.send(aconns[i],	
  data)
    	
  	
  	
  	
  }
    	
  	
  });
    	
  	
  socket.closedHandler(function()	
  {	
  conns.remove(	
  socket.writeHandlerID)	
  });
    }).listen(1234)




Tuesday, October 9, 12
Benchmarks



Tuesday, October 9, 12
Benchmarks I




           http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/


Tuesday, October 9, 12
Benchmarks II




           http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/


Tuesday, October 9, 12
Internals



Tuesday, October 9, 12
Internals
                     • Netty for network IO
                     • JRuby for the Ruby Engine
                     • Groovy
                     • Mozilla Rhino for JS
                     • Jython for Python support
                     • Hazelcast for clustering
Tuesday, October 9, 12
http://vertx.io/

Tuesday, October 9, 12
Questions?



Tuesday, October 9, 12
Thanks!
                             http://twitter.com/old_sound
                            https://github.com/videlalvaro/
                         http://www.slideshare.net/old_sound



Tuesday, October 9, 12

Contenu connexe

Tendances

Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in DockerDocker, Inc.
 
How we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on KubernetesHow we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on KubernetesOpsta
 
Understanding Kubernetes
Understanding KubernetesUnderstanding Kubernetes
Understanding KubernetesTu Pham
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
 
Principles of microservices XP Days Ukraine
Principles of microservices   XP Days UkrainePrinciples of microservices   XP Days Ukraine
Principles of microservices XP Days UkraineSam Newman
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerLuong Vo
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersYajushi Srivastava
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux KernelDocker, Inc.
 
eBPF - Observability In Deep
eBPF - Observability In DeepeBPF - Observability In Deep
eBPF - Observability In DeepMydbops
 
Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introductionRasheed Waraich
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 

Tendances (20)

Intro to React
Intro to ReactIntro to React
Intro to React
 
Vert.x
Vert.xVert.x
Vert.x
 
ELK Stack
ELK StackELK Stack
ELK Stack
 
Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Docker
 
How we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on KubernetesHow we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on Kubernetes
 
OpenShift Enterprise
OpenShift EnterpriseOpenShift Enterprise
OpenShift Enterprise
 
Understanding Kubernetes
Understanding KubernetesUnderstanding Kubernetes
Understanding Kubernetes
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 
Principles of microservices XP Days Ukraine
Principles of microservices   XP Days UkrainePrinciples of microservices   XP Days Ukraine
Principles of microservices XP Days Ukraine
 
Helm.pptx
Helm.pptxHelm.pptx
Helm.pptx
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Microservices
Microservices Microservices
Microservices
 
Intro to docker
Intro to dockerIntro to docker
Intro to docker
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
 
Tomcat server
 Tomcat server Tomcat server
Tomcat server
 
eBPF - Observability In Deep
eBPF - Observability In DeepeBPF - Observability In Deep
eBPF - Observability In Deep
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 

Similaire à Vertx

Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?glynnormington
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevFelix Geisendörfer
 
Building A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionBuilding A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionPhil Cryer
 
How we scale DroneCi on demand
How we scale DroneCi on demandHow we scale DroneCi on demand
How we scale DroneCi on demandPatrick Jahns
 
Realtime Streaming using Autobahn Websockets
Realtime Streaming using Autobahn WebsocketsRealtime Streaming using Autobahn Websockets
Realtime Streaming using Autobahn WebsocketsTom Sheffler
 
Vert.x based microservices with vxms
Vert.x based microservices with vxmsVert.x based microservices with vxms
Vert.x based microservices with vxmsAndy Moncsek
 
Chris Ward - Understanding databases for distributed docker applications - No...
Chris Ward - Understanding databases for distributed docker applications - No...Chris Ward - Understanding databases for distributed docker applications - No...
Chris Ward - Understanding databases for distributed docker applications - No...NoSQLmatters
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?Ovidiu Dimulescu
 
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform  - Plain Concepts DevOps dayAprovisionamiento multi-proveedor con Terraform  - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps dayPlain Concepts
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)Felix Geisendörfer
 
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016Zabbix
 
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...NETWAYS
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
Hammock, a Good Place to Rest
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to RestStratoscale
 
Declarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with TerraformDeclarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with TerraformRadek Simko
 
Docker 1.9 Feature Overview
Docker 1.9 Feature OverviewDocker 1.9 Feature Overview
Docker 1.9 Feature OverviewSreenivas Makam
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemVan Phuc
 
Taking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetTaking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetPuppet
 

Similaire à Vertx (20)

Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
 
Building A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionBuilding A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage Solution
 
How we scale DroneCi on demand
How we scale DroneCi on demandHow we scale DroneCi on demand
How we scale DroneCi on demand
 
Realtime Streaming using Autobahn Websockets
Realtime Streaming using Autobahn WebsocketsRealtime Streaming using Autobahn Websockets
Realtime Streaming using Autobahn Websockets
 
Vert.x based microservices with vxms
Vert.x based microservices with vxmsVert.x based microservices with vxms
Vert.x based microservices with vxms
 
Chris Ward - Understanding databases for distributed docker applications - No...
Chris Ward - Understanding databases for distributed docker applications - No...Chris Ward - Understanding databases for distributed docker applications - No...
Chris Ward - Understanding databases for distributed docker applications - No...
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?
 
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform  - Plain Concepts DevOps dayAprovisionamiento multi-proveedor con Terraform  - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)
 
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
 
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development...
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Hammock, a Good Place to Rest
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to Rest
 
TIAD : Automating the modern datacenter
TIAD : Automating the modern datacenterTIAD : Automating the modern datacenter
TIAD : Automating the modern datacenter
 
XQuery Design Patterns
XQuery Design PatternsXQuery Design Patterns
XQuery Design Patterns
 
Declarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with TerraformDeclarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with Terraform
 
Docker 1.9 Feature Overview
Docker 1.9 Feature OverviewDocker 1.9 Feature Overview
Docker 1.9 Feature Overview
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
 
Taking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetTaking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and Puppet
 

Plus de 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
 
Cloud Messaging With Cloud Foundry
Cloud Messaging With Cloud FoundryCloud Messaging With Cloud Foundry
Cloud Messaging With Cloud FoundryAlvaro 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
 
Desacoplando aplicaciones
Desacoplando aplicacionesDesacoplando aplicaciones
Desacoplando aplicacionesAlvaro 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 php withrabbitmq_zendcon
Integrating php withrabbitmq_zendconIntegrating php withrabbitmq_zendcon
Integrating php withrabbitmq_zendconAlvaro Videla
 

Plus de 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 Hands On
RabbitMQ Hands OnRabbitMQ Hands On
RabbitMQ Hands On
 
Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot System
 
Cloud Foundry Bootcamp
Cloud Foundry BootcampCloud Foundry Bootcamp
Cloud Foundry Bootcamp
 
Cloud Messaging With Cloud Foundry
Cloud Messaging With Cloud FoundryCloud Messaging With Cloud Foundry
Cloud Messaging With Cloud Foundry
 
Taming the rabbit
Taming the rabbitTaming the rabbit
Taming the rabbit
 
Código Fácil De Testear
Código Fácil De TestearCódigo Fácil De Testear
Código Fácil De Testear
 
Desacoplando aplicaciones
Desacoplando aplicacionesDesacoplando aplicaciones
Desacoplando aplicaciones
 
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 php withrabbitmq_zendcon
Integrating php withrabbitmq_zendconIntegrating php withrabbitmq_zendcon
Integrating php withrabbitmq_zendcon
 

Dernier

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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.pdfsudhanshuwaghmare1
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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 Processorsdebabhi2
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Dernier (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Vertx

  • 1. vert.x Polyglot and Scalable Apps on the JVM Álvaro Videla | VMware Tuesday, October 9, 12
  • 2. About Me • Developer Advocate for Cloud Foundry • Blog: http://videlalvaro.github.com/ • Twitter: @old_sound Tuesday, October 9, 12
  • 3. About Me • Developer Advocate for Cloud Foundry • Blog: http://videlalvaro.github.com/ • Twitter: @old_sound • I created gifsockets™ Tuesday, October 9, 12
  • 4. About Me Co-authored RabbitMQ in Action http://bit.ly/rabbitmq Tuesday, October 9, 12
  • 6. vert.x • VMware sponsored OS project Tuesday, October 9, 12
  • 7. vert.x • VMware sponsored OS project • JVM Based Tuesday, October 9, 12
  • 8. vert.x • VMware sponsored OS project • JVM Based • 1+ year Tuesday, October 9, 12
  • 9. vert.x • VMware sponsored OS project • JVM Based • 1+ year • By @timfox from HornetMQ fame Tuesday, October 9, 12
  • 10. vert.x Framework to write polyglot, highly concurrent apps. Tuesday, October 9, 12
  • 11. vert.x Framework to write polyglot, highly concurrent apps. Tuesday, October 9, 12
  • 12. Javascript load('vertx.js') vertx.createHttpServer().requestHandler(function(req) { var file = req.path === '/' ? 'index.html' : req.path; req.response.sendFile('webroot/' + file); }).listen(8080) Tuesday, October 9, 12
  • 13. Javascript load('vertx.js') vertx.createHttpServer().requestHandler(function(req) { var file = req.path === '/' ? 'index.html' : req.path; req.response.sendFile('webroot/' + file); }).listen(8080) $ vertx run server.js Tuesday, October 9, 12
  • 14. Javascript load('vertx.js') vertx.createHttpServer().requestHandler(function(req) { var file = req.path === '/' ? 'index.html' : req.path; req.response.sendFile('webroot/' + file); }).listen(8080) $ vertx run server.js -instances 32 Tuesday, October 9, 12
  • 15. Ruby require "vertx" Vertx::HttpServer.new.request_handler do |req| file = req.uri == "/" ? "index.html" : req.uri req.response.send_file "webroot/#{file}" end.listen(8080) $ vertx run server.rb -instances 32 Tuesday, October 9, 12
  • 16. Python import vertx server = vertx.create_http_server() @server.request_handler def request_handler(req): file = "index.html" if req.uri == "/" else req.uri req.response.send_file("webroot/%s"%file) server.listen(8080) $ vertx run server.py -instances 32 Tuesday, October 9, 12
  • 17. Groovy vertx.createHttpServer().requestHandler { req -> def file = req.uri == "/" ? "index.html" : req.uri req.response.sendFile "webroot/$file" }.listen(8080) $ vertx run Server.groovy -instances 32 Tuesday, October 9, 12
  • 18. Java import org.vertx.java.core.Handler; import org.vertx.java.core.http.HttpServerRequest; import org.vertx.java.deploy.Verticle; public class Server extends Verticle { public void start() { vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() { public void handle(HttpServerRequest req) { String file = req.path.equals("/") ? "index.html" : req.path; req.response.sendFile("webroot/" + file); } }).listen(8080); } } $ vertx run Server.java -instances 32 Tuesday, October 9, 12
  • 19. vert.x Framework to write polyglot, highly concurrent apps. Tuesday, October 9, 12
  • 21. Core Concepts • Verticle Tuesday, October 9, 12
  • 22. Core Concepts • Verticle • vert.x instances Tuesday, October 9, 12
  • 23. Core Concepts • Verticle • vert.x instances • Event Bus Tuesday, October 9, 12
  • 24. Verticles run inside a vert.x instance. A single vert.x instance runs inside its own JVM instance. Tuesday, October 9, 12
  • 26. vertx run server.js -instances 32 Tuesday, October 9, 12
  • 27. Programming Model • Event Based (similar to node.js) • Event Handlers • Small set of threads per vert.x instance • Verticles are executed using the same thread. • Message Passing Communication Tuesday, October 9, 12
  • 29. vert.x core • TCP/SSL Servers Tuesday, October 9, 12
  • 30. vert.x core • TCP/SSL Servers • HTTP/HTTPS Servers Tuesday, October 9, 12
  • 31. vert.x core • TCP/SSL Servers • HTTP/HTTPS Servers • Websockets and Sock.js Tuesday, October 9, 12
  • 32. vert.x core • TCP/SSL Servers • HTTP/HTTPS Servers • Websockets and Sock.js • Distributed Event Bus Access Tuesday, October 9, 12
  • 33. vert.x core • TCP/SSL Servers • HTTP/HTTPS Servers • Websockets and Sock.js • Distributed Event Bus Access • Shared Maps and Sets Tuesday, October 9, 12
  • 34. vert.x core • TCP/SSL Servers • HTTP/HTTPS Servers • Websockets and Sock.js • Distributed Event Bus Access • Shared Maps and Sets • Logging Tuesday, October 9, 12
  • 36. Event Bus • Allows Verticles to talk to each other Tuesday, October 9, 12
  • 37. Event Bus • Allows Verticles to talk to each other • Works cross language Tuesday, October 9, 12
  • 38. Event Bus • Allows Verticles to talk to each other • Works cross language • Works across the cluster Tuesday, October 9, 12
  • 39. Event Bus • Allows Verticles to talk to each other • Works cross language • Works across the cluster • Spans from server to client side Tuesday, October 9, 12
  • 40. Event Bus - How • Register Handlers Tuesday, October 9, 12
  • 41. Event Bus - How • Register Handlers • Unregister Handlers Tuesday, October 9, 12
  • 42. Event Bus - How • Register Handlers • Unregister Handlers • Addresses Tuesday, October 9, 12
  • 43. Event Bus - How • Register Handlers • Unregister Handlers • Addresses • Messages (Transient) Tuesday, October 9, 12
  • 44. Register Handler var eb = vertx.eventBus; var myHandler = function(message)) { log.info('I received a message ' + message); } eb.registerHandler('test.address', myHandler); Tuesday, October 9, 12
  • 45. Register Handler var eb = vertx.eventBus; var myHandler = function(message)) { log.info('I received a message ' + message); } eb.registerHandler('test.address', myHandler); eb.unregisterHandler('test.address', myHandler); Tuesday, October 9, 12
  • 46. Publish Subscribe eb.publish('test.address', 'hello world'); Tuesday, October 9, 12
  • 47. Point to Point eb.send('test.address', 'hello world'); Tuesday, October 9, 12
  • 48. RPC Server var myHandler = function(message, replier) { log.info('I received a message ' + message); // Do some stuff // Now reply to it replier('This is a reply'); } eb.registerHandler('test.address', myHandler); Tuesday, October 9, 12
  • 49. RPC Client eb.send('test.address', 'This is a message', function(reply) { log.info('I received a reply ' + reply); }); Tuesday, October 9, 12
  • 50. Shared Data • Shared Maps Tuesday, October 9, 12
  • 51. Shared Data • Shared Maps • Shared Sets Tuesday, October 9, 12
  • 52. Shared Set Example load('vertx.js') var  conns  =  vertx.getSet('conns') var  server  =  vertx.createNetServer().connectHandler(function(socket)  {    conns.add(socket.writeHandlerID)    socket.dataHandler(function(data)  {        var  aconns  =  conns.toArray();        for  (var  i  =  0;  i  <  aconns.length;  i++)  {            vertx.eventBus.send(aconns[i],  data)        }    });    socket.closedHandler(function()  {  conns.remove(  socket.writeHandlerID)  }); }).listen(1234) Tuesday, October 9, 12
  • 54. Benchmarks I http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ Tuesday, October 9, 12
  • 55. Benchmarks II http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ Tuesday, October 9, 12
  • 57. Internals • Netty for network IO • JRuby for the Ruby Engine • Groovy • Mozilla Rhino for JS • Jython for Python support • Hazelcast for clustering Tuesday, October 9, 12
  • 60. Thanks! http://twitter.com/old_sound https://github.com/videlalvaro/ http://www.slideshare.net/old_sound Tuesday, October 9, 12