Eclipse Vert.x logo

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
Eclipse Vert.x logo

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

Setting Up a Failover Scenario Using Apache Camel ZooKeeper

In this article, we will discuss using the Apache Camel ZooKeeper component, and demonstrate how easily we can set up a fail-over scenario for Apache Camel Routes. While working in a clustered environment, situations arise where a user wants to have a backup or slave route which will become active only when the master (or the currently active) route stops working. There are different ways to achieve this: one can use Quartz to configure a master-slave setup; JGroups can also be used. In a Fabric8 environment, there is a master component which can easily be set up as a failover scenario.

Continue reading “Setting Up a Failover Scenario Using Apache Camel ZooKeeper”

Share
Eclipse Vert.x logo

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

Deploying a Spring Boot App with MySQL on OpenShift

This article shows how to take an existing Spring Boot standalone project that uses MySQL and deploy it on Red Hat OpenShift,  In the process, we’ll create docker images which can be deployed to most container/cloud platforms. I’ll discuss creating a Dockerfile, pushing the container image to an OpenShift registry, and finally creating running pods with the Spring Boot app deployed.

To develop and test using OpenShift on my local machine, I used Red Hat Container Development Kit (CDK), which provides a single-node OpenShift cluster running in a Red Hat Enterprise Linux VM, based on minishift. You can run CDK on top of Windows, macOS, or Red Hat Enterprise Linux.   For testing, I used Red Hat Enterprise Linux Workstation release 7.3. It should work on macOS too.

To create the Spring Boot app I used this article as a guide. I’m using an existing openshift/mysql-56-centos7 docker image to deploy MySQL to  OpenShift.

Continue reading “Deploying a Spring Boot App with MySQL on OpenShift”

Share

Istio Circuit Breaker: When Failure Is An Option

The phrase “Failure is not an option” is tossed about with much bravado, as though one could make something work by just their strength of will. But the fact remains, things eventually fail. Everything. How then, do you handle the inevitable failure of your microservices? Well, by combining containers, Kubernetes, Red Hat OpenShift, and Istio, we can skip over-the-top displays of swagger, let the system handle things, and get some sleep at night.

Once again, Istio provides the basis of a popular and well-tested technology: The Circuit Breaker Pattern.

Like a circuit breaker in an electrical circuit, the software version allows flow to a service to be shut off. The circuit opens in the case where the endpoint is not functioning correctly. The endpoint may have failed or may just be too slow, but it represents the same problem: this container is not working.

Continue reading “Istio Circuit Breaker: When Failure Is An Option”

Share
Eclipse Vert.x logo

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