activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: XBean and Spring 2.0
Date Tue, 10 Oct 2006 12:08:36 GMT
On 10/9/06, nlif <> wrote:
> What is the difference (or relationship) between the ActiveMQ XBean syntax
> and Spring 2.0 syntax?

ActiveMQ XBean is XML syntax (and has an XSD), Spring 2 isn't syntax,
its just a hook into Spring's parser so a component can do its own XML
parsing. So ActiveMQ XBean can be used inside a regular Spring 2 file
to parse ActiveMQ configuration files

>  Are they alternatives to each other? Are they
> complementing?

Complementing. ActiveMQ XBean XML can use Spring 2's hook - it also
works in Spring 1

> We're now migrating to Spring 2.0, so if we can use just that, without any
> dependency on XBean, then that would be just fine.

XBean does the parsing of the XML - Spring doesn't - it just gives you
a hook where you can manually parse the DOM and construct your beans.
We basically don't wanna do that by hand, so XBean generates that for

Think of XBean as JAXB2 for Spring

> Furthermore, it's really
> convenient to have auto-complete in the XML editor, which I'm not sure is
> possible with the XBean  syntax. Or maybe I'm wrong on that as well... :-(

I'm afraid so :)

Just use the XSD definition of ActiveMQ's XML inside your spring.xml
(or activemq.xml) and you get IDE completion. Though we could improve
the auto-generated XSD some more

> ps - all the sample XMLs that I could find (e.g. in the AcrtiveMQ tests)
> seem to be snippets, that is, they are not complete valid XMLs as is.

You've lost me there? You mean on the website or in the source code?
The source code is all valid XML, we often just show relevant snippets
on the website

Here's a regular Spring 2 XML file using ActiveMQ's XML inside it to
configure a broker & destinations & a connection factory

Here's an example Spring XML for Spring 2 which configures ActiveMQ,
ActiveMQ Resource Adapter and Jencks all using Spring 2 with XSD
validation (and so completion)



View raw message