How to remove message from message queue (only if its well formatted)?

前端 未结 2 1940
别那么骄傲
别那么骄傲 2021-01-23 10:19

I want to take message from one queue and send it to database. I want to do it only if it\'s in specific format.

If i use Receive method directly and some e

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-23 10:37

    This is the same approach that I take when manually dequeuing message one at a time and I've not come across any issues with it.

    The one thing that you do not appear to dealing with is how to handle a message on the queue that does not have the required format. Is your intention to leave it on the queue? If so, you might end up with a very large queue and have all sorts of issues with peeking at messages further up the queue that have not yet been expected. It would appear to make more sense to also de-queue those messages that do not have the required format and store them elsewhere if they cannot be deleted.

提交回复
热议问题