ใน RabbitMQ connection คือ TCP connection ไปยัง broker ขณะที่ channel คือ virtual connection น้ำหนักเบาภายใน connection การใช้ channel อย่างเหมาะสม (แทนการใช้ connection จำนวนมาก) มีความสำคัญต่อประสิทธิภาพและเป็น best practice ที่พบบ่อย
connection เทียบกับ channel
CONNECTION → a TCP connection to the RabbitMQ broker:
→ relatively HEAVY (a real network connection, with overhead to establish/maintain)
CHANNEL → a lightweight, virtual connection MULTIPLEXED over a single TCP connection:
→ many channels share one connection → lightweight; most operations happen on channels
→ publishing, consuming, declaring queues → done via channels
→ one connection can have MANY channels (multiplexing reduces TCP overhead)
