...
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 | ||
---|---|---|
| ||
{ "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.
However, syncing of already generated QR codes’ image URLs has to be done for existing adopters. This requires enhncement enhancement of the DIAL code Sync job.
Sync Jenkins job should accept multiple DIAL codes (comma separated) and upsert their 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.