Categories
Java

Open a URL in the default browser in Java

When developing a Java desktop or command-line application, you may need to prompt the operating system to open a URL. For instance, to login or approve authentication (OAuth). One approach is to print out the URL and ask the user to copy/paste it. A better alternative is opening that in the user’s default browser automatically. […]

Categories
Java Kubernetes

Capture Java apps heap dumps on Kubernetes (the poor man’s way)

One of the practices when dealing with memory leak issues is to take a heap dump and analyze it to figure out which part of the code is causing the leak. The method of capturing heap dump varies depending on the technology stack. It is not limited to a single silver bullet. Some frameworks like […]

Categories
Java

Run integration tests with Maven Failsafe plugin

The Failsafe plugin is the de facto Maven plugin designed to run integration tests. Similar to the Surefire plugin that runs unit tests, Failsafe can be configured to run integration tests in a Maven goal. It provides enough flexibility to specify the goal and integration tests file convention. In this article, I go through how […]

Categories
Java

Control threads number in Java parallel stream

Java parallel stream is fantastic for processing gigantic data sets. It utilizes concurrency and multiple cores efficiency perfectly. So far my experience with it is very positive. Though, the major parallel stream has one major caveat. It uses the default application fork-join pool. And also the parallelism is not controllable. In this article, we cover […]

Categories
Java

Secure REST APIs in Quarkus using Basic Auth

Securing APIs is an essential part of any serious web applications. Quarkus offers many useful extensions to secure REST APIs in multiple ways. Supported mechanisms are basic auth, JWT, etc. In this article, we go through how to secure REST APIs in Quarkus using Basic Auth. In the last three articles we’ve built a User […]

Categories
Java

How to add Swagger to Quarkus

OpenAPI or Swagger specification is the de facto standard for creating REST APIs. Almost every developer expects to see some Swagger documentation when works with APIs or doing integration. Apps made with Quarkus are not exceptions either. In this article, I go through how to add Swagger to Quarkus apps. In the past two articles, […]

Exit mobile version