WildFly Configuring HTTP Session in a cluster

This tutorial discusses in detail how to configure HTTP Session Management in clustered Web applications, based on the new changes introduced in WildFly 17. Web applications which are running in a cluster-aware configuration (“ha” or “full-ha” profile) can survive the lifespan of a single server by adding the element into the web.xml file. Example: <web-app … Read more

JAX-RS CRUD Application using Vue.js and RESTEasy

Let’s check in this tutorial how to build a  JAX-RS CRUD application (on the top of WildFly application server) using Vue.js and Axios as Front End. Let’s start with some basic concepts about Vue.js: in a nutshell, Vue.js is a system that enables us to declaratively render data to the DOM using straightforward template syntax. … Read more

WildFly: How to call an EJB from an EJB located in another application

The purpose of this tutorial is to demonstrate how to lookup and invoke an EJB deployed on an WildFly server instance from another EJB located in another application. Here is our scenario: If, on the other hand, your scenario requires invoking an EJB from a standalone remote Client, then check this tutorial: WildFly remote EJB … Read more

Quarkus book is out!

I’m glad to announce Packt Publishing just published my latest book “Hands-On Cloud-Native Applications with Java and Quarkus: Build high performance Java microservices on Kubernetes” !   Build robust and reliable Java applications that works on modern infrastructure such as containers and cloud using the latest features of Quarkus 1.0 Key Features Build applications with … Read more

IntelliJ IDEA tip: How to connect to a Database using Database Navigator

IntelliJ IDEA is a powerful development environment. In today’s tip we will learn how to install the Database Navigator plugin that adds database capabilities to your development environment. Let’s start from the plugin installation. In order to do that, select the Settings | Plugin Panel and search for the “database navigator” in the MarketPlace text … Read more

Configuring Keycloak Database

This tutorial will show you three different ways to configure a different database for your Keycloak Identity Provider. Let’s check it out! Configuring a local Keycloak Database So the first way to configure a Keycloak Identity Provider with a Database is by adding a Datasource configuration specific for keycloak. This can be done by setting … Read more

How to code EJB Timers like a pro

The EJB Timer Service can build applications that depend on time based services. In this tutorial we will show how you can receive timer notifications on your Session Beans. In order to do that, an EJB needs to register with the Timer service and one of its methods will be called back on a time … Read more

How to use multiple database in persistence.xml?

The Java Persistence API allows you to define multiple persistence units, each of which can map to a separate database. In order to use multiple Database, simply define a persistent-unit for each one in the persistence.xml file : <persistence> <persistence-unit name=”sample-db1″> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/SamplesDB</jta-data-source> </persistence-unit> <persistence-unit name=”sample-db2″> <provider> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider </provider> <jta-data-source>jdbc/SamplesDB2</jta-data-source> </persistence-unit> </persistence> In te above … Read more

Getting started with MicroProfile FaultTolerance API

The Microprofile Fault Tolerance specification has been specifically built to make your microservices to common failures like network problems or an IOException. In this tutorial we will learn how to use some patterns like @Timeout, @Retry, @Fallback and @CircuitBreaker policies to drive an alternative result when an execution does not complete successfully. Let’s start from … Read more

Securing Quarkus with Elytron Database Realm

Quarkus security includes several extensions from Elytron. In this tutorial we will learn how to use the Database Realm Authentication with a simple REST Service. Our project will perform authentication against the H2 in-memory database. In order to bootstrap our project we will need the following extensions mvn io.quarkus:quarkus-maven-plugin:1.0.0.CR1:create \ -DprojectGroupId=com.mastertheboss \ -DprojectArtifactId=quarkus-jdbc-realm \ -DclassName=”com.mastertheboss.SecuredResource” … Read more