Using vhosts

With virtual hosts (vhosts), it is possible to have many different, independent virtual brokers within one single RabbitMQ instance. In this way, it is possible to use the same broker on the parts of many different applications without worrying about name clashes. This is the same approach used by web servers with virtual hosts.

You can find the simple Java example in the Chapter03/Recipe01 directory, which is identical to the example in the first recipe of the book, except for the usage of the vhost.

Getting ready

To exercise this recipe, you just need to issue some commands at the Linux command prompt, that is, RabbitMQ Command Prompt (sbindir) in the Windows Start menu.

How to do it…

To create a new vhost, perform the following steps: ...

Get RabbitMQ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.