Web Service Multithread

The Web Service Multithread component is designed to work with the Web Service Multithread Worker to enable parallel processing of requests. These components have two distinct roles:

  • Web Service Multithread is the dispatcher component which listens for requests and sends it to the worker component for parallel processing using component.call.

  • Web Service Multithread Worker component handles the actual processing of the data dispatched by the Web Service Multithread component.

Running the Components:

Using +COMPONENT, import two components:

  • Web Service Multithread

  • Web Service Multithread Worker

The two components are configured to work together by default without configuration required. However, the custom fields can be configured as needed:

Web Service Multithread:

  • WorkerComponent: The target multithreaded worker component

  • Port: The web service port. Change if the default port, 7778, is already in use.

  • UseHTTPS: Default is set to true to enable HTTPS. For production, you should configure Iguana to use your own Certificate and PrivateKey files.

Web Service Multithread Worker:

  • ServerComponent: The web service component which will dispatch requests to the worker.

  • ThreadCount: Number of processing threads. Can be set as a number from 2 to 100.

For more information on adapting the worker component, see Web Service Multithread Worker.

You can use any mechanism to send HTTP requests to the Web Service Multithread component configured endpoint - default is http://localhost:7778/. If your Iguana instance is running remotely you can use the public IP address.

If you want to use Iguana as the test source system to create a data feed, you can use the following simple setup:

  1. Create two custom components named “Source Feed 1“ and “Source Feed 2“

  2. Copy the script below into each of the component Translator to send an HTTP GET Request to the Web Service Multithread component.

function main(Data) net.http.get{url="http://127.0.0.1:7778"} end

First start your Web Service Multithread and Web Service Multithread Worker components. Then use Bulk Actions to start the two Source Feed components at the same time.

Go to the logs of the Web Service Multithread Worker component and view the logged GET requests. Notice the ifw_conn_id value added set in the header of the request. This value is used to identify the specific connection or session associated with the request. You should see different connection ids to indicate multiple connection threads being used by your worker.

 

 

Related pages