blob: 804970b923311be6ba00b14f27ab2e4956d96929 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<section id="Qpid-Java-Broker-Virtualhosts-Config"><title>
Configure the Virtual Hosts via virtualhosts.xml
</title><section role="h2" id="ConfiguretheVirtualHostsviavirtualhosts.xml-virtualhosts.xmlOverview"><title>
virtualhosts.xml Overview
</title>
<para>
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.
</para><para>
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 Qpid.
</para><para>
Thus most application deployments need a virtualhosts.xml file
with at least some minimal detail.
</para>
<section role="h3" id="ConfiguretheVirtualHostsviavirtualhosts.xml-XMLFormatwithComments"><title>
XML Format with Comments
</title>
<para>
The virtualhosts.xml which currently ships as part of the Qpid
distribution is really targeted at development use, and supports
various artifacts commonly used by the Qpid development team.
</para><para>
As a result, it is reasonably complex. In the example XML below,
I have tried to simplify one example virtual host setup which is
possibly more useful for new users of Qpid or development teams
looking to simply make use of the Qpid broker in their
deployment.
</para><para>
I have also added some inline comments on each section, which
should give some extra information on the purpose of the various
elements.
</para>
<programlisting>
<virtualhosts>
<!-- Sets the default virtual host for connections which do not specify a vh -->
<default>localhost</default>
<!-- Define a virtual host and all it's config -->
<virtualhost>
<name>localhost</name>
<localhost>
<!-- Define the types of additional AMQP exchange available for this vh -->
<!-- Always get amq.direct (for queues) and amq.topic (for topics) by default -->
<exchanges>
<!-- Example of declaring an additional exchanges type for developer use only -->
<exchange>
<type>direct</type>
<name>test.direct</name>
<durable>true</durable>
</exchange>
</exchanges>
<!-- Define the set of queues to be created at broker startup -->
<queues>
<!-- The properties configured here will be applied as defaults to all -->
<!-- queues subsequently defined unless explicitly overridden -->
<exchange>amq.direct</exchange>
<!-- Set threshold values for queue monitor alerting to log -->
<maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
<maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
<maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
<!-- Define a queue with all default settings -->
<queue>
<name>ping</name>
</queue>
<!-- Example definitions of queues with overriden settings -->
<queue>
<name>test-queue</name>
<test-queue>
<exchange>test.direct</exchange>
<durable>true</durable>
</test-queue>
</queue>
<queue>
<name>test-ping</name>
<test-ping>
<exchange>test.direct</exchange>
</test-ping>
</queue>
</queues>
</localhost>
</virtualhost>
</virtualhosts>
</programlisting>
<!--h3--></section>
<section role="h3" id="ConfiguretheVirtualHostsviavirtualhosts.xml-Usingyourownvirtualhosts.xml"><title>
Using your own virtualhosts.xml
</title>
<para>
Note that the config.xml file shipped as an example (or developer
default) in the Qpid distribution contains an element which
defines the path to the virtualhosts.xml.
</para><para>
When using your own virtualhosts.xml you must edit this path to
point at the location of your file.
</para>
<!--h3--></section>
<!--h2--></section>
</section>
|