仮想ホスト(vhost)はRabbitMQにおいて、単一のブローカー内で論理的な分離を提供します。キュー、エクスチェンジ、権限の独立した名前空間を作成し、1つのRabbitMQインスタンスが複数の隔離されたアプリケーションまたは環境を処理できるようにします。
仮想ホストとは何か
VIRTUAL HOST (vhost) → a logically isolated namespace within a RabbitMQ broker:
→ each vhost has its OWN queues, exchanges, bindings (isolated from other vhosts)
→ its own PERMISSIONS (users granted access per vhost)
→ like separate "virtual brokers" within one physical broker
→ partitions a single RabbitMQ instance into isolated environments
仮想ホストを使用する理由
✓ ISOLATION → separate applications/teams/environments on one broker (their queues/exchanges
don't interfere or collide)
✓ MULTI-TENANCY → multiple apps share a broker but stay separated
✓ ENVIRONMENTS → e.g. separate vhosts for dev/staging (on a shared broker)
✓ ACCESS CONTROL → grant users permissions per vhost (security/separation)
✓ Organization → group related messaging resources; avoid name collisions
