Deliver mode is used to get information from the transport and deliver it to the application. The deliverData() function assumes that the data in the transport is a serialized data tree: either a serialized NCF format or a serialized XML format. The deliverBuffer() function receives raw data from the Adapter Shell as it existed on the transport. Deliver mode requires .ncm files to deserialize between the transport and the Adapter Shell.
When the user code processes the request, the return option is either TRUE or FALSE. TRUE tells the adapter plug-in to keep calling deliverData() or deliverBuffer() if data exists to process, and FALSE tells the adapter plug-in to stop calling deliverData() or deliverBuffer() and to shutdown. After processing all of its requests, the Adapter Shell calls the shutdownAdapter() function, cleans up, and then exits.
If the exit_if_empty key is set to TRUE and no message is found when the transport is read, the loop for Deliver mode terminates. If Deliver is retrieving a message from a transport using NCF Serializer, the message must have the OPT_MSG_TYPE option set to the format name matching the schema repository file.
If the adapter plug-in has an error, the Adapter Shell puts the message received to the failure transport. It then determines the severity of the error. For a critical error, the adapter shuts down. For a retry error, the adapter retries the specified number of times entered in the configuration file and then shuts down. Otherwise, processing continues with the next message. For additional information about critical and non-critical errors, see “Handling Exceptions”.
Batch Deliver is new functionality provided by the e-ADK 3.9. Batch Deliver allows the adapter to receive multiple messages before committing the messages as a single transaction. Batch Deliver functionality is selected by setting the configuration key Adapter.batch.size to an integer greater than 1. The e-ADK delivers the specified number of messages to the adapter before it calls the commitDeliverMessages() function in the adapter. The adapter returns one of three states to the e-ADK:
Commit the messages and continue
Rollback the messages and continue
Rollback the messages and shut down
Based on the return parameter, the e-ADK responds accordingly.
The Adapter Shell running in Deliver mode calls an adapter plug-in. It can then deliver data to the application from the transport. Deliver mode can be run with two different types of data: tree (NDO) or buffer. If using an NDO, the message type is used to look up the metadata in the NDORepository. Not all schema information is kept in the wire format to keep the formats cleaner.
Batch Deliver mode has an additional configuration key: Adapter.batch.timeout. This key is the maximum number of times in seconds that a batch can process before initiating the commit function in the adapter. Setting the key to 0 results in no timeout for batches. The default setting is 0.