Data Transformation Engine Services Guide

Chapter 19 – Advanced Topics for Mercator Command Server Adapters
112
is the maximum number of messages that the adapter will return across all bursts. If not
specified it defaults to 1. –QTY S means return as many messages as exist on the queue.
-LSN
is the maximum time the adapter will wait to get messages per burst. If not specified it
defaults to infinity. -LSN should be the time that the adapter waits per burst. Therefore,
if the resource’s ‘Get’ API has a timeout parameter, it should be decremented as each
message is fetched. For example, say the adapter is called with –LSN 10, the first ‘Get’
call will be with a timeout of 10 seconds. If a message arrives after 3 seconds, then the
timeout on the second call to ‘Get’ should be set to 7 seconds (10 – 3 = 7). This
continues until timeout is down to 0, at which point the job is done.
There is one complication to this algorithm. If a small timeout is specified (for example,
–LSN 1) and a high FetchUnit (for example, 100), and there are many input objects
available to fetch (for example, many messages on the input queue) it may not be
possible to physically get all those input objects in the timeout period. In such a scenario,
the time to execute the API call that actually gets an object should be discounted. The
result would be that the overall time to execute may exceed the LSN time, but this is not
unreasonable. To achieve this may require that you determine a threshold time below
which the ‘get’ call is considered to have not waited at all, and it’s elapsed time should
therefore be considered as 0. For example:
if (tElapsed < 0.1)
tElapsed = 0;
‘-LSN 0’ is a valid option which means do not wait at all. If there is no input available
then the input adapter should not wait at all for more input.
FetchUnit
The maximum number of messages that will be passed to Mercator Command Server
in a single burst. It defaults to ‘S (meaning all available messages). If ‘S’ in the user
interface, the value is passed as 0 in the uFetchUnit variable in EXITPARAM, so the
adapter must handle this 0 value as a special case.
An adapter get call will get messages until either the LSN time has expired or until QTY
messages have been received.
Note the following rules regarding these parameters:
Burst Mode
For each burst, the adapter will get up to uFetchUnit messages. It will wait up to LSN
time for each burst. Once QTY messages have been received, no more are returned.
Integral Mode (non-burst mode)
The adapter will get up to QTY messages, but only uFetchUnit of these will be passed to
the Engine. Hence if QTY > uFetchUnit some messages may be deleted from the queue
but not processed. If this occurs, a warning message should be returned.