Download Sun Java System Messaging Server 6 2005Q1 MTA Developer`s
Transcript
Caller-Supplied Processing Routine 3. For each queued message requiring processing, an execution thread created by mtaDequeueStart() calls the routine whose address was provided in Step 2. Threads created by mtaDequeueStart() each sequentially process multiple messages. That is, mtaDequeueStart() does not create a distinct thread for each and every queued message to be processed. For a list of the tasks the processing routine should do, see “Caller-Supplied Processing Routine” on page 51. NOTE The mtaDequeueStart() routine will use one or more threads, with each thread calling the message processing routine. The maximum number of threads allowed can be set when calling mtaDequeueStart(). Consequently, a program that does not support threading should specify a maximum of one thread when it calls mtaDequeueStart(). For a list of the tasks the processing routine should do, see “Dequeue Message Processing Routine Tasks.” 4. After mtaDequeueStart() returns, deallocate SDK resources and data structures with a call to mtaDone(). Caller-Supplied Processing Routine Channel programs typically perform some form of processing on each message they dequeue. For instance, virus scanning, MMS conversion, decryption, delivery to a proprietary messaging system, and so forth. When using the MTA SDK, channel programs must provide a routine which initiates this processing on a per message basis. That is, programs must supply a routine that to be called to process a single queued message. Throughout the rest of this text, this caller-supplied routine will be referred to as “the caller-supplied processing routine,” or, for short, “the processing routine.” When called by one of the mtaDequeueStart() execution threads, the processing routine uses the SDK to access the message’s envelope, header, and any content. Upon completion of processing, the message is then either removed from the MTA queues, or, in the event of a temporary error, left in its queue for a later processing attempt. Chapter 4 Dequeuing Messages 51