-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multiple queues for MongoDB #11
base: master
Are you sure you want to change the base?
Conversation
…ike DBAL to help sort messages with identical published_at time, so if you push a lot of messages in one second, the order of the execution can not be guaranteed. This way it can.
…e queues in the same table
Interesting. Can you check the unit test failure? |
Honestly, I don't really like it. Multiple queues was left on separate collections (and tables for dbal) on purpose: having multiple queues on the same table/collection implies the creation of a new index and, in case of mongo, a very inefficient queue data retrieval. For example: i'm using a count operation to collect metrics about the number of messages in the queues of my system. In this context, a document count of the whole collection is optimized by mongo, but a filtered count could be very very slow (mongo will perform the query and than advances the cursor to the last element couting documents one-by-one). In any case, adding some user-defined data and let the user to check that data while querying the queue is a good idea, but I think should be done in another way. |
Add queue_name field to tests
…dds collection with queue_name index. If a collection is already creted, adds the queue_name index only.
# Conflicts: # lib/Transport/Mongo/MongoSender.php # tests/Transport/Mongo/MongoTransportTest.php
a269cba
to
02ea5f3
Compare
5eca77d
to
b9cabfa
Compare
74a8d7b
to
2bbe009
Compare
I didn't like creating multiple tables for multiple queues so I added queue_name parameter, similar to the one in default symfony/messenger DBAL transport. Lets you store multiple queues in one MongoDB table - very simple.