I've got a few short questions about RabbitMQ + Spring , and i'd appreciate your help on this matter.
After reading the documentation
here (https://docs.spring.io/spring-amqp/reference/html/#connections)
and here (https://www.rabbitmq.com/api-guide.html)
it seems the api for the Java + Spring client has a class called CachingConnectionFactory.
The facts:
CachingConnectionFactory has two members of intrest: PublisherConnectionFactory and RabbitConnectionFactory
CachingConnectionFactory extends a parent class called AbstractConnectionFactory
CachingConnectionFactory has a member called (ExecutorService channelsExecutor).
AbstractConnectionFactory has a member called (ExecutorService executorService).
AbstractConnectionFactory has a method called setExecutor(ExecutorService executorService), which sets it's own executorService and then invokes the same method on it's PublisherConnectionFactory
RabbitConnectionFactory has 4 (!) different executors: sharedExecutor, shutdownExecutor, heartbeatExecutor, topologyRecoveryExecutor; It also has a member called nioParams, with another 2 executors: nioExecutor and connectionShutdownExecutor. In addition, it has a method called params, accepting another executor called consumerWorkServiceExecutor. That is 7 executors in total (!!)
It seems the RabbitConnectionFactory, and the docs here (https://www.rabbitmq.com/api-guide.html again), suggest you can pass in any custom executor when creating a channel: rabbitConnectionFactory.newConnection(myExecutorService);
The questions:
What is the difference, and the relationship, between CachingConnectionFactory, PublisherConnectionFactory and RabbitConnectionFactory?
Why do we need so many different executor pools? What is the difference between them all?
Do these classes share their thread pools / executors?
When a connection is opened, to which thread pool is it allocated?
When a channel is opened, to which thread pool is it allocated?
Do publish and consume operations use different thread pools?
How do I pass in my own executor implementation or otherwise configure, each of the aformentioned executors?
Would it be a good idea to merge/unify some or all of the executors?
Thanks in advance