This page contains a link to the XML reference guides and XML schema documents for Xml Configuration with ActiveMQ releases
If you are using XBean to parse the XML configurations, the XML validation is optional so you do not need to specify the XML Schema Locations. However if you are using [Spring]'s 2.0 XML handling to parse the XML then you need to refer to the XSD locations in your XML document because Spring uses schema namespace or schema location to resolve namespace handlers. Without correct namespace definition you will get messages like below:
You can refer to a specific version of the XSD in your XML as follows
or if you prefer you can use a generic XSD without the version number
Your IDE won't be able to fetch this XSD, you'll have to manually associate a specific release; however it does mean that you won't have to upgrade your XML config file with each ActiveMQ release; as it will resolve this XSD using the bundled XSD inside the activemq-core.jar.
If you use ActiveMQ 5.0 or earlier you XML namespace definition should point to http://activemq.org/config/1.0. If you use ActiveMQ 5.1 or later the namespace should point to http://activemq.apache.org/schema/core.
Both examples above are almost the same. Only one difference is xml namespace. You can find more information about the namespace change on activemq-dev topic: ActiveMQ namespace change.
Note: The xml configuration ordering constraint is removed in 5.6, the broker element
XMLSchema:sequence is replaced with an XMLSchema:all
Note: from version 5.4.2, you can disable validation from the command line by appending a query parameter to the xbean url. This will allow you to reuse your existing xml configuration 'as is' if needed.
Beginning in ActiveMQ 5.4, the XML elements inside the <broker> element must be ordered alphabetically. If you look at the XSD, this has always been the case with ActiveMQ. The difference in 5.4 is that the XML configuration is actually being validated against the XML schema.
For example, the following XML configuration did not present a problem in ActiveMQ 5.3.x:
However, in ActiveMQ 5.4, the XML configuration above would cause an exception similar to the following:
To avoid this XML validation error in ActiveMQ 5.4, simply change the ordering of the XML elements so that they are in alphabetical order. Below is an example of the same XML configuration but in alphabetical order:
Configurations can be easily tested against ActiveMQ 5.4 using the ActiveMQ startup script. Below is an example: