The Thread Manager and the message service

If you are using threads to implement a provider/consumer algorithm, or an asynchronous notification system, consider using the EAServer message service implementation described in Chapter 31, “Using the Message Service.” The message service provides a ready-made infrastructure for solving these classes of problems. The message service uses the Thread Manager in its own implementation.

Using the scheduling facilities provided by the message service, you can restrict background processing to a server’s off-peak hours. For example, you may have threads running that index the text content of a Web site. Using a scheduled component and the Thread Manager, you can suspend processing at the beginning of the server’s peak use period, then resume processing at the end. “Subscribing to scheduled messages” describes how to subscribe to scheduled topics in the message service.