The following file allows you to configure virtual hosts for WSO2 Message Broker: <MB_HOME>/repository/conf/advanced/andesqpid-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 | ||||
---|---|---|---|---|
|
Code Block | ||
---|---|---|
| ||
<virtualhosts> <default> <virtualhost> <name> <carbon> <housekeeping> <store> <threadCount> <class> <expiredMessageCheckPeriod> <username> <exchanges> <password> <type> <cluster> <name> <idGenerator> <connectionString> <durable> <advanced> <GCGraceSeconds> <exchange> <type> <replicationFactor> <readConsistencyLevel> <writeConsistencyLevel> <strategyClass> <housekeeping> <name> <threadCount> <expiredMessageCheckPeriod> <exchanges> <queues> <maximumQueueDepth> <maximumMessageSize> <maximumMessageAge> <maximumMessageCount> <maximumMessageCount> |
Click an element below for more information about that element.
Table of Contents | ||||
---|---|---|---|---|
|
...
<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 Name | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|---|---|---|---|---|---|
<default> | Sets This parameter sets the default virtual host for connections which do not specify a vhvirtual host | String | carbon | one of defined virtual-hosts | Mandatory |
<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 Name | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
<name> | Sets the This parameter sets an identifiable name for the virtualhost | String | carbon | N/A | Mandatory |
<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.
Configurable Sub Elements
Element Name | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|---|---|---|---|---|---|
<class> | The class that implements the message store. | String | org.wso2.andes.server.store. CassandraMessageStore | N/A | Mandatory | This should be defined in the class path by the time the broker is started |
<username> | The username for message store access | String | admin | Mandatory | ||
<password> | The password for message store access | String | admin | Mandatory | ||
<cluster> | The name of the cluster to which this broker instance should be registered | String | ClusterOne | Mandatory | ||
<idGenerator> | The class generating message IDs for global sync across the cluster | String | org.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. |
<advanced>
This section is used to change the default configurations of the Cassandra instance. These values will be used when running the broker in a clustered Cassandra set up.
Configurable Sub Elements
Element Name | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
<GCGraceSeconds> | This specifies the time to wait before garbage collector collecting tombstones (deletion markers) from cassandra. | Integer | 864000 (10 days) | 0 - 864000 | Mandatory | Set this to a large enough value which the deletion marker will be propagated to all replicas by the time this many seconds has elapsed.In a single-node cassandra cluster it can be safely set to zero. |
<replicationFactor> | The replication factor specifies how many copies of each data will be stored and distributed throughout the cassandra cluster. | Integer | 1 | N/A | Mandatory | If the strategy class is set to 'org.apache.cassandra.locator.NetworkTopologyStrategy' do not set this value in the replication factor. |
<readConsistencyLevel> | This specifies how many replicas must respond before a result is returned to the client. | String | QUORUM | ONE, TWO, THREE, QUORUM, ALL, ANY, EACH_QUORUM, LOCAL_QUORUM | Mandatory | QUORUM = (replication_factor / 2) + 1 |
<writeConsistencyLevel> | This specifies how many replicas the write must succeed before returning an acknowledgement to the client. | String | QUORUM | ONE, TWO, THREE, QUORUM, ALL, ANY, EACH_QUORUM, LOCAL_QUORUM | Mandatory | |
<strategyClass> | String | org.apache.cassandra.locator.SimpleStrategy | SimpleStrategy/NetworkTopologyStrategy | Mandatory |
<housekeeping>
Housekeeping task configurations for virtualhosts<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 Name | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|---|---|---|---|---|---|
<threadCount> | The number of clean-up threads. | Integer | 2 | N/A | Mandatory | |
<expiredMessageCheckPeriod> | The time intervals at which the QPID broker checks for expired messages. | Integer | 20000 | N/A | Mandatory | The 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
Optional
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.