Skip to content
Advertisement

What kind of threading model changes led to DMLC

The doc explains why DMLC was introduced in version 2: https://docs.spring.io/spring-amqp/reference/html/#choose-container

This architecture was required because, in early versions of the RabbitMQ client, multiple concurrent deliveries were not possible. Newer versions of the client have a revised threading model and can now support concurrency. This has allowed the introduction of the DMLC where the listener is now invoked directly on the RabbitMQ Client thread. Its architecture is, therefore, actually “simpler” than the SMLC.

As mentioned in the doc: a revised threading model and can now support concurrency.

Can I simply understand it like this:

The previous version of the client will not make concurrent calls to the handleDelivery method, so we need to use a queue : just put the message in the queue and wait for other thread to consume, so handleDelivery method will return immediately to avoid blocking subsequent delivery, but the new version of the rabbit client will call the handleDelivery method concurrently, so there is no need to use an queue to support concurrency.

Can someone explain in more detail about what kind of threading model changes led to DMLC?

Advertisement

Answer

I don’t recall which version of amqp-client improved the threading, but it was around the time I joined the project (10+ years ago).

It just took us a few years to get around to rewriting the container (in 2016).

We kept the legacy SMLC as well as it still has some benefits, such as consumer-side batching.

See Choosing a Container.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement