Skip to content

Tag: spring

How I can turn on and off BlockHound check

I have some App with WebFlux and i want to use BlockHound, but i need to have a possible turn on and off it through parameter in application.properties or through spring profiling or somthing else. Also I want to override action, when the lock operation is caught so that not throw error but log warning. And f…

Mapstruct how to initialize fields

I have a DTO like this and an entity I want to create a mapper to map DTO to entity. How can I make the field private Instant timestamp; has value like Instant.now()? My mapper so far It got compile error Answer The issue is due to the source being empty. Remove the source and use expression instead of defaul…

Handle daylight savings time and representing UTC in Date object

I have a function which returns the current UTC time in Date object, simple. What we do is find current Instant of UTC, put it in Date object and return. Note: Local Host time here is New York/America. The problem we are now facing is that Date refuses to store March 13 2:02 AM, since the time doesn’t e…