Import to Send Process Flow
References :
Main WebApp controls the CSV File Import Process
Splits the CSV file to batches and creates separate CSV files and importTosendRecords for each batch.
The above data is stored to the Blob Storage folder "importtosenddata" and a queue item gets created in "importtosenddata" queue for the each ImportToSendRecord.
"ImportToSendWebJob" activates from the queue item ("importtosenddata" queue) in above step. This process reads the files created in blob storage and converts the files to a list of destinations and messages. Also creates a record in "SMS Contacts" database and gives each batch a StartDateTime. Each batch is set to run 5 mins after the last batch created.
"TriggerImportToSendBatches" webjob which runs every minute queries the records in "SMS Contacts" for batches due to be sent and creates a queue item in queue "importtosendbatches" queue.
"SendImportToSendBatchesWebJob" is triggered when the queue item is created in "importtosendbatches" queue. It gets the data from "SMSContacts" DB - "ImportToSendBatches" table based on the record id and processes the sending to the recipients creating SMS send batches. This process creates the PMTransDB records for SendMultiple and SendMultipleRecipient and then creates queue in the "smsmessages" queue.
"SendSMSBatchesWebJob" processes the batch of messages, using threading to increase the sending rate and to send each message singly. The main sending is done by the service "SendMessageToRecipient" which uses the IGatewayService interface to send the message via the correct gateway service. MessageHistoryService for saving the message details is also called by the SendMessageToRecipient service.