0
Vert.x 2
Taking polyglot application
development to the next level

Tim Fox
Vert.x Project Lead
Red Hat
twitter:@timfox
Bio
■ Employed By Red Hat to lead the Vert.x project
■ Some projects I've been involved with: Vert.x (creator), RabbitMQ,
...
Project Info
■ Independent Community Project
■ The main project is an Eclipse Foundation project
■ All code is on GitHub
■...
Vert.x Overview
■ Lightweight reactive application platform
■ Polyglot
■ High performance
■ Superficially similar to Node....
Polyglot
Fully supported:

Beta level support:
Core Asychronous APIs
■ TCP/SSL clients and servers
■ HTTP/HTTPS clients and servers
■ Websockets
■ SockJS
■ File system
■...
Why Asynchronous?
■ Modern servers need to handle many connections – web servers,
websockets, IoT
■ OS threads are still a...
Verticle
■ Execution unit of Vert.x
■ Single threaded – less scope for race conditions
■ Verticles communicate by message ...
Simple web server demo
■ Vertx run webserver.js
■ Show code in gedit
■ Explain about raw verticles
■ Also show WebServer.j...
Performance demo
■ Run the perf server and client demo
■
Event Bus
■ The nervous system of Vert.x
■ Verticles send messages over the event bus
■ Point to point. Publish/Subscribe....
Clustered Event Bus
■ Lightweight peer-to-peer messaging system
■ Connects multiple Vert.x JVM instances
■ Applications ar...
Event bus in the Browser
■ Event bus extends to client side JavaScript too
■ Uses the same API on the client
■ Powerful di...
Clustered event bus demo
■ receiver.js and Sender.java
■ Show code
■ Show messages being received
■ Start bridge (need 3rd...
Modules
■ Modules encapsulate code and resources
■ One or more modules per application
■ Must include a mod.json descripto...
Explore module demo
■ Look at a simple runnable module on disk
■ Show the mod.json
■ It's a simple TCP echo server
■ Run i...
An ecosystem of modules
■ Sharing modules encourages reuse
■ Modules can be pushed to any Maven or Bintray repository
■ Ve...
Module resolve demo
■ Delete the module that we explored in the last example
■ Do a vertx runmod on it again
■ Explore the...
It's all about the modules
■ MongoDB
■ Redis

■ Facebook
■ Yoke

■ MySQL/PostgreSQL
■ SMTP

■ Stomp
■ BSON

■ JDBC
■ Jerse...
Fat jars
■ Build module into self contained "fat" executable jar
■ Convenient for devops
■ Fairly small overhead
Fat jar demo
■ Do vertx fatjar of the module from before
■ Take a look at the jar, look at its size
■ Execute it
■ Maybe u...
High Availability
■ Automatic failover of deployed modules
■ Nodes can be grouped
■ Network partition detection with quora
HA demo
■ Keep bridge running from before
■ Use one Scala sender.scala module and one Groovy
sender module
■ Start them bo...
Developing with Vert.x
■ Vert.x is IDE and build system agnostic
■ Can just a text editor if you like
■ Maven archetype
■ ...
Auto-redeploy demo
■ Show Maven project in eclipse
■ Project is module with sender.rb in it
■ mvn vertx:runModEclipse
■ Lo...
Summary
■ Write apps as set of loosely coupled components that live anywhere
where you want
■ Polyglot – use the language(...
Get involved!
■ Loads more to do
■ Active and growing community
■ Github: https://github.com/vert-x/vert.x
■ Google group:...
Q&A
http://vertx.io/
Upcoming SlideShare
Loading in...5
×

Introducing Vert.x 2.0 - Taking polyglot application development to the next level - Tim Fox (Red Hat)

1,638

Published on

Presented at JAX London 2013

Vert.x is a lightweight, high performance, application platform for the JVM that's designed for modern mobile, web, and enterprise applications. The recent Vert.x 2.0 release marks a coming of age for Vert.x, as it progresses to a fully independent project. We'll dive into the Vert.x 2.0 release and show how the powerful new module system enables a Vert.x ecosystem by allowing modules to be re-used via Maven and Bintray repositories. You'll also learn about how better build tool and IDE integration makes developing applications with Vert.x a breeze.

Published in: Technology
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,638
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
33
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Transcript of "Introducing Vert.x 2.0 - Taking polyglot application development to the next level - Tim Fox (Red Hat)"

  1. 1. Vert.x 2 Taking polyglot application development to the next level Tim Fox Vert.x Project Lead Red Hat twitter:@timfox
  2. 2. Bio ■ Employed By Red Hat to lead the Vert.x project ■ Some projects I've been involved with: Vert.x (creator), RabbitMQ, HornetQ (creator), JBoss AS, Mobicents...
  3. 3. Project Info ■ Independent Community Project ■ The main project is an Eclipse Foundation project ■ All code is on GitHub ■ 100% open source (ASL 2.0 + Creative Commons) ■ One of the most popular Java projects on GitHub
  4. 4. Vert.x Overview ■ Lightweight reactive application platform ■ Polyglot ■ High performance ■ Superficially similar to Node.js – but not a clone! ■ Asynchronous APIs ■ Simple but not simplistic ■ Embeddable
  5. 5. Polyglot Fully supported: Beta level support:
  6. 6. Core Asychronous APIs ■ TCP/SSL clients and servers ■ HTTP/HTTPS clients and servers ■ Websockets ■ SockJS ■ File system ■ Event bus ■ DNS (new) ■ UDP (new) ■ Core is small and static – most new functionality in modules ■ Don't call us, we'll call you!
  7. 7. Why Asynchronous? ■ Modern servers need to handle many connections – web servers, websockets, IoT ■ OS threads are still a precious resource ■ Need to service many connections with small number of threads ■ Blocked OS threads means they can't do other work
  8. 8. Verticle ■ Execution unit of Vert.x ■ Single threaded – less scope for race conditions ■ Verticles communicate by message passing ■ Sounds like the Actor Model?
  9. 9. Simple web server demo ■ Vertx run webserver.js ■ Show code in gedit ■ Explain about raw verticles ■ Also show WebServer.java ■ Run it too ■ Talk about Java source verticles
  10. 10. Performance demo ■ Run the perf server and client demo ■
  11. 11. Event Bus ■ The nervous system of Vert.x ■ Verticles send messages over the event bus ■ Point to point. Publish/Subscribe. Request/Response ■ Pass strings, buffers, primitive types or JSON ■ JSON messages are preferred for structured data
  12. 12. Clustered Event Bus ■ Lightweight peer-to-peer messaging system ■ Connects multiple Vert.x JVM instances ■ Applications are loosely coupled components distributed across your network ■ No monolithic “application server” ■ Cluster manager is pluggable, default is Hazelcast ■ Cluster manager used for group management, not transport
  13. 13. Event bus in the Browser ■ Event bus extends to client side JavaScript too ■ Uses the same API on the client ■ Powerful distributed event space spanning both client and server nodes ■ Ideal for modern “real-time” web applications
  14. 14. Clustered event bus demo ■ receiver.js and Sender.java ■ Show code ■ Show messages being received ■ Start bridge (need 3rd console for this) ■ Show browser receiving messages too
  15. 15. Modules ■ Modules encapsulate code and resources ■ One or more modules per application ■ Must include a mod.json descriptor file ■ Can be runnable or non runnable ■ Module class-loaders provide isolation
  16. 16. Explore module demo ■ Look at a simple runnable module on disk ■ Show the mod.json ■ It's a simple TCP echo server ■ Run it with vertx runmod
  17. 17. An ecosystem of modules ■ Sharing modules encourages reuse ■ Modules can be pushed to any Maven or Bintray repository ■ Vert.x can resolve modules at build time or run time ■ Want to encourage an ecosystem of modules ■ Register your modules in the registry
  18. 18. Module resolve demo ■ Delete the module that we explored in the last example ■ Do a vertx runmod on it again ■ Explore the mods directory again
  19. 19. It's all about the modules ■ MongoDB ■ Redis ■ Facebook ■ Yoke ■ MySQL/PostgreSQL ■ SMTP ■ Stomp ■ BSON ■ JDBC ■ Jersey ■ work-queue ■ NoDyn ■ Promises ■ Guice ■ GCM ■ SocketIO ■ Spring ■ Vertigo ■ Sessions ■ Via ■ Metrics ■ RxJava
  20. 20. Fat jars ■ Build module into self contained "fat" executable jar ■ Convenient for devops ■ Fairly small overhead
  21. 21. Fat jar demo ■ Do vertx fatjar of the module from before ■ Take a look at the jar, look at its size ■ Execute it ■ Maybe unzip it and look inside
  22. 22. High Availability ■ Automatic failover of deployed modules ■ Nodes can be grouped ■ Network partition detection with quora
  23. 23. HA demo ■ Keep bridge running from before ■ Use one Scala sender.scala module and one Groovy sender module ■ Start them both with -ha flag ■ Look at browser ■ Kill one ps aux | grep Sender.java ■ Look at browser again ■ Start an empty vertx ■ Fail it back
  24. 24. Developing with Vert.x ■ Vert.x is IDE and build system agnostic ■ Can just a text editor if you like ■ Maven archetype ■ Gradle template ■ Debug and test in IDE ■ Module auto-redeploy during development
  25. 25. Auto-redeploy demo ■ Show Maven project in eclipse ■ Project is module with sender.rb in it ■ mvn vertx:runModEclipse ■ Look at browser ■ Make change ■ Look at browser again
  26. 26. Summary ■ Write apps as set of loosely coupled components that live anywhere where you want ■ Polyglot – use the language(s) you want ■ Simple concurrency – wave goodbye to most race conditions ■ Module system – empower the community ■ High availability ■ Ease of development We believe Vert.x is the platform for the new generation of reactive polyglot web and enterprise applications
  27. 27. Get involved! ■ Loads more to do ■ Active and growing community ■ Github: https://github.com/vert-x/vert.x ■ Google group: vertx ■ IRC channel: #vertx on freenode.net
  28. 28. Q&A http://vertx.io/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×