jeudi 13 avril 2017

Storing Message Queue on Database for scehduler job

I'm implementing a process that uses a queue and a database for an ecommerce enterpise application.

In the queue we store all the order items Id processed and in the database there are all the order placed by customers.

No every time a order ID is drop in the queue the process get the message from the queue (subscriber) does a look up on the database to see if all the order items related to that order has been processed and when they are it will then call a dispatch order API.

Now shall I do all this processing in the subscriber event or shall I split down the process in 2 components : one that listens to the queue and stores the message into a database table called "order items processed" and a scheduled job that runs every 10 min and JOIN the order table with the order items processed to understand if all the order items are processed ?

Aucun commentaire:

Enregistrer un commentaire