Menu Search

4.5. Virtualhosts

A virtualhost is a container in which messaging is performed. Virtualhosts are independent; the messaging that goes on within one virtualhost is independent of any messaging that goes on in another virtualhost. For instance, a queue named foo defined in one virtualhost is completely independent of a queue named foo in another virtualhost.

A virtualhost is identified by a name which must be unique broker-wide. Clients use the name to identify the virtualhost to which they wish to connect when they connect.

A virtualhost exists in a virtualhost node.

The virtualhost comprises a number of entities. This section summaries the purpose of each of the entities and describes the relationships between them. These details are developed further in the sub-sections that follow.

Exchanges is a named entity within the Virtual Host which receives messages from producers and routes them to matching Queues. When using AMQP 0-8, 0-9, 0-9-1, 0-10 the exchange is the only way ingressing a message into the virtualhost. When using AMQP 1.0 producers may route messages via exchanges or direct to queues.

Queues are named entities that hold messages for delivery to consumer applications.

Connections represent a live connection to the virtualhost from a messaging client.

A Session represents a context for the production or consumption of messages. A Connection can have many Sessions.

A Consumer represents a live consumer that is attached to queue.

Loggers are responsible for producing logs for this virtualhost.

The following diagram depicts the Virtualhost model:

Figure 4.3. Virtualhost Model showing major entities

Virtual Host Model

A virtualhost is backed by storage which is used to store the messages.