Sample project that is used for specific data extraction from files.
Project contains two microservices.
DocumentService- receives files and stores dataProcessingService- processes files received from DocumentService and sends information back.
Communication between services is done via RabbitMq.
- GET
/documents/{documentId}-> get single document - POST:
/documents/upload-> upload document
- Document service collects files via POST endpoint, checks validity and stores locally files, saves path to file in database(along with status of processing) and sends a message with file path to the processing queue.
- Processing service listens for the messages on processing queue. When message arrives, Processing Service will check the file path from the message, collect the file and process it (extract data like: price, tax, item id, etc, word is of dummy data)
- Processing service sends successfully processed data to the completed queue. In case of process fail, message will be sent to failed queue. In case of inability to read a message, processing service will forward it to dead queue.
- Document Service listens to the completed and failed queue. Based from which queue message appears, Document Service will update existing document in database.
Example of supported files and files that contain valid data, can be found in this directory.
- Download and install Docker
- Check out the repository
- Navigate to the project directory and execute the following command:
docker compose up