Skip to content
Advertisement

Tag: spring

Spring Boot scheduled Runnable tasks continue executing even after server is shut down with an actuator

I’m currently developing a Spring-based web platform which makes use of several scheduled processes that access a central database. I wanted to introduce actuators for shutdown and restart. However, I am experiencing an issue: even though the shutdown request is accepted with a 200 response, the application context begins shutting down: And after that, I repeatedly get the following exception:

MapStruct adding 1 suffix to object

I am using mapstruct to map my DTO to entity, My Entity My DTO Generated MapStruct Implementation I tried editing the file but it is unable to create break and always gives break1 Answer Break is a reserved keyboard, use different name or it would always add 1 suffix for successful compilation.

How to search in parent entity scope when using spring boot data rest

Now I know how to findBySomething on root level entity. Let’s say I have a one to many relation of class -> student I can now students/search/findByName?name=Tom But it will give me Tom in all classes. Can I do something like classes/1/students/search/findByName?name=Tom It gives error right now. Answer in StudentController in StudentService in StudentRepository (I use mongoDB; if u use

Advertisement