You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by rattaman <zb...@gmail.com> on 2015/02/03 18:47:43 UTC

Split ActiveMQ broker configuration into multiple files.

Hello,
I want to split configuration of the ActiveMQ Broker into two files. The
first one will contain the general configuration of the broker and the other
one will contain a list of predefined virtual destinations. We want to
generate those queues automaticaly based on some external data and so we
don't want to put it in the same file as the broker configuration.

Here is a general idea with queues instead of virtual destinations.

File 1: activemq.xml
<beans ...>
  <broker ...>

  </broker>
</beans>

File 2: queues.xml
<beans ...>
  <broker ...>
    <destinations>
      <queue physicalName="q1"/>
    </destinations>
  </broker>
</beans>

I tried to use:

Spring import:
<import resource="queues.xml"/>

but got

ERROR: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#1'
defined in class path resource [queues.xml]: Invocation of init method
failed; nested exception is javax.management.InstanceAlreadyExistsException:
org.apache.activemq:type=Broker,brokerName=localhost
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.activemq.xbean.XBeanBrokerService#1' defined in class
path resource [queues.xml]: Invocation of init method failed; nested
exception is javax.management.InstanceAlreadyExistsException:
org.apache.activemq:type=Broker,brokerName=localhost

which is kind of what one could expect.

I also tried to use XInclude but my parser doesn't support this, and DTD
entity, but you can't use it together with XSD.

Any ideas? 

Best regards
Zbigniew Malec



--
View this message in context: http://activemq.2283324.n4.nabble.com/Split-ActiveMQ-broker-configuration-into-multiple-files-tp4690947.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Split ActiveMQ broker configuration into multiple files.

Posted by rattaman <zb...@gmail.com>.
I tried to use XML entities before, but failed at the validation step. Looks
like it works if you disable it.

Thank you.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Split-ActiveMQ-broker-configuration-into-multiple-files-tp4690947p4691285.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Split ActiveMQ broker configuration into multiple files.

Posted by artnaseef <ar...@artnaseef.com>.
Left this out:

*activemq.xml*

...
        <destinations>
            &virtualDestinations;
        </destinations>
...




--
View this message in context: http://activemq.2283324.n4.nabble.com/Split-ActiveMQ-broker-configuration-into-multiple-files-tp4690947p4690995.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Split ActiveMQ broker configuration into multiple files.

Posted by artnaseef <ar...@artnaseef.com>.
The following works for me:

*activemq.xml*


*virtualDestinations.txt*


On startup of the broker, you need to add "?validate=false" to the xbean
url, like this:

    *bin/activemq start 'xbean:conf/activemq.xml?validate=false'*




--
View this message in context: http://activemq.2283324.n4.nabble.com/Split-ActiveMQ-broker-configuration-into-multiple-files-tp4690947p4690949.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.