Tag: spring boot

Not Loading Java Beans on Boot

Java Beans are eagerly created in Spring Boot applications by default. That includes dependency beans. This is something I need to remember always. I tend to forget it and take it for granted since Spring Boot is great at spoiling Java developers. While that is a boon in most times, it can easily become a…

continue reading
No Comments

Chaining Profiles and Additional Documents

Just recently I have been playing around with multiple active profiles. This is apart from having the main application config, plus the profile that matches the environment on which the application is running. That is quite commonplace. Instead I’m talking more of an additional profile that gets activated aside from the environment profile based on…

continue reading
No Comments

Spring Boot Apps With Spring Cloud Config

It is not uncommon for a Java application to have a number of properties that needs to be defined for it to to run smoothly at start. While these configurable parameters that are required by the app can be set in the code, placing those outside is a more logical and cleaner approach. Things like…

continue reading
No Comments

Simple SQL Query Builder

Did a simple, customized SQL query builder that’s only specific for UPDATE statements some time early last year. Thought I’d just write it down here. It was a smaller part of a bigger application. It wasn’t required for all update cases, but a number of them did. I’ve mostly re-written it from memory. It should…

continue reading
No Comments

Thymeleaf Basics In Spring Boot

I recently started on the path on building content on the fly that gets sent out as soon as possible, using a template engine, but from a back-end perspective. If that makes sense? This is for an event-driven application that sits there and listens for incoming messages. A simple one. Consume the message as soon…

continue reading
No Comments

When API Response Is In Array

From time to time I get some of this odd API response from requesting information for a specific something. I expect the response data to be a simple JSON object. Instead I am looking at a JSON array. I suppose that is still simple enough and it’s not so odd. This kind of response happens…

continue reading
No Comments

Spring OAuth2 Using Password Grant Type With Additional Headers Continued

Part 2 – Accessing a Resource Recap This is a continuation of the previous post that I made some time last month. You can start reading from there to get more context – https://www.joseyamut.xyz/2021/02/24/spring-oauth2-using-password-grant-type-with-additional-headers The first part dealt with getting the access token from a 3rd party token service provider using a password grant. The…

continue reading
1 Comment

Spring OAuth2 Using Password Grant Type With Additional Headers

Part 1 – Getting the Access Token In this example, I am using the older Spring Security library which is: spring-security-oauth2 The JAR file can be found at Maven public repositories here. Dependency For my case, I am specifically using the release version below because I am trying to match some limitations (Such as what…

continue reading
1 Comment

Read YAML in Spring Boot

Properties written in YAML format in my opinion reads better, far better for a human, especially when an application has tons of properties in there. Well, after all YAML was designed to be a human-readable data-serialization language. Officially it complies with JSON and is a subset of the latter (depends which version though as I’ve…

continue reading
1 Comment

Access EntityManager From Spring Data JPA In Spring Boot

Using Repository implementation with Spring Data, one can develop applications with an underlying database rapidly in Spring Boot. The Spring Data JPA handles the abstraction of the persistence layer quite well. Many times you probably won’t need anything else beyond what it has to offer. A lot can already be done with the exposed methods…

continue reading
No Comments

Using OpenShift Secrets With Spring Boot + Kafka

Going to skip right away to the juicy stuff as much as I can. I won’t discuss about what OpenShift is or what the Secrets feature does. This is only about my experience the first time I dealt with Secrets and how I used it for a Spring Boot Kafka consumer/client application. The problem I…

continue reading
No Comments

Creating Links Using Spring Boot HATEOAS

So I am involved in this project currently where the project architect suggested that we follow HATEOAS-driven RESTful web service. This is probably something I have read about before, but didn’t really pay much attention to, or I simply forgot. Learning something new is always fun. Well, most of the time it is. It depends…

continue reading
1 Comment