Skip to content
Advertisement

Tag: spring-boot

Spring boot Mongo DB .yml configuration

When I use MySQL and hibernate for spring boot, I use below configuration in .yml file If it is mongoDB instead of MySQL and hibernate how does it change? Answer The mongodb properties are all prefixed with spring.data.mongodb. For user property you would use The list of available mongodb properties are here: You can find them at source for how

Dynamically add property sources to SpringBootTest

Similar to Springboot unit test set @Configuration Properties dynamically but the context is different. In my case I have a TestContainer running a custom MySQL database that is prepopulated with a lot of data (not using the SQL batch loading approach because the data is an anonymized copy of production and doing it through SQLs makes the boot up time

Attribute ServerContainer not found in ServletContext

In my Spring boot application i use also websockets. Everything works fine, as expected in production. Now i started to create UnitTests with Spring-Boot-Test. Every time i start a @SpringBootTest , i get following exception (shortened): Long Version Spring Websocket Config Class POM.XML Spring Application Class Typical Failing Test Problem The Problem is, the actual Test never comes to the

Spring Boot graceful shutdown

I am developing a Spring Boot application backed by embedded Tomcat and I need to develop a graceful shutdown with the following steps: stop processing new HTTP requests (stop web container) process all already accepted requests shutdown Spring ApplicationContext *do the steps above sequentially (one by one) How can I achieve this? P.S. Spring Boot 1.5.20.RELEASE, Java 8 Answer I

Route order in Spring Cloud Gateway

We are implementing routes programmatically using a implementation of RouteDefinitionLocator. We have two services which should register at the same route path, where one of them is meant as a fallback if the other one does not exist. The preferred route with the specific path is: And the more general one, which should only fire if other route was found:

Display images dynamically using jquery and thymeleaf

I am trying to display image dynamically by using jquery append function with thymeleaf as view engine in spring boot Here is the way that I tried to append the image to div (‘.show-image’): However, it only shows the empty images (no 404 error) I tried with other random online image and works: When I statically display the image also

Advertisement