I'm implementing a data processing software. The software gets form the network thousands of events that must be processed in according to rules. I implemented a multi-thread service, which receives the event and insert it into the processing engine.
This means, each incoming event creates a new runnable task and return the control to the main thread. The secondary thread insert the data and dies, which is just some seconds.
This methodology creates lots of threads (between 150 to 260), and I got "complaints" that this is not the right way to do it. I should then limit the threads to 5 or 10. For me the way I implemented is the usual way. Then my questions are:
Should I limit the threads?
Is there a established "right way" to do this kind of stuff?
Note: the threads currently are being created in a Java thread pool: