Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At the moment LERN Batch Service is connecting to cassandra ‘dialcodes.dialcode_images’ table for fetching QR Code Image URLs and also resolve image BLOB URL which is currently relative path. Ideally this information should be fetched from DIAL service owned by Knowlg BB as this keyspace is owned by knowlgBB. Hence, an API is to be developed where an image or multiple QR code Images information can be fetched from DIAL service.

...

Design

To resolve above problem,

Solution 1: New API can be published in DIAL Service ({{host}}/api/dialcode/v2/image/list) which will accept request in below format, reads data from cassandra ‘dialcodes.dialcode_images’ table and provides response in below format. Number of QR Codes as input to be controlled via a configuration 'qrimage_request_limit'.

...

Code Block
languagejson
{
    "request": {
        "dialcodes": ["Q1I5I3"]
    }
}

...

Solution 2: Image URL can be updated to Elastic search document of the DIAL code avialable available in ElasticSearch ‘dialcodes’ index when the DIAL code was generated. This can be achieved when the image is generated in the ‘qrcode-image-generator' flink job.

...

Sync Jenkins job should be able to update the DIAL Code document to Elastic Search by reading DIAL code details from ‘dialcode_store.dial_code’ table and imageURL details from 'dialcodes.dialcode_images’ table.

...

End DIAL Search Response:

...

Remove the database connection and connect to knowlg API DIAL Service for the image information in ‘QRCodeDownloadManagementActor.java’. Rest of the code flow (request and response) will remain intact.