jdarling / MongoMQ

MongoMQ is a messaging queue built on top of Node.js and MongoDB's tailable cursors.
MIT License
90 stars 20 forks source link

Feature: Allow peeking into queue #8

Closed joscha closed 11 years ago

joscha commented 11 years ago

Is there any fast way to find out if an item matching a specific data part is in the queue other than querying the database for it? Use case: I want to prevent adding identical items to the queue.

jdarling commented 11 years ago

As all of the messages are only stored in the DB and can be added by any attached system, it wouldn't be possible to know without a query.

joscha commented 11 years ago

I see. Not completely sure how to solve that problem then - maybe only put the data reference in the queue and keep a flag on the original data. That way at least the processing overhead itself can be saved...