Skip to content

Tag: spring

How to add a field from body to a condition

I use the @StreamListener annotation to listen to the topic. How can I add a field from body to the condition? An example of an entity that is sent to the topic: Answer As you can see from version 3.0, you should avoid using filtering based on the message payload. Notice these lines from the documentation: Th…

Spring SmartLifecycle start() method not executed

In my spring app I have a thread pool manager that during start() creates some threads and add those to the pool. But while running the start() method is never executed. Any help will be really appreciated. Answer This is for someone facing similar problem. isRunning() is called before start() therefore make …

Multiple application on single PC

I have installed Tomcat server on my server PC with IP 127.0.0.1 One application is running on the server. Let address of the application is: 127.0.0.1:8080/first-project Now if I want to run another application on the same server, address will be: 127.0.0.1:8080/second-project I want multiple application wit…

Can We Have Multiple Spring Configuration Files in One Project?

Can We Have Multiple Spring Configuration Files in One Project? If yes, can someone provide a working example to support this concept? Answer Yes, in large projects, having multiple Spring configurations increase maintainability and modularity. You can load multiple files like this:- You can also upload one X…

Fetched Date is setting incorrectly

So for example I save Date to database: And it is saved to database as this date for example 2021-09-01. Then I fetch this date and add two day for example and it should be 2021-09-03. This is the code: But the result I get is not the correct I want, because I get this: is should be How I

Multiple ‘as-value’ properties defined

I want to create a ENUM which holds different statuses for possible database values and use them also to generate possible drop down statuses in FE: Full code: https://github.com/rcbandit111/Search_specification_POC/blob/main/src/main/java/org/merchant/database/service/businesscustomers/BusinessCustomersStatu…