Skip to content
Advertisement

Tag: spring

HiveMQ Java library fails to automatically reconnect to broker

I’m using the HiveMQ library in my Java Spring application to connect to a Mosquitto instance as I find it more user-friendly compared to the Paho client. But something is going wrong with the automatic reconnection. From time to time the connection is lost and the application doesn’t succeed in reconnecting (see logs 1). This can also be triggered by

Spring boot – Snowflake JDBC – Alter session automatically when application loads

I’m trying to connect Snowflake to Spring boot based application. Everything works well however due to some crazy defaults in snowflake, I’m having to deal with the below error: https://community.snowflake.com/s/article/SAP-BW-Java-lang-NoClassDefFoundError-for-Apache-arrow I can fire the queries via Spring data JPA but not able to map the results at all. The solution asks for changing the default resultset format from ARROW to

Getting Exceptions while running a Spring boot app with elasticsearch

I was following this tutorial: https://www.youtube.com/watch?v=IiZZAu2Qtp0&ab_channel=LiliumCode and the only changes I made were that I was using maven with eclipse instead. The rest of the code is exactly the same. When I run the app I get: My elasticsearch.yml: I have tried out searching the exceptions online but nothing seems to work. Please help me in figuring this out. Thank

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 firstly, i did through

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 defaultExpression.

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 exist (clocks

Advertisement