I have a Spring application that starts a REST service:
ServiceManager.startService();
When I am debugging this application in IntelliJ IDEA, however, it seems that when any thread reaches a breakpoint, not only that thread but also the service's thread is stopped. I would like to know whether I can start this service method in some way so that it continues to run when other threads stop at breakpoints.
I currently start the service as follows:
Runnable task = () -> {
ServiceManager.startService();
};
task.run();
//breakpoint here
doSomeStuff();
I put a breakpoint in the doSomeStuff()
method, and when the debugger stops at that that line the console displays that service started successfully.
If at that point I send a request to the service via postman, however, the response is not delivered until I continue execution past the breakpoint.
As far as I know, this is a concurrency problem, and I would like to know if is it possible to run my service in a different way so that the Service is not stopped when another thread reaches a breakpoint during debugging.
The method ServiceManager.startService()
is an implementation to starts a simple rest endpoint using Spring Framework.