I have written one aspect around a service class. In the aspect, I am doing some operation in the before section, which I would like to be rolled back if some exception occurs in the enclosed service method. The service class is as follows: The aspect is as follows: I am seeing an exception in the service met…
Tag: spring-boot
Send an response 200 from a Spring boot controller for asyncronus processing
I have a scenario: I’ve a controller. My controller is calling the service class.Service class will fetch all the records from data base and post it to kafka.But I don’t want my client who is calling the api to wait till the entire data is posted to kafka. I want it to do in a asynchronous way. Cl…
Error Creating Bean Error (Spring Cloud Config Client)
I am trying to learn Spring Cloud Config. So first I setup a Server, where I can fetch the properties using http://localhost:9090/config/default/master/app.static.properties on the browser. It has about 5 or 6 properties. I am trying to get just one for now. I wrote my classes like: and My bootstrap.propertie…
Where to put the bean logic creation into a simple Spring Boot application? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. Improve this question it is pretty long time that I am not using Java technologies and I hav…
findAll not fetching OnetoMany fields values in Spring JPA
I am working on a Spring Boot app and I am using a OneToMany annotation to have nested object list inside my another entity object. But while fetching the data that I posted using JPA,while using findAll the OneToMany field is getting returned null. I am able to post the data and its sucessfully creating the …
Connecting Spring boot application with postgresql problem with properties
I wanted to connect my application from spring boot with postgresql running in docker I am doing everything according to this tutorial – https://www.youtube.com/watch?v=8fbfHu8isI4&t=1452s , but I keep getting the same error: Error starting ApplicationContext. To display the conditions report re-run…
Can’t register Gson TypeAdapter in Spring Boot
I have been trying to add custom serialization of my Version class in RestComponent: Json output I expect: not So I decide to use JsonSerializer and JsonDeserializer interfaces, also tried TypeAdapter. I’ve created a Gson Bean in my MVC configuration class, also tried to create GsonBuilder bean. In appl…
Spring WebClient Retry Logic with new Headers
I am trying to build a retry logic using Spring WebClient. The problem that I am trying to solve is very simple. I am calling an API endpoint to get some values. If the API returns an error with say 401 response, then I will have to make call to Token service and renew my token and use the new
Strange error with WebFlux and Spring-Integration – IndexOutOfBoundsException exceeds maxCapacity
I am in the process of writing a spring-integration flow that is intended to enrich the headers of a message based on the determination if a remote resource actually exists. Assuming that there is a RESTful endpoint that has an API on it that will locate an object based on a unique name: /mix-entity/name/{mix…
Spring data rest resource inconsistently ‘discovered’ after restart
I’m using Spring Data Rest to expose rest endpoints which i can use in my user interface. However, during testing I noticed that when hitting the base rest url (http://localhost:8080/rest) , the endpoints are inconsistently exposed. I’m using the Annotation based RepositoryDetectionStrategies. I w…