Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      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
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java 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

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • 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

    • GuideLLM: Evaluate LLM deployments for real-world inference

    • Unleashing multimodal magic with RamaLama

    • Integrate Red Hat AI Inference Server & LangChain in agentic workflows

    • Streamline multi-cloud operations with Ansible and ServiceNow

    • Automate dynamic application security testing with RapiDAST

    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

    Red Hat legal and privacy links

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

    Report a website issue