Sun Java System Messaging Server 6 2005Q4 MTA Developer's Reference

Description

The mtaDequeueStart() routine initiates processing of messages queued to a specific channel. By default, the channel serviced will be determined from the PMDF_CHANNEL environment variable. However, a channel name can be explicitly specified with the MTA_CHANNEL item code.

All of the item codes, their additional arguments, and a description of each are included in the table that follows.

Item Codes  

Additional Arguments  

Description  

MTA_CHANNEL

const char *channel

size_t channel_len

Explicitly specify the name of the channel name to perform dequeue processing for. This item code must be followed by two additional call arguments: the name of the channel and the length in bytes of that channel name. If a value of zero is passed for the length, then the channel name must be NULL terminated. 

When this item code is not specified, the name of the channel to process queued messages for is taken from the PMDF_CHANNEL environment variable.

MTA_ITEM_LIST

mta_item_list_t *item_list

Specify a pointer to an item list array. The item list array must be terminated with a final array entry with an item code value of zero. For further information on item list usage, see Item Codes and Item Lists.

MTA_JBC_MAX_ATTEMPTS

size_t attempts

Specify the maximum number of contiguous attempts that will be made to sleep and then re-query the Job Controller for work after being told by the Job Controller that there are no more messages to process. The default value for this setting is 5 attempts. If an attempt succeeds in providing additional work, the count of attempts is reset to zero. (The duration of each sleep may be specified with the MTA_JBC_RETRY_INTERVAL item code.)

This item code must be followed by an additional argument: the maximum number of contiguous attempts to make. 

MTA_JBC_RETRY_INTERVAL

size_t seconds

Set the number of seconds mtaDequeueMessage() sleeps before again querying the Job Controller for additional work. When not specified, a value of 10 seconds is used. This item code must be followed by one additional argument: the number of seconds to sleep for.

MTA_THREAD_MAX_THREADS

size_t threads

Specify the maximum number of processing threads to run concurrently. If not specified, then a limit of 20 threads is assumed.

This item code must be followed by one additional argument: the maximum number of concurrent threads to permit. 

MTA_THREAD_STACK_SIZE

size_t bytes

By default, the processing threads will have a stack whose size is sufficient for MTA SDK operations. This is the size returned by the mtaStackSize() routine. To request a larger size, use this item code to specify the desired size. Note that specification of a smaller size is ignored: mtaDequeueMessage() will never use a stack size smaller than that returned by mtaStackSize().

This item code must be followed by one additional argument: the minimum size in bytes for each thread’s stack. 

MTA_THREAD_MAX_MESSAGES

size_t messages

The number of messages to allocate per processing thread. The channel program will aim to run N processing threads where N is computed as follows: N = (count of pending queued messages) / MTA_THREAD_MAX_MESSAGES. For example, if there are 100 queued messages and MTA_THREAD_MAX_MESSAGES has its default value of 20 messages, then 5 processing threads are started.

This value does not control the total number of messages presented to a single processing thread. 

This item code must be followed by one additional argument: the number of messages for each processing thread. 

MTA_THREAD_WAIT_TIMEOUT

size_t seconds

Once mtaDequeueMessage() determines that there are no more messages to process, it waits for all processing threads to complete their work and exit. By default, mtaDequeueMessage() will wait no longer than 1800 seconds (30 minutes).

This item code must be followed by one additional argument: the maximum number of seconds to wait.