RabbitMQ பல exchange வகைகளை கொண்டுள்ளது, அவை செய்திகளை queue-க்கு எவ்வாறு route செய்வது என்பதை தீர்மானிக்கிறது — direct, topic, fanout, மற்றும் headers. இவற்றைப் புரிந்துகொள்வது RabbitMQ-ல்유연한routing-ற்கு முக்கியமாகும், வெவ்வேறு messaging pattern-களை செயல்படுத்த உதவுகிறது.
Exchange வகைகள்
DIRECT → routes by an EXACT routing key match:
→ message routing key = queue binding key → delivered to that queue
→ for: routing to specific queues by a key (e.g. route by severity, type)
FANOUT → broadcasts to ALL bound queues (ignores routing key):
→ every queue bound to the exchange gets the message → PUB/SUB (one-to-many)
→ for: broadcasting events to all interested consumers
TOPIC → routes by PATTERN matching on the routing key (wildcards):
→ routing keys like "order.created", "order.*", "*.error" → flexible pattern routing
→ for: routing by topics/categories with wildcards (flexible pub/sub)
HEADERS → routes by message HEADER attributes (not the routing key) → less common
