The problem that I have encountered several times in my career is the multilevel service architecture, when one downstream system can bring down the entire client application if it falls into a state where all its threads are consumed in a dead end or in some form of an endless loopback error in this system. Under these conditions, the server socket on the Java EE server still accepts requests and queued requests from client applications. This forces the client application to use all its threads, waiting for responses from properly established socket connections. Then all users are blocked from the system, as their requests are also in the queue.
I thought of a few solutions, but I was wondering if the community has some of the best.
Isolated thread pools for subsequent requests. This becomes a problem because you combine the number of unallocated threads on your system, creating many small pools that need to have enough threads to ensure full throughput. Spawning threads means you need to deal with transaction and security contexts yourself. Not really supported Java EE solution.
The MDB solution, the preferred asynchronous solution for Java EE, however, it looks rather heavy, but has the added advantage of allowing the application server to manage MDB thread pool management. (Currently number one on my list)
ESB This is even heavier weight and adds more time to the network and processing. But it allows you to set individual service timeouts. In addition, the problem is that it will take forever to infiltrate a large corporation, so itβs probably not practical for my time frame.
Do you guys have any better ideas?
source share