Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Reading a queue item from MSMQ removes that item from Queue, can be stop this behavior and delete Queue item as per our need.

$
0
0

In my web application - As soon as user registers to our system, we put a queue request in MSMQ (we save only "UserID" in MSMQ request) to send verification link to users at later stage and let them continue to use the website for next 24 hours without account verification.

We have a windows service running that checks queued item from MSMQ every 30 min, fetches the record from database byUserID and send them the account verification link. But the problem is that I can read MSMQ entries only once, As soon as I read entry for the first time, it just vanishes and it is not accessible next time. It may happen that after reading entries from MSMQ, send verification mail functionality may fail and I can't send the verification mail next time because I won't be able to find this entry again in MSMQ.

Is there a way to stop this behavior and delete MSMQ entries on demand. Please share your thoughts.

PS: There can be many other solutions to above described problem - I can rather store mail sent status in database only and fetch all records from the table (for which mails are still not sent) at later stage to send mail again, but the above example is just for putting a use case. There are many scenarios where I need to use MSMQ implementation and looking for this answer.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>