Menu Search

4.5. Virtualhosts

A virtualhost is a namespace 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 container called 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.

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

Bindings are relationships between Exchanges and Queue that facilitate routing of messages from the Exchange to the Queue.

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.