Well if I broke it then I should at least try and fix it, but I have to say I have been using this extensively for quite a while now. It is fair to say that I restart the standalone server at least 50 times a day during testing and have not had a problem with ActiveMQ5.

However, I am using a custom configuration. So here is my configuration:

<Resource id="JMSResourceAdapter" type="ActiveMQResourceAdapter">
        # Broker configuration URI as defined by ActiveMQ
        # see http://activemq.apache.org/broker-configuration-uri.html
        BrokerXmlConfig xbean:file:conf/activemq.xml

        # Broker address
ServerUrl tcp://127.0.0.1:54545?keepAlive=true&amp;wireFormat.maxInactivityDuration=0
</Resource>

Using the following activemq.xml ([openejb]/conf/activemq.xml):

<beans
        xmlns="http://www.springframework.org/schema/beans";
        xmlns:amq="http://activemq.apache.org/schema/core";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd";>


<!-- Allows us to use system properties as variables in this configuration file --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

<broker xmlns="http://activemq.apache.org/schema/core";
            useJmx="false"
            brokerName="myserver"
            useShutdownHook="true"
            persistent="true"
            dataDirectory="data/activemq"
>

<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#postgresql-activemq-ds" lockKeepAlivePeriod="0"/>
</persistenceAdapter>

<!-- The transport connectors ActiveMQ will listen to -->
<transportConnectors>
<transportConnector uri="tcp://0.0.0.0:54545?keepAlive=true&amp;wireFormat.maxInactivityDuration=0"/>
</transportConnectors>


</broker>

<bean id="postgresql-activemq-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.postgresql.Driver"/>
<property name="url" value="jdbc:postgresql://myhost:5432/openejb_activemq"/>
<property name="username" value="myuser"/>
<property name="password" value="mypassword"/>
<property name="poolPreparedStatements" value="true"/>
</bean>

</beans>

I will have a play with the default configuration to see if something needs to be weaved into the standard set-up.

Andy.


Reply via email to