summaryrefslogtreecommitdiff
path: root/qpid/doc/book/src/java-broker/Java-Broker-Virtual-Hosts-Configuration.xml
blob: 6a4c8485e31890dc55c6c855a7a388e49e7a96e5 (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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE entities [
<!ENTITY %  entities SYSTEM  "commonEntities.xml">
%entities;
]>
<!--

 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.

-->
<chapter id="Java-Broker-Virtual-Hosts-Configuration-File">
  <title>Virtual Host XML configuration file</title>

  <section id="Java-Broker-Virtual-Hosts-Configuration-File-Introduction">
    <title>Introduction</title>
    <para>
        This chapter describes how to configure Virtual Hosts using an XML file.
    </para>
    <para>
        This is no longer the preferred approach for
        <link linkend="Java-Broker-Virtual-Hosts-Configuring-Managing">defining a VirtualHost</link> and will likely be removed
        in a future release, however it is currently neccessary to support certain use cases such as per-virtualhost attribute
        configuration, and specialised store configuration such as for the <link linkend="Java-Broker-Stores-HA-BDB-Store">BDB HA Message Store</link>
    </para>
    <para>
        Each XML Virtual Host configuration file can hold configuration for a single Virtual Host or multiple Virtual Hosts.
        For an example file (with multiple VirtualHosts), see <xref linkend="Java-Broker-Virtual-Host-Configuration-File-Example"/>
    </para>
  </section>

    <section id="Java-Broker-Virtual-Hosts-Configuration-File-ACL">
        <title>Configuring ACL</title>
        <para><xref linkend="Java-Broker-Security-ACLs"/> provides the details of ACL, rules, formats, etc.</para>
        <para>
        To apply an ACL on a single virtualhost named <replaceable>test</replaceable>, add the following to the virtualhosts.xml:
        </para>

        <programlisting>
&lt;virtualhost&gt;
...
    &lt;name&gt;test&lt;/name&gt;
    &lt;test&gt;
      ...
      &lt;security&gt;                          <co id="Java-Broker-Virtual-Hosts-Configuration-Security-ACL-1"/>
        ...
        &lt;acl&gt;<replaceable>${conf}/vhost_test.acl</replaceable>&lt;/acl&gt; <co  id="Java-Broker-Virtual-Hosts-Configuration-Security-ACL-2"/>
        ...
      &lt;/security&gt;
      ...
    &lt;/test&gt;
&lt;/virtualhost&gt;
        </programlisting>
        <calloutlist>
            <callout arearefs="Java-Broker-Virtual-Hosts-Configuration-Security-ACL-1"><para>A security section of configuration is used to declare the ACL</para></callout>
            <callout arearefs="Java-Broker-Virtual-Hosts-Configuration-Security-ACL-2"><para>A path to an ACL file is configured (assuming that <replaceable>conf</replaceable> has been set to a suitable
      location such as ${QPID_HOME}/etc)</para></callout>
        </calloutlist>
    </section>

    <section role="h3" id="Java-Broker-Stores-Memory-Store-Configuration">
        <title>Configuring MemoryMessageStore</title>
        <para>
        An example of MemoryMessageStore configuration for a virtual host is shown below:
        </para>

        <example>
          <title>Configuring a VirtualHost to use the MemoryMessageStore</title>
          <programlisting><![CDATA[
<virtualhosts>
  <virtualhost>
    <name>vhostname</name>
    <vhostname>
      <store>
        <class>org.apache.qpid.server.store.MemoryMessageStore</class
      </store>
      ...
    </vhostname>
  </virtualhost>
</virtualhosts>
    ]]></programlisting>
        </example>
      </section>

      <section role="h3" id="Java-Broker-Stores-BDB-Store-Configuration">
        <title>Configuring BDBMessageStore</title>
        <para>
          In order to use the BDBMessageStore, you must configure it for each VirtualHost desired by updating the store element
          to specify the associated store class and provide a directory location for the data to be written, as shown below.
        </para>

        <example>
          <title>Configuring a VirtualHost to use the BDBMessageStore</title>
          <programlisting><![CDATA[
<virtualhosts>
  <virtualhost>
    <name>vhostname</name>
    <vhostname>
      <store>
        <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
        <environment-path>${QPID_WORK}/bdbstore/vhostname</environment-path>
      </store>
      ...
    </vhostname>
  </virtualhost>
</virtualhosts>
    ]]></programlisting>
        </example>

	<section role="h4" id="Java-Broker-Stores-BDB-Store-Configuration_BDBEnvVars">
	  <title>Passing BDB environment configuration options</title>
	  <para>It is possible to pass BDB <ulink url="&oracleBdbJavaDocUrl;com/sleepycat/je/EnvironmentConfig.html">
	     environment</ulink> from the virtualhost.xml. Environment configuration options are passed using
	     <varname>envConfig</varname> elements within the <varname>store</varname> element.</para>
	  <para>For example, to override the BDB environment configuration options <varname>je.cleaner.threads</varname> and
	    <varname>je.log.fileMax</varname></para>
	  <example>
	    <title>Configuring BDB Environment Configuration</title>
	    <programlisting language="xml"><![CDATA[
      <store>
	...
	<envConfig>
	  <name>je.cleaner.threads</name>
	  <value>2</value>
	</envConfig>
	<envConfig>
	  <name>je.log.fileMax</name>
	  <value>5000000</value>
	</envConfig>
	  ...
      </store>]]></programlisting>
          </example>
	</section>
      </section>

      <section role="h3" id="Java-Broker-Stores-BDBHA-Store-Configuration">
        <title>Configuring BDBHAMessageStore</title>
        <para>See <xref linkend="Java-Broker-High-Availability-Configuration"/></para>
      </section>

      <section role="h3" id="Java-Broker-Stores-Derby-Store-Configuration">
        <title>Configuring DerbyMessageStore</title>
        <para>
          In order to use the DerbyMessageStore, you must configure it for each VirtualHost desired by updating the store element
          to specify the associated store class and provide a directory location for the data to be written, as shown below.
        </para>

        <example>
          <title>Configuring a VirtualHost to use the DerbyMessageStore</title>
          <programlisting><![CDATA[
<virtualhosts>
  <virtualhost>
    <name>vhostname</name>
    <vhostname>
      <store>
        <class>org.apache.qpid.server.store.DerbyMessageStore</class>
        <environment-path>${QPID_WORK}/derbystore/vhostname</environment-path>
      </store>
      ...
    </vhostname>
  </virtualhost>
</virtualhosts>
    ]]></programlisting>
        </example>
    </section>

    <section role="h3" id="Java-Broker-Stores-JDBC-Store-Configuration">
    <title>Configuring JDBCMessageStore</title>
    <para>
    JDBCMessageStore can be configured on VirtualHost as in example shown below:
    </para>

    <example>
      <title>Configuring a VirtualHost to use the JDBCMessageStore</title>
      <programlisting><![CDATA[
<virtualhosts>
  <virtualhost>
    <name>vhostname</name>
    <vhostname>
      <store>
        <class>org.apache.qpid.server.store.jdbc.JDBCMessageStore</class>
        <connectionUrl>jdbc:oracle:thin:guest@guest//localhost:1521/orcl</connectionUrl>
      </store>
      ...
    </vhostname>
  </virtualhost>
</virtualhosts>
]]></programlisting>
    </example>
  </section>


    <section role="h3" id="Java-Broker-Virtual-Host-Configuration-Exchange">
    <title>Configuring Exchanges</title>
    <para>
    To declare Exchanges within Virtual Host configuration, add the appropriate xml
    to the virtualhost.xml configuration file within the <varname>exchanges</varname> element.
    An example of such declaration is shown below:
    </para>

    <example>
      <title>Configuring Exchanges on VirtualHost</title>
      <programlisting><![CDATA[
<virtualhosts>
  <virtualhost>
    <name>vhostname</name>
      ...
            <exchanges>
                <exchange>
                    <type>direct</type>
                    <name>test.direct</name>
                    <durable>true</durable>
                </exchange>
                <exchange>
                    <type>topic</type>
                    <name>test.topic</name>
                </exchange>
            </exchanges>
      ...
    </vhostname>
  </virtualhost>
</virtualhosts>
]]></programlisting>
    </example>
    </section>

    <section role="h2" id="Java-Broker-Virtual-Host-Declare-Queues">
      <title>Configuring Queues</title>
      <para>To create a priority, sorted or LVQ queue within configuration, add the appropriate xml
        to the virtualhost.xml configuration file within the <varname>queues</varname>
        element.</para>
      <section role="h3" id="Java-Broker-Queues-OtherTypes-CreateUsingConfig-Simple">
        <title>Simple</title>
        <para>For declaration of a simple queue define a queue entry in the virtual host configuration as in example below</para>
        <example>
          <title>Configuring a simple queue</title>
          <programlisting><![CDATA[<queue>
    <name>my-simple-queue</name>
    <my-simple-queue>
        <exchange>amq.direct</exchange>
        <durable>true</durable>
    </my-simple-queue>
</queue>]]></programlisting>
        </example>
      </section>
      <section role="h3" id="Java-Broker-Queues-OtherTypes-CreateUsingConfig-Priority">
        <title>Priority</title>
        <para> To defining a priority queue, add a &lt;priority&gt;true&lt;/priority&gt; element. By
          default the queue will have 10 distinct priorities. </para>
        <example>
          <title>Configuring a priority queue</title>
          <programlisting><![CDATA[<queue>
    <name>myqueue</name>
    <myqueue>
        <exchange>amq.direct</exchange>
        <priority>true</priority>
    </myqueue>
</queue>]]></programlisting>
        </example>
        <para> If you require fewer priorities, it is possible to specify a
            <varname>priorities</varname> element (whose value is a integer value between 2 and 10
          inclusive) which will give the queue that number of distinct priorities. When messages are
          sent to that queue, their effective priority will be calculated by partitioning the
          priority space. If the number of effective priorities is 2, then messages with priority
          0-4 are treated the same as "lower priority" and messages with priority 5-9 are treated
          equivalently as "higher priority". </para>
        <example>
          <title>Configuring a priority queue with fewer priorities</title>
          <programlisting><![CDATA[<queue>
    <name>myqueue</name>
    <myqueue>
        <exchange>amq.direct</exchange>
        <priority>true</priority>
        <priorities>4</priorities>
    </myqueue>
</queue>]]></programlisting>
        </example>
      </section>
      <section role="h3" id="Java-Broker-Queues-OtherTypes-CreateUsingConfig-Sorted">
        <title>Sorted</title>
        <para> To define a sorted queue, add a <varname>sortKey</varname> element. The value of the
            <varname>sortKey</varname> element defines the message property to use the value of when
          sorting the messages put onto the queue. </para>
        <example>
          <title>Configuring a sorted queue</title>
          <programlisting><![CDATA[<queue>
    <name>myqueue</name>
    <myqueue>
        <exchange>amq.direct</exchange>
        <sortKey>message-property-to-sort-by</sortKey>
    </myqueue>
</queue>]]></programlisting>
        </example>
      </section>
      <section role="h3" id="Java-Broker-Queues-OtherTypes-CreateUsingConfig-LVQ">
        <title>LVQ</title>
        <para> To define a LVQ, add a <varname>lvq</varname> element with the value
            <constant>true</constant>. Without any further configuration this will define an LVQ
          which uses the JMS message property <constant>qpid.LVQ_key</constant> as the key for
          replacement. </para>
        <example>
          <title>Configuring a LVQ queue</title>
          <programlisting><![CDATA[<queue>
    <name>myqueue</name>
    <myqueue>
        <exchange>amq.direct</exchange>
        <lvq>true</lvq>
    </myqueue>
</queue>]]></programlisting>
        </example>
        <para> If you wish to define your own property then you can do so using the
            <varname>lvqKey</varname> element.</para>
        <example>
          <title>Configuring a LVQ queue with custom message property name</title>
          <programlisting><![CDATA[<queue>
    <name>myqueue</name>
    <myqueue>
        <exchange>amq.direct</exchange>
        <lvq>true</lvq>
        <lvqKey>ISIN</lvqKey>
    </myqueue>
</queue>]]></programlisting>
        </example>
      </section>
      <section role="h3" id="Java-Broker-Virtual-Host-Configuring-Queue-With-Arguments">
        <title>Configuring queue with arguments</title>
        <para>Queue arguments can be configured in virtual host configuration file.
        An element <emphasis>argument</emphasis> is used to specify a queue argument as a name-value pair separated with equal character.
        Any number of queue arguments can be provided for a queue in their own <emphasis>argument</emphasis> elements.</para>
        <para>The following example demonstrates how to configure queue with two arguments.</para>
        <example>
          <title>Setting arbitrary queue arguments</title>
          <programlisting><![CDATA[
<queue>
    <name>myQueue</name>
    <myQueue>
        <argument>qpid.group_header_key=JMSXgroupID</argument>
        <argument>qpid.shared_msg_group=1</argument>
    </myQueue>
</queue>]]></programlisting>
        </example>
      </section>
    </section>

    <section role="h2" id="Java-Broker-Virtual-Host-Binding-Queue">
      <title>Queue Binding</title>
      <para>A queue can be bound to an exchange in virtual host configuration file by providing an exchange name in element <emphasis>exchange</emphasis>
      within the queue configuration element having the same name as a queue. If exchange element is omitted in queue configuration
      then such queue is bound to a default exchange only. With configuration file it is only possible to bind queue to a single exchange.</para>
      <para>An element <emphasis>routingKey</emphasis> is used to specify a custom binding key. It is an optional element, and,
       if it is not set then queue is bound to an exchange with a binding key equals to a queue name. Any number of binding keys can be configured.
      </para>
      <para>
       Binding arguments can be set with each binding key. An element <emphasis>bindingArgument</emphasis> is used to specify a binding argument
       as a name-value pair separated with equal character. Any number of binding arguments can be provided for a binding key in their own <emphasis>bindingArgument</emphasis> elements.
       All of them should be contained within an element having the same name as a binding key.</para>
      <para>The following example demonstrates how to bind queue <emphasis>testQueue</emphasis> to a default topic exchange
      using routing key <emphasis>testRoutingKey</emphasis> and binding arguments for message selector and no local.</para>
      <example>
        <title>Queue Binding Example</title>
          <programlisting><![CDATA[<queue>
    <name>testQueue</name>
    <testQueue>
        <exchange>amq.topic</exchange>
        <routingKey>testRoutingKey</routingKey>
        <testRoutingKey>
            <bindingArgument>x-filter-jms-selector=application='app1'</bindingArgument>
            <bindingArgument>x-qpid-no-local=</bindingArgument>
        </testRoutingKey>
    </testQueue>
</queue>]]>
            </programlisting>
         </example>
    </section>

    <section role="h2" id="Java-Broker-Virtual-Host-Configure-Flow-Control">
      <title>Configuring of Producer Flow Control</title>
      <para>Flow control capacity and flow resume capacity are required to set on a queue or virtual host to enable Producer flow control.</para>

             <example>
               <title>Configuring a queue depth limit</title>
                <programlisting>
                <![CDATA[
<queue>
    <name>test</name>
    <test>
        <exchange>amq.direct</exchange>

        <!-- set the queue capacity to 10Mb -->
        <capacity>10485760</capacity>

        <!-- set the resume capacity to 8Mb -->
        <flowResumeCapacity>8388608</flowResumeCapacity>
    </test>
</queue>
                ]]>
                </programlisting>
             </example>

                The default for all queues on a virtual host can also be set

             <example>
               <title>Configuring of default queue depth limit on virtualhost</title>
                <programlisting>
                <![CDATA[
<virtualhosts>
    <virtualhost>
        <name>localhost</name>
        <localhost>

            <!-- set the queue capacity to 10Mb -->
            <capacity>10485760</capacity>

            <!-- set the resume capacity to 8Mb -->
            <flowResumeCapacity>8388608</flowResumeCapacity>
        </localhost>
    </virtualhost>
</virtualhosts>
                ]]>
                </programlisting>
             </example>
    </section>

    <section role="h2" id="Java-Broker-Virtual-Host-Configure-Disk-Quotas">
      <title>Configuring of Disk Quota-based Flow Control</title>
        <para>
                An example of quota configuration for the BDB message store is provided below.
        </para>

            <example>
               <title>Configuring a limit on a store</title>
            <programlisting>
            <![CDATA[
<store>
   <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
   <environment-path>${work}/bdbstore/test</environment-path>
   <overfull-size>50000000</overfull-size>
   <underfull-size>45000000</underfull-size>
</store>
            ]]>
            </programlisting>
            </example>
    </section>


<section role="h3"
   id="Java-Broker-Virtual-Host-Transaction-Timeout-Configuring">
   <title>Configuring Transaction Timeouts</title>
   <para> The JMS transaction timeouts are configured on each virtual host defined in the XML
    configuration files.</para>
   <para> The default values for each of the parameters is 0, indicating that the particular check
    is disabled.</para>
   <para> Any or all of the parameters can be set, using the desired value in milliseconds, and will
    be checked each time the housekeeping process runs, usually set to run every 30 seconds in
    standard configuration. The meaning of each property is as follows:</para>
   <para>
    <itemizedlist>
     <listitem>
      <para>openWarn - the time a transaction can be open for (with activity occurring on it) after
       which a warning alert will be issued.</para>
     </listitem>
     <listitem>
      <para>openClose - the time a transaction can be open for before the connection it is on is
       closed.</para>
     </listitem>
     <listitem>
      <para>idleWarn - the time a transaction can be idle for (with no activity occurring on it)
       after which a warning alert will be issued.</para>
     </listitem>
     <listitem>
      <para>idleClose - the time a transaction can be idle for before the connection it is on is
       closed.</para>
     </listitem>
    </itemizedlist>
   </para>
   <para> The virtualhosts configuration is shown below, and must occur inside the
   //virtualhosts/virtualhost/name/ elements: </para>
   <example>
<title>Configuring producer transaction timeout</title>
   <programlisting><![CDATA[
<transactionTimeout>
    <openWarn>10000</openWarn>
    <openClose>20000</openClose>
    <idleWarn>5000</idleWarn>
    <idleClose>15000</idleClose>
</transactionTimeout>
   ]]></programlisting>
   </example>
  </section>

   <section role="h2" id="Java-Broker-Virtual-Host-Configuring-DLQ">
  <title>Configuring DLQs/Maximum Delivery Count</title>
  <para>In the below configuration it can be seen that DLQs/Maximum Delivery Count are enabled at
   the virtual host "localhost" with maximum delivery count set to 5 and disable for virtual host "dev-only".</para>
  <para>As 'dev-only-main-queue' has its own configuration specified, this value overrides all
   others and causes the features to be enabled for this queue. In contrast to this,
   'dev-only-other-queue' does not specify its own value and picks up the false value specified for
   its parent virtualhost, causing the DLQ/Maximum Delivery Count features to be disabled for this
   queue. Any such queue in the 'dev-only' virtualhost which does not specify its own configuration
   value will have the DLQ/Maximum Delivery Count feature disabled.</para>
  <para>The queue 'localhost-queue' has the DLQ/Maximum Delivery Count features disabled.
  Any other queue in the 'localhost' virtualhost which does not specify
   its own configuration value will have the features enabled (inherited from parent virtual host).</para>

  <example>
   <title>Enabling DLQs and maximum delivery count at virtualhost and queue level within
    virtualhosts.xml</title>
   <programlisting><![CDATA[<virtualhosts>
 ...
 <virtualhost>
  <name>dev-only</name>
  <dev-only>
   <queues>
    <deadLetterQueues>false</deadLetterQueues>
    <maximumDeliveryCount>0</maximumDeliveryCount>
    <queue>
     <name>dev-only-main-queue</name>
     <dev-only-main-queue>
      <deadLetterQueues>true</deadLetterQueues>
      <maximumDeliveryCount>3</maximumDeliveryCount>
     </dev-only-main-queue>
    </queue>
    <queue>
     <name>dev-only-other-queue</name>
    </queue>
   </queues>
  </dev-only>
 </virtualhost>
 <virtualhost>
  <name>localhost</name>
  <localhost>
   <queues>
    <deadLetterQueues>true</deadLetterQueues>
    <maximumDeliveryCount>5</maximumDeliveryCount>
    <queue>
     <name>localhost-queue</name>
     <deadLetterQueues>false</deadLetterQueues>
    </queue>
   </queues>
  </localhost>
 </virtualhost>
 ...
</virtualhosts>]]>
   </programlisting>
  </example>
 </section>


  <section role="h2" id="Java-Broker-Virtual-Host-Configuration-File-Example">
  <title>An example of virtual host configuration file</title>
  <example>
        <title>An example of virtual host configuration file</title>
        <programlisting><![CDATA[
<?xml version="1.0" encoding="ISO-8859-1"?>
<virtualhosts>
    <virtualhost>
        <name>localhost</name>
        <localhost>
            <store>
                <class>org.apache.qpid.server.store.MemoryMessageStore</class>
                <!--<class>org.apache.qpid.server.store.derby.DerbyMessageStore</class>
                <environment-path>${QPID_WORK}/derbystore/localhost</environment-path>-->
            </store>

            <housekeeping>
                <threadCount>2</threadCount>
                <checkPeriod>20000</checkPeriod>
            </housekeeping>

            <exchanges>
                <exchange>
                    <type>direct</type>
                    <name>test.direct</name>
                    <durable>true</durable>
                </exchange>
                <exchange>
                    <type>topic</type>
                    <name>test.topic</name>
                </exchange>
            </exchanges>
            <queues>
                <exchange>amq.direct</exchange>
                <maximumQueueDepth>4235264</maximumQueueDepth>
                <!-- 4Mb -->
                <maximumMessageSize>2117632</maximumMessageSize>
                <!-- 2Mb -->
                <maximumMessageAge>600000</maximumMessageAge>
                <!-- 10 mins -->
                <maximumMessageCount>50</maximumMessageCount>
                <!-- 50 messages -->

                <queue>
                    <name>queue</name>
                </queue>
                <queue>
                    <name>ping</name>
                </queue>
                <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>

    <virtualhost>
        <name>development</name>
        <development>
            <store>
                <class>org.apache.qpid.server.store.MemoryMessageStore</class>
                <!--<class>org.apache.qpid.server.store.derby.DerbyMessageStore</class>
                <environment-path>${QPID_WORK}/derbystore/development</environment-path>-->
            </store>

            <queues>
                <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
                <maximumMessageCount>50</maximumMessageCount>
                <queue>
                    <name>queue</name>
                    <queue>
                        <exchange>amq.direct</exchange>
                        <maximumQueueDepth>4235264</maximumQueueDepth>
                        <!-- 4Mb -->
                        <maximumMessageSize>2117632</maximumMessageSize>
                        <!-- 2Mb -->
                        <maximumMessageAge>600000</maximumMessageAge>
                        <!-- 10 mins -->
                    </queue>
                </queue>
                <queue>
                    <name>ping</name>
                    <ping>
                        <exchange>amq.direct</exchange>
                        <maximumQueueDepth>4235264</maximumQueueDepth>
                        <!-- 4Mb -->
                        <maximumMessageSize>2117632</maximumMessageSize>
                        <!-- 2Mb -->
                        <maximumMessageAge>600000</maximumMessageAge>
                        <!-- 10 mins -->
                    </ping>
                </queue>
            </queues>
        </development>
    </virtualhost>

    <virtualhost>
        <name>test</name>
        <test>
            <store>
                <!--<class>org.apache.qpid.server.store.MemoryMessageStore</class>-->
                <class>org.apache.qpid.server.store.derby.DerbyMessageStore</class>
                <environment-path>${QPID_WORK}/derbystore/test</environment-path>
            </store>

            <queues>
                <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
                <maximumMessageCount>50</maximumMessageCount>
                <queue>
                    <name>queue</name>
                    <queue>
                        <exchange>amq.direct</exchange>
                        <maximumQueueDepth>4235264</maximumQueueDepth>
                        <!-- 4Mb -->
                        <maximumMessageSize>2117632</maximumMessageSize>
                        <!-- 2Mb -->
                        <maximumMessageAge>600000</maximumMessageAge>
                        <!-- 10 mins -->
                    </queue>
                </queue>
                <queue>
                    <name>ping</name>
                    <ping>
                        <exchange>amq.direct</exchange>
                        <maximumQueueDepth>4235264</maximumQueueDepth>
                        <!-- 4Mb -->
                        <maximumMessageSize>2117632</maximumMessageSize>
                        <!-- 2Mb -->
                        <maximumMessageAge>600000</maximumMessageAge>
                        <!-- 10 mins -->
                    </ping>
                </queue>
            </queues>
        </test>
    </virtualhost>
</virtualhosts>
        ]]></programlisting>
      </example>
  </section>

</chapter>