Skip to main content

Message Loss

Publishing to SyncHive

When a connector makes an HTTP request publishing a data envelope to SyncHive, one of two things happens:

  • SyncHive replies with a success response – the connector can assume that SyncHive has persisted the data envelope.

  • SyncHive replies with an error response (or a timeout) – the connector cannot assume that SyncHive has persisted the data envelope in any way (even in a dead letter queue).

This behaviour dicates that the inbound side of connector be structured in certain ways so as to avoid the possibility of losing messages from the connector's external system.

Suppose data comes into a connector from an external system via a queue, Q:

In this case the connector structure must look as follows:

  M = read a message from Q, without removing M from Q
try
process M creating a document envelope E
send E to SyncHive in an HTTP request
acknowledge M to the Q
catch exception
error M to Q

With this structure M cannot be lost, as one of the following two conditions will be true:

  • the HTTP request to SyncHive has successfully completed, so SyncHive has persisted E, or
  • one of the processing and or sending steps failed, in which case M hasn't been removed from Q, and so can be retried

Similarly when data comes into a connector from an external system via HTTP, the connector structure should look like:

  receive request R
try
process R creating a request G
send G to SyncHive
catch exception
return an HTTP error code