WebSphere Message Brokers
File: as07520_
Writer: Lorraine Waitt

Reference topic

This build: July 31, 2007 21:37:15

cniDispatchThread

This function dispatches a new message flow thread to invoke another thread instance to run the user-defined message flow input node. This message flow thread is allocated from a pool of threads maintained for each message flow, under control of the Additional Instances property of the message flow. If there are no threads available because they are all in use, CCI_SUCCESS is returned and returnCode is set to CCI_NO_THREADS_AVAILABLE. This is not an error, but means one of the following:
  • The message flow was not configured to run with additional threads.
  • All additional threads configured are currently running.

The cniDispatchThread function can only be issued from an input node. If it is issued at any other time, CCI_FAILURE is returned and returnCode is set to CCI_INV_NODE_ENV.

Syntax

int cniDispatchThread(
  int*        returnCode,
  CciNode*    nodeObject);

Parameters

returnCode
The return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_NO_THREADS_AVAILABLE
  • CCI_INV_NODE_OBJECT
  • CCI_INV_NODE_ENV
nodeObject
The address of the node object that is run when WebSphere Message Broker creates or reuses the thread. This is passed to the node when its cniCreateNodeContext implementation function is invoked (input).

Return values

  • If a thread was successfully allocated, CCI_SUCCESS is returned and returnCode is set to CCI_SUCCESS.
  • If a thread could not be dispatched because there were insufficient threads in the message flow thread pool to satisfy the request, CCI_SUCCESS is returned, and returnCode is set to CCI_NO_THREADS_AVAILABLE.
  • If the function was not issued from within an input node, CCI_FAILURE is returned and returnCode is set to CCI_INV_NODE_ENV.
  • For any other error conditions, CCI_FAILURE is returned, and returnCode indicates the reason for the error.

Example

  cniDispatchThread(&rcDispatch, ((NODE_CONTEXT_ST *)context)->nodeObject);
Related concepts
User-defined input nodes
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:37:15

as07520_ This topic's URL is: