I am using java 9 modules to implement provider , i have multiple providers for service interface. I want to provide some priority for providers for their execution insted of using findFirst(); I have service-interface modules as below , ServiceInterface.Java module-info.java I have provider-module which has …
Tag: spring-boot
Unable to generate interface with openapi-generator-gradle-plugin
I’m trying to generate models and controller interfaces with openapi-generator-gradle-plugin. The problem I’m having is that the plugin in generating classes instead of interfaces. A generated class looks like this: While I’m trying to generate an interface, so that I can implement it in my …
How to emit filtered out error if flux is empty
I have synchronous code that I want to make non-blocking with reactor. I want to call in parallel different URI, the calls can return a response, an error or nothing. There are 3 cases: A request returns a response, I return it without waiting for the other requests to complete. If other requests returned err…
Spring MVC POST request with dto that contains multipart files and other dtos
I have a DTO that contains other DTOs and a list of multipart files. I am trying to process that DTO but I can’t seem to be able to read the requst. When creating an example request from Swagger UI, I get the following exception: If I put @RequestBody instead of @ModelAttribute then I get Swagger depend…
Upgrade to springboot 2.6.1 with querydsl jpa 5.0.0
I am trying to upgrade my springboot version from 2.3.4 to 2.6.1. I use query dsl with jpa and apt-maven-plugin. My issue is that I can’t no more generate the QClasses when I run maven compile. I noticed that I am no more able to use an older version of querydsl (previous one 4.4.0 and apt-maven-plugin …
Data from test with @Transactional are persisting between tests
I have a small problem. I have started writing tests for my small project. The project uses SpringBoot, standard JpaRepository from Spring, as a testing framework I am using Spock and for testing the database, I’m using PostgreSQL container from TestContainers. The problem is, that data between tests is…
How to configure JmsMessagingTemplate to use MappingJackson2MessageConverter
I am looking at using JmsMessagingTemplate instead of JmsTemplate because I would like to use convertSendAndReceive. The messages should be send in JSON format. I am having difficulties convincing JmsMessagingTemplate to use MappingJackson2MessageConverter instead of the SimpleMessageConverter. The documentat…
Does a response containing multiple json Values always have to be wrapped in an array in java?
I am trying to return a response from the back end using java where the response is a list of json values. Is it possible to return the data in this format? I noticed that json values are always returned wrapped in an array like this I was asked to return the json data without being in an array and
spring rest @RequestBody does not validate with @Valid
I’m learning java and spring boot and I am trying to validate a controller parameter which was bound from json. I’ve got simple Entity: Which I want to persist through the following controller: My understanding is that the resource argument should be valid when entering the method. But posting an …
CommandLineRunner overridden run() method not executing
The problem: overridden run() method from CommandLineRunner class is not being executed. Folder structure: Code: Main class: CommandLineRunner class: As it says in the println() method, this is not printing anything, only this startup logs: There are couple existing questions on this topic on Stackoverflow, b…