Minimizing inbound and outbound JVMs

Many different Java threads each doing a small amount of tasks have been created. Although good for illustrating distinct concepts, it creates many JVM instances which can each use a significant amount of system resources. To minimize resource consumption, you can opt to combine conceptually separate Java programs to run under one JVM.

To do this, the doStart method can start a few server programs. You can also combine a MessageServer type thread with a RequestServer thread. When messages are sent from a Java thread with different processing requirements, you can assign a different TRXID to each message type before it is sent into the engine. Then, using normal system routing, you can send the raw or translated message to whatever outbound thread is required.

Outbound threads can similarly be combined using driver control. Before the message reaches a multiplexing outbound thread, various driver control strings can be set on the messages. The outbound Java thread can examine the driver control to determine which class to invoke to handle the message.

For example, some messages might be destined for a web service endpoint or some messages might be going to an Enterprise Service Bus.