Java

Load balancing Red Hat JBoss Enterprise Application Platform subclusters with mod_cluster

Load balancing Red Hat JBoss Enterprise Application Platform subclusters with mod_cluster

This article introduces a way to build and manage clustered environments using subclusters in a domain-mode installation of Red Hat JBoss Enterprise Application Platform (JBoss EAP). I assume that readers are familiar with JBoss EAP and the Apache HTTP Server (HTTPD) mod_cluster module. I introduce the load balancing group configuration for that module.

Continue reading Load balancing Red Hat JBoss Enterprise Application Platform subclusters with mod_cluster

Share
Generate automated Grafana metrics dashboards for MicroProfile apps

Generate automated Grafana metrics dashboards for MicroProfile apps

Grafana is an awesome visualization tool for seeing real-time metrics from your applications, and you can combine it with MicroProfile and similar tools to create one dashboard for multiple projects. Different projects use different names for metrics, however, so it is often necessary (and tedious) to handcraft the metrics for each project. Moreover, each project can expose its own custom metrics, and each MicroProfile vendor can also produce custom metrics, so there are many manual steps involved if you want to see all of your metrics in one place.

What if you could simply examine a running app and generate a dashboard with all of its exposed metrics? That is exactly what you can do with the MicroProfile Metrics Generator, a new open source tool that I created to dynamically generate Grafana dashboards for any MicroProfile project by capturing and monitoring all of your project metrics. Once you’ve created a dashboard, you can use it with Grafana, customize it to suit specific needs, and save it as a JSON file. You can also periodically regenerate your dashboards to bring in new metrics that you’ve exposed in your application.

In this article, you will learn how to do just that: Use the MicroProfile Metrics Generator to create a unified dashboard for all of your project’s metrics.

Continue reading “Generate automated Grafana metrics dashboards for MicroProfile apps”

Share
Behavior is easy, state is hard: Tame inconsistent state in your Java code

Behavior is easy, state is hard: Tame inconsistent state in your Java code

DevNation Tech Talks are hosted by the Red Hat technologists who create our products. These sessions include real solutions plus code and sample projects to help you get started. In this talk, you’ll learn the root cause of common inconsistent state-related bugs in your production Java code—and how to solve them—from Edson Yanaga and Burr Sutter.

Continue reading Behavior is easy, state is hard: Tame inconsistent state in your Java code

Share
Improved XML grammar binding and more in Red Hat VS Code XML extension 0.13.0

Improved XML grammar binding and more in Red Hat VS Code XML extension 0.13.0

Following closely on the huge 0.12.0 update, the new Red Hat XML extension for Visual Studio Code (VS Code) 0.13.0 release makes XML editing in VS Code even better. For this release, we focused on making it easier to bind and generate a new XML Schema Definition (XSD) or Document Type Definition (DTD) grammar file from an existing XML file. Other highlights include document link support for xsi:schemaLocation, XML catalog snippets, support for XML catalog path validation, and support for DTD SystemId file path completion.

Continue reading Improved XML grammar binding and more in Red Hat VS Code XML extension 0.13.0

Share
Build a simple cloud-native change data capture pipeline

Build a simple cloud-native change data capture pipeline

Change data capture (CDC) is a well-established software design pattern for a system that monitors and captures data changes so that other software can respond to those events. Using KafkaConnect, along with Debezium Connectors and the Apache Camel Kafka Connector, we can build a configuration-driven data pipeline to bridge traditional data stores and new event-driven architectures.

This article walks through a simple example.

Continue reading “Build a simple cloud-native change data capture pipeline”

Share
Improved schema binding and more in Red Hat XML extension for VS Code 0.12.0 and LemMinX

Improved schema binding and more in Red Hat XML extension for VS Code 0.12.0 and LemMinX

The latest update of the Red Hat XML extension for Visual Studio Code (VS Code), version 0.12.0, is packed with bug fixes and new features. It includes the new version of the underlying Eclipse LemMinX XML language server. In this update, we streamlined the process of writing XML Schema Definitions (XSD) and Document Type Definitions (DTD). We also added shortcuts to bind XML documents to either of these types of XML grammar.

Continue reading Improved schema binding and more in Red Hat XML extension for VS Code 0.12.0 and LemMinX

Share
Install Apache Tomcat and deploy a Java web application on Red Hat OpenShift

Install Apache Tomcat and deploy a Java web application on Red Hat OpenShift

