twingly / twingly-amqp

:bus: Ruby gem for RabbitMQ subscribing and publishing
0 stars 0 forks source link

Use quorum queues by default instead of classic queues #100

Closed roback closed 1 year ago

roback commented 1 year ago

Now we support both classic queues (which is what we used before), and quorum queues. The default type was also changed to quorum here, as that is what we will use in all of our projects.

Only "mirrored classic queues" are deprecated, not classic queues in general, so I opted to continue supporting classic queues in this gem, even though we'll most likely not use them once we have switched all of our production queues to quorum queues.

I added an extra argument to the classes that creates queues, which tells them what kind of queue to create. Based on that argument, the classes then either uses the Channel#queue or Channel#quorum_queue method to setup the queue. Those helper methods were added to Bunny in https://github.com/ruby-amqp/bunny/commit/0cae5f8766afc125c5cdd60e90b2b7962961b4c1

Related to https://github.com/twingly/ansible/issues/2316

Also a bit related to https://github.com/twingly/twingly-amqp/issues/78 (as we now support the x-queue-type argument). I'm not sure we need to support the x-quorum-initial-group-size argument mentioned there though, as we will only have three servers, which is the default value for that argument.


Before merge

roback commented 1 year ago
  • Test the changes made here in one project, just so we know if the changes made here are enough to support quorum queues

Tested this PR in a project and it has been running for a day now, so I'd say everything's working as it should.

roback commented 1 year ago

I think this is finished now. If we just get this merged, so I can create a release, we can then start to use the new types of queues in all of our Ruby projects.