/
NUTRINTG (3) File Decrypter (DEPRECATED/OUTDATED DOCUMENTATION)

NUTRINTG (3) File Decrypter (DEPRECATED/OUTDATED DOCUMENTATION)

File Decrypter is a generic service responsible for decrypting files. Following there is a high level overview:

Main process steps

  1. Process polls for messages with fixed interval (process.fixed-delay)

  2. All files listed in the inbound message are decrypted separately

  3. After each file successful decryption the information is stored in DecryptedFileRepository to omit processing two times the same file. Output file name is determined from the original file name - the last extension is removed (in example above .pgp will be removed). The output directory is calculated based on aws.s3.outbound-path-suffix and original file directory. If the suffix is empty the result is stored in the same directory as the original file, otherwise it is stored in the folder with name from aws.s3.outbound-path-suffix inside the original file directory.

  4. If all files are decrypted correctly the result message is sent to the next response queue (aws.sqs.outbound-fifo-queue-url)

  5. The ProcessedDelta information is stored in the database (to omit processing two times the same delta)

  6. Lastly the message from the inbound queue is deleted and the result email is sent.

Spring integration channels graph and error handling

Below there is presented a channel graph of the file-decrypter:

 

Processing the message

  1. The received message is split (for each file listed in the inbound message the new one is created)

  2. All messages are processed in Processing Channel (each brand has only one output file)

  3. All messages are aggregated in AggregatorChannel and sent as one aggregated result to the result channel where the ProcessingDelta is saved, Inbound queue message is removed and successful email is sent.

Error handling

It is worth to notice that there are two more channels in the message channel graph:

  • General Error Channel - responsible for handling exceptions in the main flow, it sends email message with the details of the exception (ex. JSON format exception after receiving the message)

  • Aggregation Compensation Channel - handles all errors occurred in processing the one split message. The channel is responsible for sending the compensation message to the aggregation channel. It is required because all messages that were produced in the 1) Splitter have to be received all in aggregation channel to proceed the aggregation operation (ex. one upload failed). It is because split step produces messages which contains correlationIdsequenceNumbersequenceSize headers and aggregator handler triggers only if all sequence messages are collected. The compensation channel gets the original message headers and adds it to the error message.

Most important properties

Property

Description

Example

Property

Description

Example

process.fixed-delay

Polling interval in millis

10000

aws.s3.outbound-path-suffix

When left blank, the decrypted file is stored in the same directory as the original file. Otherwise, it is stored in folder with name form property in the original file directory.

decrypted

process.delta-interval-in-days

Interval in which we expect to receive full delta. It is required to preserve order of delta messages and it should be set to the same value as in file-set-analyzer service.

1

process.decryption-thread-pool-size

Number of parallel decryption threads

2