Hi,
I was thinking we could change the virtualhosts.xml so that structures like:


<queue>
       <name>test-queue</name>
        <test-queue>
              <exchange>test.direct</exchange>
              <durable>true</durable>
         </test-queue>
 </queue>

which make the validation of the xml file cumbersome would be replaced with
something like:

<queue name="test-queue">
              <exchange>test.direct</exchange>
              <durable>true</durable>
 </queue>

which could be simple to validate and would make the configuration much
easier to read. With this, we can validate
the whole configuration (config.xml + virtualhosts.xml) given that in
config.xml we do not allow the definition of virtualhosts anymore but only a
pointer to virtualhosts.xml file. The same situation applies to virtualhost
and queue tags.
Also, we would be in a position to provide a command line option that would
only validate the configuration without starting the broker.
I am attaching an example of virtualhosts.xml along with a DTD (XSD coming
shortly).
Raised QPID-2544 to track the progress.

Thoughts? Comments?

TIA,

-- 
Sorin S
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE virtualhosts SYSTEM "virtualhosts.dtd">
<!--
 -
 - 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.
 -
 -->
<virtualhosts>
    <default>test</default>
    <virtualhost name="localhost">
            <store>
                <class>org.apache.qpid.server.store.MemoryMessageStore
                </class>
            </store>

            <housekeeping>
                <expiredMessageCheckPeriod>20000</expiredMessageCheckPeriod>
            </housekeeping>

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

                <queue name="queue"/>
                <queue name="ping"/>
                <queue name="test-queue">
                        <exchange name="test.direct"/>
                        <durable>true</durable>
                </queue>
                <queue name="test-ping">
                        <exchange name="test.direct"/>
                </queue>
            </queues>
    </virtualhost>


    <virtualhost name="development">
            <store>
                <class>org.apache.qpid.server.store.MemoryMessageStore
                </class>
            </store>

            <queues>
                <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
                <maximumMessageCount>50</maximumMessageCount>
                <queue name="queue">
                        <exchange>amq.direct</exchange>
                        <maximumQueueDepth>4235264</maximumQueueDepth>
                        <!-- 4Mb -->
                        <maximumMessageSize>2117632</maximumMessageSize>
                        <!-- 2Mb -->
                        <maximumMessageAge>600000</maximumMessageAge>
                        <!-- 10 mins -->
                </queue>
                <queue name="ping">
                        <exchange>amq.direct</exchange>
                        <maximumQueueDepth>4235264</maximumQueueDepth>
                        <!-- 4Mb -->
                        <maximumMessageSize>2117632</maximumMessageSize>
                        <!-- 2Mb -->
                        <maximumMessageAge>600000</maximumMessageAge>
                        <!-- 10 mins -->
                </queue>
            </queues>
    </virtualhost>
    <virtualhost name="test">
            <store>
                <class>org.apache.qpid.server.store.MemoryMessageStore
                </class>
            </store>

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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to