Configuring Work managers for one-way operations
You can configure Work managers for one-way operations. In the product, Work manager configuration is supported only at the component service level. This capability is supported for default and web services binding.
Before you begin
Asynchronous service dispatches run on a different thread than the service invoker. The thread pool that services these dispatches must be configurable so that the service thread pool can be adjusted, based on workload variations or some other policy. The application server has configurable thread pools, called Work managers, that can be used as the means for providing an asynchronous thread pool to an SCA service.
This topic applies to non-blocking (one-way) operations only. The Java™ composite definition (.composite file) for the component service that has the one-way operation, enabling the Work manager to be configured independently.
Specifying one Work manager for each component service is optional. If you do not specify a Work manager component service that has the one-way operation, the runtime environment uses a default Work manager that is configured at the server, node, or cell level.
- Work manager configuration is supported only at the component service level.
- This feature is supported for default and web services bindings.
Procedure
Results
Service operation dispatches occur in the thread pool of the configured Work manager.
Example
- Sample OSOA composite definition with Work manager configuration
- In this sample, the first component runs with the configured Work
manager, which has JNDI name
sca/test2
. The second component does not have a Work manager setting, even though it is one-way; thus, the second component runs with the default Work manager, which is configured at a server, node, or cell level. The third component runs with its Work manager with JNDI namesca/test4
.<?xml version="1.0" encoding="UTF-8"?> <composite xmlns="https://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://samples.myco.com/oneway" xmlns:wm="https://www.ibm.com/xmlns/prod/websphere/sca/1.0/2007/06" name="Composite_2"> <component name="Component_2"> <service name="Component_2"> <wm:workManager value="sca/test2"/> </service> <implementation.java class="test.sca.binding.sca.oneway.Component_2Impl"/> <reference name="component_3" target="Component_3"/> </component> <component name="Component_3"> <implementation.java class="test.sca.binding.sca.oneway.Component_3Impl"/> <reference name="component_4" target="Component_4"/> </component> <component name="Component_4"> <service name="Component_4"> <wm:workManager value="sca/test4"/> </service> <implementation.java class="test.sca.binding.sca.oneway.Component_4Impl"/> </component> </composite>
- Sample service interface with one-way operation
import org.osoa.sca.annotations.OneWay; import org.osoa.sca.annotations.Remotable; @Remotable public interface Component_2 { @OneWay public void test(Message inputText); }