If you are new to OpenShift, then you might want to install Apache Tomcat on top of it for simpler experimentation. This article guides you through installing Apache Tomcat from a Docker image and then using it to deploy a Java web app on Red Hat OpenShift. I also show you how to access the Tomcat management console on OpenShift.

To follow the examples, you must have an OpenShift account. We will use the OpenShift command-line interface (CLI) for this demonstration, so be sure to install the CLI (oc) before you begin.

A note about the sample application: You will need a Java web application to use for the deployment example. I am using the Sample Java Web Application from the OpenShift Demos GitHub repository. It is a simple application that is useful for understanding basic concepts. You may use the provided sample or choose your own application to work with.

Continue reading “Install Apache Tomcat and deploy a Java web application on Red Hat OpenShift”

Share
Develop Eclipse MicroProfile applications on Red Hat JBoss Enterprise Application Platform Expansion Pack 1.0 with Red Hat CodeReady Workspaces

Develop Eclipse MicroProfile applications on Red Hat JBoss Enterprise Application Platform Expansion Pack 1.0 with Red Hat CodeReady Workspaces

This article builds on my previous tutorial, Enable Eclipse MicroProfile applications on Red Hat JBoss Enterprise Application Platform 7.3. To follow the examples, you must have Eclipse MicroProfile enabled in your Red Hat JBoss Enterprise Application Platform Expansion Pack (JBoss EAP XP) 1.0.0.GA installation, via Red Hat CodeReady Studio. See the previous article for installation instructions.

In this article, we will use the installed MicroProfile-enabled image to set up a JBoss EAP XP quickstart project in Red Hat CodeReady Workspaces (CRW). You can also apply what you learn from this article to develop your own applications using CodeReady Workspaces.

Note: For more examples, be sure to see the video demonstration at the end of the article.

Continue reading “Develop Eclipse MicroProfile applications on Red Hat JBoss Enterprise Application Platform Expansion Pack 1.0 with Red Hat CodeReady Workspaces”

Share
Introducing the Red Hat build of the OpenJDK Universal Base Images—now in Red Hat Enterprise Linux 8.2

Introducing the Red Hat build of the OpenJDK Universal Base Images—now in Red Hat Enterprise Linux 8.2

With the recent release of Red Hat Enterprise Linux 8.2, we also added the first Red Hat build of OpenJDK Universal Base Images. These General Availability (GA) images for OpenJDK 8 and OpenJDK 11 set a new baseline for anyone who wants to develop Java applications that run inside containers in a secure, stable, and tested manner.

In this article, we introduce the new OpenJDK Universal Base Images and explain their benefits for Java developers. Before we do that, let’s quickly review what we know about UBIs in general.

About Universal Base Images

Red Hat Universal Base Images (UBIs) are:

OCI-compliant container base operating system images with complementary runtime languages and packages that are freely redistributable. Like previous base images, they are built from portions of Red Hat Enterprise Linux (RHEL). UBI images can be obtained from the Red Hat container catalog and be built and deployed anywhere.

In other words, UBIs help application developers reach the secure, stable, and portable world of containers. These images are accessible using well-known tools like Podman/Buildah and Docker. Red Hat Universal Base Images also allow users to build and distribute their own applications on top of enterprise-quality bits that are supportable on Red Hat OpenShift and Red Hat Enterprise Linux.

Continue reading “Introducing the Red Hat build of the OpenJDK Universal Base Images—now in Red Hat Enterprise Linux 8.2”

Share
Debugging GraalVM-native images using gdb

Debugging GraalVM-native images using gdb

The GraalVM project includes, amongst other capabilities, a component called GraalVM Native Image. GraalVM Native Image supports the delivery of Java applications as shrink-wrapped, self-contained, standalone executables, commonly referred to as Java-native images. Native images often have a smaller footprint and faster startup time compared to running the same application in the traditional way on the JVM. This is often a win for short-running applications or small, container-based services. The trade-off is usually lower peak performance for long-running programs, and higher garbage collection overheads and latencies for programs with large amounts of resident data.

We are especially interested in GraalVM-native images as an alternative back-end delivery option for applications based on Quarkus. The Java team has worked hard to ensure that Quarkus is well integrated with GraalVM Native Images. In the process, they have found that one important usability issue is the ability to debug the delivered native image.

Continue reading “Debugging GraalVM-native images using gdb”

Share