I tried to exchange communication between streams and opened channels only when creating streams, but after learning a little more, I think I want to try connection pooling as well. How can I do this on rabbitmq? or is it a general idea that I can apply as a whole? My goal is to spawn X threads, and then they don't need to open new channels (which requires a round-robin deployment between the client and server).
Since threads are their own class, I'm not sure if I need to put the pool in the class itself that spawns the threads, or where do they go? I also have several types of threads that I would like to share with these connections between (not just one). Is it possible?
Just to give you a general idea of how connections / channels are involved in rabbitmq:
ConnectionFactory factory = new ConnectionFactory(); factory.setHost("localhost"); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); //I want to share several of these between threads
Lostsoul
source share