vert.x

Asynchronous communication between microservices using AMQP and Vert.x

Asynchronous communication between microservices using AMQP and Vert.x

Microservices are the go-to architecture in most new, modern software solutions. They are (mostly) designed to do one thing, and they must talk to each other to accomplish a business use-case. All communication between the microservices is via network calls; this pattern avoids tight coupling between services and provides better separation between them.

There are basically two styles of communication: synchronous and asynchronous. These two styles applied properly are the foundation for request-reply and event-driven patterns. In the case of the request-reply pattern, a client initiates a request and typically waits synchronously for the reply. However, there are cases where the client could decide not to wait and register a callback with the other party, which is an example of the request-reply pattern in an asynchronous fashion.

In this article, I am showcasing the approach of asynchronous request-reply by having two services communicate with each other over Advanced Message Queuing Protocol (AMQP). AMQP is an open standard for passing business messages between applications or organizations. Although this article focuses on the request-reply pattern, the same code can be used to develop additional scenarios like event sourcing. Communicating using an asynchronous model can be very beneficial for implementing the aggregator pattern.

I will be using Apache QPid Proton (or Red Hat AMQ Interconnect) as the message router and the Vert.x AMQP bridge for communication between the two services.

Continue reading “Asynchronous communication between microservices using AMQP and Vert.x”

Share
Red Hat Data Grid on Three Clouds (the details behind the demo)

Red Hat Data Grid on Three Clouds (the details behind the demo)

If you saw or heard about the multi-cloud demo at Red Hat Summit 2018, this article details how we ran Red Hat Data Grid in active-active-active mode across three cloud providers. This set up enabled us to show a fail over between cloud providers in real time with no loss of data. In addition to Red Hat Data Grid, we used Vert.x (reactive programming), OpenWhisk (serverless), and Red Hat Gluster Storage (software-defined storage.)

This year’s Red Hat Summit was quite an adventure for all of us. A trip to San Francisco is probably on the bucket list of IT geeks from all over the world. Also, we were able to meet many other Red Hatters, who work remotely for Red Hat as we do.  However, the best part was that we had something important to say: “we believe in the hybrid/multi cloud” and we got to prove that live on stage.

Photo credit: Bolesław Dawidowicz

 

Continue reading “Red Hat Data Grid on Three Clouds (the details behind the demo)”

Share
When Vert.x Meets Reactive eXtensions (Part 5 of Introduction to Vert.x)

When Vert.x Meets Reactive eXtensions (Part 5 of Introduction to Vert.x)

This post is the fifth post of my Introduction to Eclipse Vert.x series. In the last post, we saw how Vert.x can interact with a database. To tame the asynchronous nature of Vert.x, we used Future objects. In this post, we are going to see another way to manage asynchronous code: reactive programming. We will see how Vert.x combined with Reactive eXtensions gives you superpowers.

Let’s start by refreshing our memory with the previous posts:

  • The first post described how to build a Vert.x application with Apache Maven and execute unit tests.
  • The second post described how this application became configurable.
  • The third post introduced vertx-web, and a collection management application was developed. This application exposes a REST API used by an HTML/JavaScript front end.
  • In the fourth post, we replaced the in-memory back end with a database and introduced Future to orchestrate our asynchronous operations.

In this post, we are not going to add a new feature. Instead, we’ll explore another programming paradigm: reactive programming.

Continue reading “When Vert.x Meets Reactive eXtensions (Part 5 of Introduction to Vert.x)”

Share
Accessing Data – The Reactive Way

Accessing Data – The Reactive Way

This is the fourth post of my “Introduction to Eclipse Vert.x.” series. In this article, we are going to see how we can use JDBC in an Eclipse Vert.x application using the asynchronous API provided by the vertx-jdbc-client. But before diving into JDBC and other SQL subtleties, we are going to talk about Vert.x Futures.

In “The Introduction to Vert.x” Series

Let’s start by refreshing our memory about the previous articles:

  1. The first post described how to build a vert.x application with Maven and execute unit tests.
  2. The second post reviewed how this application became configurable.
  3. The third post introduced vertx-web, and a collection management application was developed. This application exposes a REST API used by an HTML/JavaScript frontend.

Continue reading “Accessing Data – The Reactive Way”

Share
Some REST with Vert.x (Part 3 of Introduction to Vert.x)

Some REST with Vert.x (Part 3 of Introduction to Vert.x)

This post is the third in a series on the Introduction to Eclipse Vert.x. So, let’s have a quick look back at the content of the previous posts. In the first post, we developed a very simple Eclipse Vert.x application and saw how this application can be tested, packaged, and executed. In the second post, we saw how this application became configurable and how we can use a random port in a test.

Well, nothing fancy… Let’s go a bit further this time and develop a CRUD-ish / REST-ish application. So an application exposing an HTML page interacting with the backend using a REST API. The level of RESTfulness of the API is not the topic of this post; I leave it you to decide as it’s a very slippery topic.

So, in other words, we are going to see:

  • Vert.x Web – a framework to let you create web applications easily using Vert.x.
  • How to expose static resources.
  • How to develop a REST API.

Continue reading “Some REST with Vert.x (Part 3 of Introduction to Vert.x)”

Share
Eclipse Vert.x Application Configuration (Part 2 of Introduction to Vert.x)

Eclipse Vert.x Application Configuration (Part 2 of Introduction to Vert.x)

In my previous post, Introduction to Eclipse Vert.x, we developed a very simple Vert.x application and saw how this application can be tested, packaged, and executed. That was nice, wasn’t it? Well, that was only the beginning. In this post, we are going to enhance our application to support external configuration, and learn how to deal with different configuration sources.

Continue reading “Eclipse Vert.x Application Configuration (Part 2 of Introduction to Vert.x)”

Share
Visualizing Smog Sensor Data with the help of Vert.x, Prometheus, and Grafana

Visualizing Smog Sensor Data with the help of Vert.x, Prometheus, and Grafana

Air pollution is a major problem in many cities around the globe. Some people in Stuttgart, Germany have developed cheap smog sensors that people can install on their balconies and other convenient places and then report data to a central site. I have written about that on OpenSource.com. The data is sent to a central server, from where it is visualized on a map. At the time of writing the above article, there was no way of seeing how the value has changed over time. Meanwhile, there is a visualization of the last 24 hours available on the map.

Continue reading “Visualizing Smog Sensor Data with the help of Vert.x, Prometheus, and Grafana”

Share
Technical Cheat Sheets for Developers

Technical Cheat Sheets for Developers

Over the past few months, we’ve been building and releasing a variety of technical cheat sheets and we’ve been getting many requests for more.  We are working on new cheat sheets every day, ok maybe not weekends, but almost every day. Here are the cheat sheets available today: Linux Commands Cheat SheetAdvanced Linux Commands Cheat SheetWildfly Swarm Cheat SheetContainers Cheat SheetMongoDB Cheat SheetKubernetes Cheat Sheet and the Eclipse Vert.x Cheat Sheet.

Continue reading “Technical Cheat Sheets for Developers”

Share