Skip to content
Advertisement

Tag: spring

Time Elapsed for Mono Webflux

I am calling a post endpoint that returns a Void. I am trying to get the time elapsed. It seems it is not calling an endpoint. doOnSuccess is also not getting called. Answer elapsed() measures the time between when the Mono is subscribed to and the moment the Mono emits an item. But, Mono<Void> response doesn’t emit any value. You

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: The preceding code is

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 sure isRunning() returns false initially then only start()

Mongo DB Aggregation with Count for Specific Conditions and filter by Date Range which Outputs a Projection Doesn’t work as Expected

Please consider that I’m a beginner to MongoDB and I need to retrieve data from MongoDB database in somewhat complex query format. I’ve referred several Questions and Answers published in the community but my expected query was much complex due to some complex counts operations for certain conditions etc. However I was able manage to retrieve the data to a

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 with multiple addresses like 127.0.0.1, 127.0.0.2 a) Is this possible to have multiple address

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 XML file that will contain all configs. inside the XML file:-

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/BusinessCustomersStatus.java But when I make a POST request to add a new record I get this error: Note that I have changed TicketStatus with BusinessCustomersStatus into the error stack. When I make

Advertisement