Closed yuvrajsab closed 1 year ago
After digging through this i can see that there is already a publisher to publish click events to RMQ and a consumer to consume those events and increment the click count in redis. But for some reason this functionality is currently commented out and instead click-counts are incremented directly as you pointed out. Pushing to queue: https://github.com/Samagra-Development/yaus/blob/3cade479eae5f68c5226cadfeb1647f438b0de11/apps/api/src/app/app.controller.ts#L77C4-L81C20 Consumer: https://github.com/Samagra-Development/yaus/blob/3cade479eae5f68c5226cadfeb1647f438b0de11/apps/api/src/app/app.controller.ts#L137C1-L147C3 MS siide effects : https://github.com/Samagra-Development/yaus/blob/3cade479eae5f68c5226cadfeb1647f438b0de11/apps/api/src/main.ts#L25C1-L35C9 Was there any specific reason to do this and if no then do we want to perform these task async through RMQ as per HLD ?
Is this done?
@yuvrajsab Yes this can be closed
closed via #83
We need to follow the design doc . So all the side-effects (task that can be done in the background) should occur at RabbitMQ so they won't add overhead to the endpoints. For example, we are tracking the click count in the redis but this operation could take some time and add overhead to the redirect endpoint. ref https://github.com/Samagra-Development/yaus/blob/master/apps/api/src/app/app.service.ts#L128-L130C1.
We need to identify at what other places we are doing this thing and refactor that.