I have done the migration of the Spring Boot Application from 1.5.8 to 2.1.14-RELEASE and using gradle as a build script. I am using spring-boot-gradle-plugin and spring-boot-dependency-management plugins. In our spring boot project, we are creating multiple executable jar files by creating tasks for each jar…
Tag: spring-boot
springboot override controller methods
I have to ask because none of the answers I found can help me to solve my problem. I have controller I want to override its methods because one specific customer has specific logics, with controller that can have exactly same methods signatures or overriding methods with RequestBody extending the original req…
Use batch mode for dynamic listener
I am using a dynamic message listener. An example is shown below. I want to convert this to a batch listener (consume multiple messages at once). Is there a way to convert this, so that the listener consumes a list of consumer records? I am using spring-kafka with spring-boot. Thanks in advance Answer Impleme…
How to change default schema of LocalDateTime in Swagger documentation using springdoc?
We use Spring Boot and https://springdoc.org/ to generate OpenApi documentation. We want to change default schema for LocalDateTime, so we don’t have the same annotation every time LocalDateTime is used. So, I added: it worked. The issue is that now it’s impossible to add custom description or exa…
Gradle Build Error in Multi-module project: java.lang.NoClassDefFoundError: at groovyjarjarasm.asm.signature.SignatureReader.parseType
I’m getting Execution failed for task ‘:app-specification:compileTestGroovy’ along with org.gradle.api.tasks.TaskExecutionException: when trying to build gradle. This is a multi-module gradle project with the first module being the main app(SpringBoot app) with some Spock tests and the other…
Is it possible to get Authentication as json response?
currently it returns String but I’d like to send response as json to client. it api check the jwt’s authentication. it appears email,nickname etc as string now. Answer Simply use org.json.simple.JSONObject create a jsonobject and put everything inside it as key value pair and return it to client a…
ProcessBuilder’s inputstream empty depending of OS
I made this simple piece of code to test ProcessBuilder: It works in Windows (returns python version of my system) but the same code in my macbook returns end of line, so basically empty. ¿This needs further configuration according to the OS? ¿why is this happening? Answer What error code are you getting? The…
K8s Spring Application cannot connect to Mysql DB
I wanted to try and deploy my spring boot application on kubernetes. I setted up a test environment with microk8s (dns,storage,ingress enabled) which consists of a pod running the application itself and a pod with the MySQL database. Each pod has its own service and is running on the same default namespace. T…
Spring Boot HTTP security configuration anonymous filter and a custom filter on a different path
I have experienced a strange problem while trying to configure HTTP security by using WebSecurityConfigurerAdapter. Here is the full configuration class I tried so far: What I would like to do is actually enabling anonymous authentication for all endpoints — to prevent NullPointerExceptions when operating on …
Aggregate metric with unique id over defined time period in micrometer?
In spring-boot metrics ( with micromter and prometheous ) I can get no of log events for each threshold as follows. This shows aggregation for each log level for whole application time. I want similar custom metrics but aggregate over defined time period. Ex: I have unique ID for operation and I want no of su…