Spring MVC is a web framework based on the model–view–controller pattern. It is based on the Spring principles and supports a wide range of server-side rendering technologies as JSP, Thymeleaf, Groovy, among others. Dispatcher Servlet It is a front controller that coordinates all the request handling activities. Delegates to the web infrastructure beans and invokes the user’s web components. It ...
Read More »Home » Java » Enterprise Java »
Testing Expected Exceptions with JUnit 5
This post shows how to test for expected exceptions using JUnit 5. If you’re still on JUnit 4, please check out my previous post. Let’s start with the following class that we wish to test: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 public class Person { private final ...
Read More »Kafka & Zookeeper for Development: Connecting Brokers to the Ensemble
Previously we created successfully a Zookeeper ensemble, now it’s time to add some Kafka brokers that will connect to the ensemble and we shall execute some commands. We will pick up from the same docker compose file we compiled previously. First let’s jump on the configuration that a Kafka broker needs. 01 02 03 04 05 06 07 08 09 ...
Read More »Deploying a Quarkus or any Java based microservice behind an Nginx reverse proxy with SSL using docker
It has been a while but as per a friend requested I am going to show you how to deploy a Quarkus microservice behind an Nginx reverse proxy using docker. What are we going to do… I am going to install docker and docker-compose on a centos 8 host and I am going to deploy a docker container that will ...
Read More »Code Generation in CUBA: What makes the magic
Introduction Code generation is a common thing in modern frameworks. There may be different reasons behind introducing code generation – from getting rid of boilerplate code to reflection replacement and creating complex solutions based on domain-specific languages. Like every technology, code generation has application areas and limitations. In this article, we will have a look at code generation usage in ...
Read More »Kafka & Zookeeper for Development: Zookeeper Ensemble
Previously we spun up Zookeeper and Kafka locally but also through Docker. What comes next is spinning up more than just one Kafka and Zookeeper node and create a 3 node cluster. To achieve this the easy way locally docker-compose will be used. Instead of spinning up various instances on the cloud or running various Java processes and altering configs, ...
Read More »REST: Sorting collections
When building a RESTful API we often want to give consumers the option to order collections in a specific way (e.g. ordering users by last name). If our API supports pagination this can be quite an important feature. When clients only query a specific part of a collection they are unable to order elements on the client. Sorting is typically ...
Read More »Apache Camel 3.7 – More camel-core optimizations coming (Part 5)
I have previously blogged about the optimziations we are doing in the Apache Camel core. The first 3 blogs (part1, part2, part3) were a while back leading up to the 3.4 LTS release. Now we have done some more work (part4) and this part 5 that is coming up in the next 3.7 LTS release. This time we have mainly ...
Read More »Stylish API
In this blog post we are going to look at the new styling and other new options available in OpenAPI and SwaggerUI Quarkus (v1.10.0 +). Styling Default style The default style for Swagger UI has changed from the vanilla Swagger UI to a Quarkus branded page: In this post we mostly focus on Swagger UI, but the styling options also ...
Read More »