Resending With Archeo
Resending with Archeo behaves differently based upon the event type you react to. Only one of the two event types are enabled at present which means that CX supports only one type of Archeo-resending mechanism. We will describe both of them here, the non-active methods will be marked. If you need to use non-active methods, please contact us for more information.
Stateless resending
By stateless resending we mean the process of resending a message from the beginning of the pipeline. This is really just a way to access any CX pipeline via an Api entry point. The endpoint used for stateless resending is hosted in the CX Api in the same way as the Api adapter in the resend/archeo/restart
Uri. We currently support the Archeo contract for resending only. This does not disqualify other systems from using the resending, they just have to conform to the Archeo contract which looks like this:
public class ArcheoResendEventRequest
{
public string TransactionId { get; set; }
public string ContentSasUri { get; set; }
public string ResendDateTime { get; set; }
public ArcheoLogStepMetaData LogStepMetaData { get; set; }
}
public class ArcheoLogStepMetaData
{
public string TransactionId { get; set; }
public string Description { get; set; }
public string TransactionTypeName { get; set; }
public string MessageTypeName { get; set; }
public string SenderName { get; set; }
public string RecieverName { get; set; }
public string StatusName { get; set; }
public string FileName { get; set; }
public DateTime Processed { get; set; }
public Dictionary<string, string> Metadata { get; set; }
}
If you use the Archeo resending functionality all these fields are set and handled for you. If you want to use another system to pass resending requests to CX you need to fill out at least three fields:
ArcheoResendEventRequest.TransactionId
which represents the InterchangeId of the message. This should be set to the same id as the original message.ArcheoResendEventRequest.LogStepMetaData.Metadata["ConfigCorrelatioId"]
which describes the integration configuration to use when inflating the pipeline.ArcheoResendEventRequest.ContentSasUri
which points to the message content SAS uri or hosted endpoint.
As log as these three properties are set the resending event should restart the pipeline and keep logging to the same InterchangeId.
If you use Archeo as the resending provider you do not need to set these properties manually as they are handled by Archeo when you set up a resending webhook.
This concludes the description and tutorial for stateless resending. To summarize all you need to do to resend with this method is to create a Api request that contains a message Uri (presumably provided by the log event framework from CX and saved by your logging provider), an InterchangeId and a CorrelationId.
Stateful resending
This functionality is in development. Read more on the functionality page.
Stateful resending refers to the process of re-inserting a message into the CX pipeline at the point of failure. This process is facilitated by a component within CX that performs draining of stopped messages within CX. Currently this process is developed but is non-active, which means that the required Resendable events are not generated by the CX platform.
To resend a message with stateful resending you need to provide CX with a more detailed version of the ArcheoResendEventRequest
that contains encoded data which refers to the messages passed between engines within CX itself. Since this data is impossible to recreate outside CX you need the provided Resendable events to be able to use stateful resending.
When a Resendable event is received in your provider of choice you can map the event to the inbound model defined on the resend/archeo
endpoint and restart the pipeline. Including the fields required for the stateless resending process you also need to fill the following field:
ArcheoResendEventRequest.LogStepMetaData.Metadata["OriginalSbMessage"]
which should contain the encoded version of the internal queuing information supplied by the resendable event.
Resend Events
Resend events or "Resendable events" (defined by the Resendable status) are events generated within the stateful resend process. They are defined by one of two contracts. the first one is tailored to the Archeo ecosystem while the send is the contract used by CX internally to define the events. We do not recommend using the internal contract at present as this functionality is still in development. The contracts are as follows:
Archeo
public class ArcheoLogStep
{
public string TransactionId { get; set; }
public string TransactionType { get; set; }
public string MessageType { get; set; }
public string TransactionTag { get; set; }
public DateTime Processed { get; set; }
public string Sender { get; set; }
public string Receiver { get; set; }
public string Description { get; set; }
public string FileName { get; set; }
public string Status { get; set; }
public byte[] BodyContent { get; set; }
public IDictionary<string, string> Metadata { get; set; }
}
Internal
public class ResendEvent
{
public string InterchangeId { get; set; }
public byte[] EventContent { get; set; }
public string EventContentUri { get; set; }
public string QueueDrainingConfigId { get; set; }
public string TopicName { get; set; }
public string DlqPath { get; set; }
public string Reason { get; set; }
public string Filename { get; set; }
public DateTime? EnqueueTime { get; set; }
public string OriginalSbMessage { get; set; }
}