Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Red Hat build of Eclipse Vert.x 3.9 brings Fluent API Query

May 25, 2020
Syed M Shaaf
Related topics:
JavaMicroservicesEvent-Driven

Share:

    Red Hat Runtimes provides a set of comprehensive frameworks, runtimes, and programming languages for developers, architects, and IT leaders with cloud-native application development needs. The latest update to Red Hat Runtimes has arrived with Red Hat's build of Eclipse Vert.x version 3.9. Red Hat Runtimes provides application developers with a variety of application runtimes and lets them run on the Red Hat OpenShift Container Platform.

    A fluent API is a common pattern throughout Vert.x, it lets multiple methods calls be chained together. For example:

    request.response().putHeader("Content-Type", "text/plain").write("some text").end();

    Chaining calls like this also allows you to write code that’s a bit less verbose.

    With 3.9, you can now create prepared statements and collector queries with the inclusion of Query in the Fluent API. If you are familiar with JDBC, PreparedStatement lets you create and execute statements. Moreover, you can run multiple interactions, such as cursor or stream operations.

    Creating a prepared statement

    To create a prepared statement:

    connection.prepare(sql, ar1 -> {
      if (ar1.succeded()) {
        PreparedStatement ps = ar1.result();
        PreparedQuery<RowSet<Row>> pq = ps.query();
        pq.execute(tuple, ar2 -> ...);
    
    // Or fluently
        ps.query().execute(tuple, ar2 -> ...);
      }
    });

    Creating a collector query

    You can use the Java Collectors with Vert.x too. For example to create a collector query:

    PreparedQuery<RowSet<Row>> query = client.preparedQuery(sql);
    PreparedQuery<SqlResult<List<Row>> collectedQuery = query.collecting(Collectors.toList());
    collectedQuery.execute(tuple, ar -> ...);
    
    // Or fluently
    client.preparedQuery(sql).collecting(Collectors.toList()).execute(tuple, ar -> ...);

    See these Vert.x examples on GitHub.

    Use Promise instead of Future

    Another important change in this release is the deprecation of the following methods: start(Future<Void>) and stop(Future<Void>). The future() method returns the Future associated with a promise. The future can then be used for getting notified of the promise's completion and retrieving its value.

    Instead, use start(Promise<Void>) and stop(Promise<Void>). These methods represent the writable side of an action that may, or may not, have occurred yet. A promise extends Handler<AsyncResult<T>> so it can be used as a callback.

    Documentation

    For more details, take a look at the supported configurations and component details: Red Hat Runtimes Eclipse Vert.x Supported Configurations and Red Hat Runtimes Eclipse Vert.x 3.9 Component Details. If you are new to Eclipse Vert.x and would like to learn more, go to our live learning portal for a guided tutorial or to the documentation for details.

    Developer interactive learning scenarios

    These self-paced scenarios provide you with a preconfigured Red Hat OpenShift instance, accessible from your browser without any downloads or configuration. Use it to learn and experiment with Vert.x or learn about other technologies within Red Hat Runtimes and see how they help solve real-world problems.

    Getting support for Eclipse Vert.x

    Support for Eclipse Vert.x is available to Red Hat customers through a subscription to Red Hat Runtimes. Contact your local Red Hat representative or Red Hat Sales for details on how you can enjoy the world-class support offered by Red Hat and its worldwide partner network.

    Moving forward, customers can expect support for Eclipse Vert.x and other runtimes according to the Red Hat Product Update and Support Lifecycle.

    The people behind Eclipse Vert.x in Red Hat Runtimes

    This offering was produced by Red Hat's Runtimes product and engineering teams, along with the Eclipse Vert.x upstream community. It involved many hours of development, testing, documentation writing, testing some more, and working with the wider Red Hat community of customers, partners, and Vert.x developers to incorporate contributions, both big and small.

    Last updated: June 26, 2020

    Recent Posts

    • A deep dive into Apache Kafka's KRaft protocol

    • Staying ahead of artificial intelligence threats

    • Strengthen privacy and security with encrypted DNS in RHEL

    • How to enable Ansible Lightspeed intelligent assistant

    • Why some agentic AI developers are moving code from Python to Rust

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue