Skip to content

message.retryDestination

Signature: message.retryDestination()

Returns: void

Record a failed send attempt from a Destination Custom Script's own retry loop -- call it from your catch block after each failed send. When the destination's "Error message after x consecutive send errors" limit is configured, the message is sent to the error queue once that many consecutive failures are recorded (a limit of 3 allows 3 send attempts). When no limit is configured the count is simply incremented and your script must bound its own loop.

Note

Only available in a Destination Custom Script.

Note

This method only applies to the following formatted messages: HL7, ASTM, Binary, CSV, DICOM, EDIFACT, Old Fxd Width, Fxd Length, ISO 8583, JSON, Text, X12, XML.

Parameters

None

Example

// Example: retry a destination send in a Destination Custom Script,
// giving up once the configured "Error message after x consecutive
// send errors" limit is reached.

var sent = false;
while (!sent) {
    try {
        // Replace with your real delivery to the external system.
        sent = true;                 // success -> stop retrying
    } catch (e) {
        // Records the failed attempt.  Once the configured limit is
        // reached, QIE errors the message to the error queue.
        message.retryDestination();
    }
}