Configure a more optimal prefetch size based on the scenario.
Shutdown producers first so that consumers can unblock producers if needed.
Use a 3 second close timeout.
Try to shutdown all the clients in parallel.
Use the right connection factory class.