Hi all,
as you know, ActiveMQ is used in ServiceMix as default message broker.
ServiceMix 3.3.x uses Spring configuration and loads the ActiveMQ bean
in activemq.xml Spring file:
<beans xmlns:amq="http://activemq.apache.org/schema/core">
<!-- ActiveMQ JMS Broker configuration -->
<amq:broker id="broker" depends-on="jmxServer" useShutdownHook="false">
<!-- Disable creation of the jmx connector
which is created in the jmx.xml configuration file -->
<amq:managementContext>
<bean class="org.apache.activemq.broker.jmx.ManagementContext">
<property name="createConnector" value="false" />
</bean>
</amq:managementContext>
<!-- Use AMQ Message Store as default broker persistence adapter -->
<amq:persistenceAdapter>
<amq:amqPersistenceAdapter directory="file:./data/amq"/>
<!-- Examples for journaledJDBC if JDBC is required -->
<!--
<amq:journaledJDBC journalLogFiles="5" dataDirectory="./data/amq"/>
<amq:journaledJDBC journalLogFiles="5" dataDirectory="../data"
dataSource="#postgres-ds"/>
-->
</amq:persistenceAdapter>
<amq:transportConnectors>
<!-- Activate a TCP connector with multicast discovery.
Note that multicast may be disabled if your computer
is not on a network, which may prevent the broker to start.
In such a case, just remove the discoveryUri attribute.
-->
<amq:transportConnector uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
</amq:transportConnectors>
<amq:networkConnectors>
<!-- by default just auto discover the other brokers -->
<amq:networkConnector uri="multicast://default"/>
<!--
<amq:networkConnector
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
-->
</amq:networkConnectors>
</amq:broker>
</beans>
Up to ActiveMQ 5.3.1, we didn't encounter any issue with that.
But now, I updated ServiceMix 3.3.x to use ActiveMQ 5.3.2 and I got the
following at startup:
Caught: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'broker' defined in class path resource
[activemq.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.apache.activemq.xbean.XBeanBrokerService]:
Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError: org/osgi/framework/BundleException
It looks like ActiveMQ 5.3.2 bean now have a dependency to OSGi framework.
As ServiceMix 3.3.x doesn't use OSGi at all (pure Spring), I'm not very
pleased to add OSGi framework in the distribution classpath.
Moreover, for ActiveMQ, I think that this dependency is not very
flexible for users that use ActiveMQ "outside" OSGi.
Is it possible to define this dependency as an optional one ?
What do you think ?
FYI, I raise the following Jira task about this:
https://issues.apache.org/activemq/browse/SM-1958
Thanks
Regards
JB