An Introduction to Vert.x

Click here to load reader

  • date post

    08-May-2015
  • Category

    Technology

  • view

    12.092
  • download

    2

Embed Size (px)

description

JJUG CCC 2013 Fall のスライド #jjug_ccc

Transcript of An Introduction to Vert.x

  • 1.JJUG CCC 2013 Fall R5-6 [BOF] Over the Node.js An Introduction to Vert.x 2013/11/09 Acroquest Technology

2. 1. 2. Vert.x 3. Vert.x 4. Vert.x 5. Java http://www.flickr.com/photos/delta_139/4878497911/ Copyright Acroquest Technology Co., Ltd. All rights reserved.2 3. 1. = : twitter: @muraken720 : Acroquest Technology Co.,Ltd. : : Java & JavaScript & CSS3 & HTML5 : Vert.x Backbone.js Jeet4 Copyright Acroquest Technology Co., Ltd. All rights reserved.3 4. 1. n http://acro-engineer.hatenablog.com/l Vert.x 13 l Backbone.js l RealtimeConf 2013Copyright Acroquest Technology Co., Ltd. All rights reserved.4 5. Vert.x 2. Vert.x Copyright Acroquest Technology Co., Ltd. All rights reserved.5 6. 2. Vert.x 1. Vert.x Java Copyright Acroquest Technology Co., Ltd. All rights reserved.6 7. 2. Vert.x 2. Vert.x Project 1. Project Site http://vertx.io/2. Github https://github.com/eclipse/vert.x https://github.com/vert-x3. 100% open sourceASL 2.0 4. Eclipse Foundation Project 5. @timfox Project Leader @normanmaurerCopyright Acroquest Technology Co., Ltd. All rights reserved.7 8. 2. Vert.x 3. Vert.x 1. 2. 3. 4.High PerformanceAsynchronous/ Non-Blocking Distributed Event Bus Polyglot Module SystemCopyright Acroquest Technology Co., Ltd. All rights reserved.8 9. 2. Vert.x 3-1. High Performance 1. C10K 256kb1mb2. 1EventLoop Vert.xEventLoop non-blocking asynchronous http://www.flickr.com/photos/stickkim/7491816206/ Copyright Acroquest Technology Co., Ltd. All rights reserved.9 10. 2. Vert.x 3-1. High Performance n EventLoop JDBC CPU Thread.sleep() Object.wait() http://www.flickr.com/photos/mac_filko/5085785977/ Copyright Acroquest Technology Co., Ltd. All rights reserved.10 11. 2. Vert.x 3-1. High Performance n Asynchronous API TCP/SSL client & server HTTP/HTTPS client & server WebSocket SockJS File System Event Bus Timer etc.Copyright Acroquest Technology Co., Ltd. All rights reserved.11 12. 2. Vert.x 3-2. Distributed Event Bus 1. 2. 3. 4.Event BusVert.x Pub/SubPoint to PointRequest / Response JSON Vert.x Instance Event Bus http://www.flickr.com/photos/michellecarl/6960299327/ Copyright Acroquest Technology Co., Ltd. All rights reserved.12 13. 2. Vert.x 3-3. Polyglot n JVM http://www.flickr.com/photos/ johnnywashngo/6599602215/ Copyright Acroquest Technology Co., Ltd. All rights reserved.13 14. 2. Vert.x 3-3. Polyglot n Java public class HelloWorldVerticle extends Verticle { public void start() { vertx.createHttpServer().requestHandler(new Handler() { public void handle(HttpServerRequest req) { req.response().headers().set("Content-Type", "text/plain"); req.response().end("Hello World!!!"); } }).listen(8080); } }Copyright Acroquest Technology Co., Ltd. All rights reserved.14 15. 2. Vert.x 3-3. Polyglot n Java8 public class HelloWorldVerticle extends Verticle { public void start() { vertx.createHttpServer().requestHandler((HttpServerRequest req) -> { req.response().headers().set("Content-Type", "text/plain"); req.response().end("Hello World!!!"); }).listen(8080); } }Copyright Acroquest Technology Co., Ltd. All rights reserved.15 16. 2. Vert.x 3-4. Module System 1. 2. MavenBintray 3. EventBus http://www.flickr.com/photos/michellecarl/6960299327/ Copyright Acroquest Technology Co., Ltd. All rights reserved.16 17. 2. Vert.x 3-4. Module System 1. Module1Verticle 2. mod.json { "main":HelloVerticle", "auto-redeploy": true, "description":"Put description of your module here", "licenses": ["The Apache Software License Version 2.0"], "author": "Kenichiro Murata", "developers": [], "keywords": ["vert.x", "module", "java", "gradle"], "homepage": "https://github.com/muraken720/vert.x-module-template-for-java" }Copyright Acroquest Technology Co., Ltd. All rights reserved.17 18. 2. Vert.x 3-4. Module System 1. Vert.x Module Registry http://modulereg.vertx.io/2. WebServer Mailer MongoDB Redis JDBC mysql-postgresqlasync Yokeinspired by Connect Vertigosimilar to Storm CRaSH shell Copyright Acroquest Technology Co., Ltd. All rights reserved.18 19. Vert.x 3. Vert.x Copyright Acroquest Technology Co., Ltd. All rights reserved.19 20. 3. Vert.x 1. 1. Java7 2. Project Template Gradle Maven3. IDE Support Eclipse InteliJ4. Module Auto redeploy 5. Remote debug Vert.x 2 http://acro-engineer.hatenablog.com/entry/2013/08/15/073502 Copyright Acroquest Technology Co., Ltd. All rights reserved.20 21. 3. Vert.x 2. Vert.x 1. Node.js and the new web front-end http://www.nczonline.net/blog/2013/10/07/node-js-andthe-new-web-front-end/2. Node.js Vert.x 3. EventBusNode.jsVert.x vertx-eventbus-client https://npmjs.org/package/vertx-eventbus-clientCopyright Acroquest Technology Co., Ltd. All rights reserved.21 22. Vert.x Vert.x4. Vert.x Copyright Acroquest Technology Co., Ltd. All rights reserved.22 23. 4. Vert.x 1. Vert.x 2.1 M1 Release n Fat Jarexecutable jar Vert.x Coreexecutable jar Vert.x HAHigh Availability DNS / UDP Core API http://www.flickr.com/photos/stickkim/6962834384/ Copyright Acroquest Technology Co., Ltd. All rights reserved.23 24. 4. Vert.x 2. HAHigh Availability n In console 1: vertx runmod com.mycompany~my-mod1~1.0 -ha In console 2: vertx runmod com.mycompany~my-mod2~1.0 -ha http://www.flickr.com/photos/stickkim/7108906575/ Copyright Acroquest Technology Co., Ltd. All rights reserved.24 25. 4. Vert.x 2. HAHigh Availability n HA Group In console 1: vertx runmod com.mycompany~my-mod1~1.0 -ha -hagroup g1 In console 2: vertx runmod com.mycompany~my-mod2~1.0 -ha -hagroup g1 In console 3: vertx runmod com.mycompany~my-mod3~1.0 -ha -hagroup g2Copyright Acroquest Technology Co., Ltd. All rights reserved.25 26. Vert.x5. Copyright Acroquest Technology Co., Ltd. All rights reserved.26 27. 5. n Vert.x Application Platform High Performance Polyglot Module System EventBusn JVMModule n Java Copyright Acroquest Technology Co., Ltd. All rights reserved.27 28. Java Vert.x InfrastructuresEvolutionCopyright Acroquest Technology Co., Ltd. All rights reserved.28