Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following file allows you to configure virtual hosts for WSO2 Message Broker:  <MB_HOME>/repository/conf/advanced/qpid-virtualhosts.xml file allows you to configure virtual hosts for WSO2 Message Broker. Following is the tree of the XML elements in this file:

Anchor
Top
Top

...

Table of Contents
maxLevel4
minLevel43

...

<virtualhosts>

This configuration file contains details of all queues and topics, and associated properties, to be created on broker startup. These details are configured on a per virtual host basis. Note that if you do not add prate this file with details of a queue or topic you intend to use to this file, you must first create a consumer on a queue/topic before you can publish to it using WSO2  theWSO2 MB. Thus, most application deployments need a virtualhosts.xml file with at least some minimal detail.

Configurable Sub Elements
Element NameDescriptionTypeDefault ValueFixed ValuesMandatory/
Optional
Notes
<default>Sets This parameter sets the default virtual host for connections which do not specify a vhvirtual hostStringcarbonone of defined virtual-hostsMandatory 

<virtualhost>

Define a virtual host and all it's configurations under this element. All sub sections are included under this element.

Configurable Sub Elements
Element NameDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
<name>Sets the This parameter sets an identifiable name for the virtualhostStringcarbonN/AMandatory 

<carbon>

All configuration options for "carbon" virtual host are defined under this element.

<store>

Defines the store properties used by this virtual host to keep messages. By default, the Cassandra based message store is configured. 

<housekeeping>

Housekeeping task configurations for virtualhosts. This section configures the clean-up threads that work on flushing out obsolete/expired messages from the AMQP exchanges.

Configurable Sub Elements
Element NameDescriptionTypeDefault ValueFixed ValuesMandatory/
Optional
Notes
<class><threadCount>The class that implements the message storenumber of clean-up threads.String org.wso2.andes.server.store.
CassandraMessageStore
 NInteger2N/AMandatoryThis should be defined in the class path by the time the broker is started<username>The username for message store accessStringadmin Mandatory 
<password>The password for message store accessStringadmin Mandatory 
<cluster>The name of the cluster to which this broker instance should be registeredStringClusterOne Mandatory 
<idGenerator>The class generating message IDs for global sync across the clusterStringorg.wso2.andes.server.cluster.coordination.
TimeStampBasedMessageIdGenerator
 Mandatory 
<connectionString>Connection string for the message store localhost:9160  

If you have a Cassandra profile running or Cassandra cluster running this should point to that running instance or cluster.

<housekeeping>

Housekeeping task configurations for virtualhosts.

Configurable Sub Elements
Element NameDescriptionTypeDefault ValueFixed ValuesMandatory/
Optional
Notes
<threadCount> Integer2N/AMandatory 
<expiredMessageCheckPeriod> <expiredMessageCheckPeriod>The time intervals at which the QPID broker checks for expired messages.Integer20000N/AMandatoryThe value is specified in milliseconds.

<exchanges>

Define the types of additional AMQP exchange available for this vh. Always get amq.direct (for queues) and amq.topic (for topics) by default. Declare an additional exchange type for developer use only.

<queues>

Note that if you do not add details of a queue or topic you intend to use to this file, you must first create a consumer on a queue/topic before you can publish to it using WSO2 MB. 

Configurable Sub Elements
Element NameDescriptionTypeDefault ValueFixed ValuesMandatory/
OptionalNotes<maximumQueueDepth>Defines the maximum number of messages that can be kept in the internal queue buffer for delivery. You can switch it off by setting it to 0. 0N/A Mandatory <maximumMessageSize>The maximum size, in bytes, of the messages that can be kept in the queue. You can switch it off by setting it to 0. 0N/A Mandatory <maximumMessageAge>Messages kept for this amount of time in the broker will be dropped. You can switch it off by setting it to 0. N/A Mandatory <maximumMessageCount>The maximum message count of a queue. You can switch it off by setting it to 0. 0N/A Mandatory 

This element is commented out by default and is not mandatory. If required, you can use this to define additional AMQP exchanges for this virtual host. For example, if you want queues to be automatically created in the message broker during server startup, you need to specify the type of AMQP exchange to use and you need to update the <queues> element in this file with the required queue information. Note that amq.direct is the default exchange that should be used for queue creation.

<queues>

You can use this <queues> section and the <exchanges> element explained above to create new queues during server startup. You can find detailed instructions on the different methods of creating queues in WSO2 MB from here.