Get Reactive
 Responsive
 Resilient
 Elastic
 Message Driven
 asynchronous message-passing – loose couple
 location transparency
 Non-blocking – only consume resources while active
Vert.x – Reactive Toolkit
Avi Saidian @HPE
Overview
 Created by Tim Fox (VMWare) at 2011
 Joined the Eclipse Foundation at 2013
 June 24 2015 released version 3.0
 October 8 – 3.1 is out
Reactive Frameworks
 ReactiveX - http://reactivex.io/
 Typesafe
 Akka
 Dropwizard
 Vertx
 Netflix OSS
 Others…
Key Features
 Polyglot
Java
Javascript
Ruby
Groovy
Key Features
 Verticles
Basic execution unit
Actor like model
Always run in the same thread
Can have many instances
Classloader isolated
Communicate over messaging BUS
Demo
 Hello Polyglot
JS:
Key Features
 Event Bus
Point To Point
Publish/Subscribe
Request/Reply
Pass Strings, Buffer,
Primitives and JSON
Support Custom Types
(codec)
Key Features
 Ecosystem
 Lightweight vert.x core
 Web
 Data access (mongodb, redis, JDBS)
 Security (basic auth, jdbc auth, jwt, shiro)
 Reactive (based on RxJava)
Code Examples
My server code:
Code Examples
My JDBC code:
New In Vert.x 3.1
 Vertx-sync - perform async operations in a synchronous way,
but without blocking kernel threads.
 Vertx-stomp - implementation of a Simple (or Streaming) Text
Orientated Messaging Protocol
 Vertx-shell - a command line interface for the Vert.x runtime
 Next Release 3.2 – end of 2015.
Demo Time
 High Availability Server
 Load Balancing
 RealTime event bus
Live Vertx Project
 Mobile Apps Sentiment Analysis (MASA) Project:
 Async Collection Of Data
Get Comments
Detect Language
Persistency
 Async Processing of Comments
Sentiment Score
Classify
Informative Score
Persistency
2 Data Flows
Start Crawler Get Data
Identify
Language
Persist
Sentiment
Score
Classify
Informative
Score
Update
Questions?
References
 http://vertx.io/docs/
 http://vertx.io/blog/
 Source:
 https://github.com/eclipse/vert.x
 https://github.com/vert-x3/vertx-examples/
 https://github.com/vert-x3/
 http://www.infoq.com/articles/vertx-3-tim-fox
Backup: Vert.x on Docker
 There are vertx containers on Docker HUB:
 Vertx/vertx3
 Vertx-exec

Vertx – reactive toolkit

Editor's Notes

  • #3 See http://www.reactivemanifesto.org/glossary rapid and consistent response times The system stays responsive in the face of failure stays responsive under varying workload. a system should be responsive, resilient, and elastic which is fundamentally enabled by being message driven This was an short intro to reactive which is actually implement by …
  • #4 For the past year, I’ve been developing a vertx project. This project was founded as part of Innovation Program and started in Hackaton Contest. Vertx just got its Most Innovative Tech of 2014 - then it got funded and we needed to choose how to develop it. There were several options, but vertx just got most innovative award for 2014, so we decided to be innovative!
  • #5 Timfox created HornetQ as part of Jboss Redhat project – Started vert.x project under SpringSource then moved back to Redhat with the project
  • #6 There are several other reactive frameworks, most are based on the Observer design pattern RX-Java is the java implementation and has also integration into vert.x
  • #7 unlike the traditional Java stacks, Vert.x supports other languages than Java - e.g. JS, Ruby and Groovy so we don't force you to always use Java and can use the best language for the job at hand or for the skill-set of your team. Vert.x is just a library and you can use it along with Spring in the same application – I even managed to use vertx as embedded in tomcat WAR
  • #8 Vert.x is non-opinioned toolkit, unlike traditional monolithic frameworks like Java EE and application servers Not a restrictive framework or container designed from day one with microservices in mind – non blocking OS threads Allowing you to build apps using building blocks incredible power and agility to create compelling, scalable with minimum fuss Java 8  less boilerplate code Vert.x is event driven and non blocking. This means your app can handle a lot of concurrency using a small number of kernel threads. Vert.x lets your app scale with minimal hardware.
  • #9 Show similar server with Java source code
  • #11 Vert.x-Web contains all the parts you need to make sophisticated modern, scalable, web applications, and of course you can use it from any of the languages that Vert.x supports. It contains all the things you'd expect - cookies and session handling, pluggable auth, templating, websockets, support for SockJS, content negotiation and many, many more features. most Java database clients tend to be blocking so you have to be careful about not blocking a Vert.x event loop. Vert.x 3 provides an asynchronous JDBC client which basically wraps the JDBC interface and calls it using a thread pool and provides an async interface to the user, so the user doesn't have to worry about wrapping it themselves it's all about scaling your application with a lot of concurrency
  • #15 Vertx-sync is a set of utilities that allow you to perform asynchronous operations and receive events in a synchronous way, but without blocking kernel threads. Vertx-stomp is an implementation of a STOMP server and client. You can use the STOMP server with other clients and use the STOMP client with other servers. The server and the client supports the version 1.0, 1.1 and 1.2 of the STOMP protocol. The STOMP server can also be used as a bridge with the vert.x event bus. Vertx-shell is a command line interface for the Vert.x runtime available from regular terminals using different protocols.
  • #16 Vert.x supports clustering and HA out of the box. Cluster group management is implemented in cluster managers which are pluggable. The default cluster manager uses Hazelcast. You can have load balancing between verticle instances – so if we start 2, we can see that under load it round between both instances Vertx event bus is used internally inside the JVM, between cluster nodes and have a bridge to the client javascript app
  • #18 Each Block is a different verticle with no dependency – data is sent as Message (JsonObject)