Real-time Web Application Development using Vert.x 2.0

Book description

The real-time web is gaining momentum and this book provides the simplest way to jump on board. A beautifully clear tutorial on Vert.x, it helps you develop a real-time web application from the ground up.

  • Get started with developing applications for the real-time web
  • From concept to deployment, learn the full development workflow of a real-time web application
  • Utilize the Java skills you already have while stepping up to the next level
  • Learn all the major building blocks of the Vert.x platform
  • Follow a hands-on tutorial with a running example

In Detail

Vert.x is a platform for building highly networked and scalable applications on the Java Virtual Machine. Using just a few powerful building blocks, it provides a powerful framework that scales to a multitude of different usage scenarios. It is one of the few truly polyglot development platforms, providing seamless interoperability between components written in JavaScript, CoffeeScript, Java, Ruby, Python, and Groovy.

Real-time Web Application Development with Vert.x will show you how to get up and running on the powerful Vert.x platform. Using a hands-on example of developing a mind map editor, this book shows you how to build a Vert.x application from the ground up, and on the way introduces all of the major building blocks of Vert.x, such as integrating with a database, polyglot development, and so on.

Real-time Web Application Development with Vert.x will guide you step-by-step through building a Vert.x application so that you’ll be able to start building one of your own in no time. From initiation to scaling, you’ll develop a mind map editor application with real-time collaboration capabilities. As you go through the development process, you’ll get to know all the building blocks of Vert.x applications: Verticles, Worker Verticles, the Event Bus, and Modules. You’ll also see how Vert.x apps seamlessly reach into client devices by building a client application using the Vert.x Event Bus Bridge, Knockout.js, and D3.js.

Real-time Web Application Development with Vert.x guides you through the whole Vert.x application development process, tying all of the important concepts together with a simple, realistic example application.

Table of contents

  1. Real-time Web Application Development using Vert.x 2.0
    1. Table of Contents
    2. Real-time Web Application Development using Vert.x 2.0
    3. Credits
    4. About the Author
    5. About the Reviewers
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. Why Vert.x?
        1. Simple
        2. Polyglot
        3. The Java platform
        4. General purpose
      2. What this book covers
      3. What you need for this book
      4. Who this book is for
      5. Conventions
      6. Reader feedback
      7. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Getting Started with Vert.x
      1. Installing Vert.x
        1. Prerequisite – Java
          1. Checking your version of Java
          2. Obtaining Java
        2. Obtaining a Vert.x distribution
        3. OS X and Linux
        4. Windows
      2. Running Vert.x
        1. Embedding Vert.x
      3. Your first verticle – Hello world
      4. A web server
      5. Summary
    9. 2. Developing a Vert.x Web Application
      1. Adding a new verticle for mind map management
      2. Implementing server-side mind map management
        1. Listing mind maps
        2. Saving a mind map
        3. Deleting a mind map
        4. The resulting code
      3. Bridging the event bus to clients
        1. The server
        2. The client
        3. Testing the bridge
      4. Adding the user interface
        1. Listing the mind maps
        2. Creating a mind map
        3. Deleting a mind map
      5. Verticles and concurrency
      6. Summary
    10. 3. Integrating with a Database
      1. MongoDB
      2. Installing MongoDB
      3. Installing the Vert.x Mongo Persistor module
      4. Implementing database integration for mind map management
        1. Requiring the Vert.x console
        2. Listing mind maps
        3. Finding a specific mind map
        4. Saving a mind map
        5. Deleting a mind map
      5. Refactoring to remove duplication
      6. Summary
    11. 4. Real-time Communication
      1. The mind map structure
      2. Real-time interaction
        1. Events
        2. Commands
      3. The editor verticle
        1. The helper functions
        2. The add node command handler
        3. The rename node command handler
        4. The delete node command handler
      4. Deploying the editor verticle
      5. The client
        1. The mind map editor file
        2. Updating the HTML
        3. Opening the editor
        4. Sending the commands
        5. Handling events
        6. Sharing the findNodeByKey function
        7. Initializing the visualization
        8. Rendering the visualization
        9. Calling the render function
        10. Styling the visualization
      6. Testing the editor
      7. Summary
    12. 5. Polyglot Development and Modules
      1. Vert.x modules and reuse
      2. Creating a module
        1. The module directory
        2. Module descriptor
        3. Libraries
        4. Implementing the module
      3. Deploying the module
      4. Integrating the client
      5. Summary
    13. 6. Deploying and Scaling Vert.x
      1. Deploying a Vert.x application
        1. Setting up an Ubuntu box
        2. Setting up a user
        3. Installing Java on the server
        4. Installing MongoDB on the server
        5. Setting up privileged ports
        6. Installing Vert.x on the server
        7. Making the application port configurable
        8. Setting up the application on the server
        9. Testing the setup
        10. Setting up an upstart service
        11. Deploying new versions
      2. Scaling a Vert.x application
        1. Verticle counts
        2. Memory
          1. Clustering Vert.x
      3. Summary
    14. Index

Product information

  • Title: Real-time Web Application Development using Vert.x 2.0
  • Author(s):
  • Release date: September 2013
  • Publisher(s): Packt Publishing
  • ISBN: 9781782167952