Date post: | 10-May-2015 |
Category: |
Technology |
Upload: | zznate |
View: | 1,491 times |
Download: | 4 times |
OSCONAn Introduction to the
Vert.x framework
Wednesday, July 24, 13
Hi Folks! I’m Nate @zznate http://github.com/zznate
Wednesday, July 24, 13
So what is Vert.x?
Wednesday, July 24, 13
“...lightweight high-performance application platform for the JVM...”
Wednesday, July 24, 13
“...for the JVM”
Wednesday, July 24, 13
The JVM- mature concurrency model- very stable- heterogeneous
Wednesday, July 24, 13
But most importantly...Polyglot support!
Wednesday, July 24, 13
You can do a lot in 40 minutes...
Wednesday, July 24, 13
http://vertx.io(scroll down)
To follow along, see: https://github.com/vert-x/vertx-examples
Wednesday, July 24, 13
“Web apps”
Wednesday, July 24, 13
Wednesday, July 24, 13
Wednesday, July 24, 13
http://web.tradekorea.com/upload_file/prod/emp/200806/main/result_2008_5_5_9_46_15_0_1.jpghttp://www.tradekorea.com/product-detail/P00016493/Used__Engine_Engines_auto_cars_spare_parts_car_part_motor_junkyard_korea_junkyards_Aircompressor_.html
Wednesday, July 24, 13
http://cache.boston.com/universal/site_graphics/blogs/bigpicture/shuttle_09_01/sts125_2.jpghttp://www.boston.com/bigpicture/2008/09/preparing_to_rescue_hubble.html
Wednesday, July 24, 13
"We need to make configuration as easy as possible so expensive tools are not needed."
Wednesday, July 24, 13
Said no enterpirse software company ever.
Wednesday, July 24, 13
JDBC Module Config:{ address : "com.bloidonia.jdbcpersistor" driver : "org.hsqldb.jdbcDriver", url : "jdbc:hsqldb:mem:test", username : "someuser", password : "somepass",}
https://github.com/timyates/mod-jdbc-persistor
Wednesday, July 24, 13
“New [Java | jvm-language] Framework!!”
Wednesday, July 24, 13
http://geek-news.mtv.com//wp-content/uploads/geek/2012/11/picard-facepalm2.jpghttp://geek-news.mtv.com/2012/11/07/star-trek-wedding-proposal/
Wednesday, July 24, 13
But Vert.x was different.
Wednesday, July 24, 13
...for the JVM
Wednesday, July 24, 13
Mature concurrency model- vert.x is based on the Reactor pattern
http://en.wikipedia.org/wiki/Reactor_pattern
Wednesday, July 24, 13
Platform Stability- HTTP, HTTPS, TCP, SSL- clients and servers- All netty 4.0 based
http://netty.io/
Wednesday, July 24, 13
Homogenous- file system API- data-driven event bus
Wednesday, July 24, 13
Polyglot- Container modules- currently supports: JavaScript, Ruby, Python, Groovy, Scala,
Wednesday, July 24, 13
Scalability Modularity Developer-focused
Wednesday, July 24, 13
Scalability
Wednesday, July 24, 13
Event Bus- simple, distributed peer-to-peer - pub/sub or point-to-point- local or distributed**- ‘data only’ with limited number of types
Wednesday, July 24, 13
Event Bus... but it’s a good idea to use JSON!
(completely language agnostic - we are building services and decoupling!)
Wednesday, July 24, 13
“local or distributed”
BONUS: EventBus can extend directly to the browser
http://vertx.io/core_manual_java.html#sockjs-eventbus-bridge
Wednesday, July 24, 13
Modularity
Wednesday, July 24, 13
{ address : "com.bloidonia.jdbcpersistor" driver : "org.hsqldb.jdbcDriver", url : "jdbc:hsqldb:mem:test", username : "someuser", password : "somepass",}
Wednesday, July 24, 13
Module Benefits- encapsulation- distributability- dynamic- structured
Wednesday, July 24, 13
Encapsulation- classpath and dependency- classloader isolation(but multiple instances of the module will share classloaders)
Wednesday, July 24, 13
Distributabilitypushed to/loaded from:- file system (contained or shared)- maven central- bintray
http://vertx.io/mods_manual.html#how-vertx-locates-modules
Wednesday, July 24, 13
Dynamic- automatically downloaded and installed- loaded/unloaded at runtime
Wednesday, July 24, 13
Structured- minimalistic descriptor syntax- sub-modules (can be thought of as "this module 'deploys' these modules" directive)
Wednesday, July 24, 13
Running a module and providing it’s configuration
Wednesday, July 24, 13
Modules and Concurency- Worker (blocking)- Event loop (non-blocking)
Wednesday, July 24, 13
Worker Modules- single or multi-threaded- useful for legacy APIs(ex. JDBC)
Wednesday, July 24, 13
Event Loop Modules- control number of instances- instance per core is ideal
Wednesday, July 24, 13
Modules (best for last...)
Wednesday, July 24, 13
Dog food-ing FTW:Language runtimes are all module based
Wednesday, July 24, 13
Developer friendly
Wednesday, July 24, 13
Polyglot (cont’d)
Wednesday, July 24, 13
JavaScript- Rhino - DynJS: invokeDynamic based implementation
http://dynjs.org/https://github.com/vert-x/mod-lang-dynjs
Wednesday, July 24, 13
Simple Programming Model- just don’t block the event loop!- reactor pattern- worker delegates
http://en.wikipedia.org/wiki/Reactor_patternhttp://vertx.io/core_manual_java.html#writing-verticles
Wednesday, July 24, 13
Provides most common services- HTTP/HTTPS- TCP/SSL- SockJS- File system access (includes sendfile() wrappers)
Wednesday, July 24, 13
Build It: Maven- archetype integration- plug-in for launching/running
http://vertx.io/maven_dev.html
Wednesday, July 24, 13
Build It: Gradle- template project to clone
http://vertx.io/gradle_dev.html
Wednesday, July 24, 13
Test It!- JUnit integration utilities- Container and IDE integration(IntelliJ and Eclipse)
Wednesday, July 24, 13
Summary- General purpose application platform- Polyglot development- Asynchronous APIs
Wednesday, July 24, 13
Vert.x:Simple. Not Simplistic.
Wednesday, July 24, 13
Questions?
Wednesday, July 24, 13