<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.8.0.xsd"> | |
<!-- Allows us to use external properties as variables in this configuration file --> | |
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> | |
<property name="location"> | |
<value>file:conf/your.activemq.properties</value> | |
</property> | |
<property name="properties"> | |
<props> | |
<prop key="conf.db.host">database-host:database-port</prop> | |
<prop key="conf.db.un">database-username</prop> | |
<prop key="conf.db.pw">database-password</prop> | |
<prop key="data.dir">data</prop> | |
</props> | |
</property> | |
</bean> | |
<broker xmlns="http://activemq.apache.org/schema/core" | |
useJmx="true" | |
brokerName="mybroker" | |
useShutdownHook="false" | |
persistent="true" | |
start="false" | |
schedulerSupport="false" | |
enableStatistics="false" | |
offlineDurableSubscriberTimeout="259200000" | |
offlineDurableSubscriberTaskSchedule="3600000"> | |
<!--persistenceAdapter> | |
<jdbcPersistenceAdapter createTablesOnStartup="false" dataSource="#postgresql-activemq-ds"> | |
<adapter> | |
<postgresql-jdbc-adapter/> | |
</adapter> | |
</jdbcPersistenceAdapter> | |
</persistenceAdapter--> | |
<persistenceAdapter> | |
<kahaDB directory="${data.dir}/activemq-data/kaha" indexCacheSize="20000" ignoreMissingJournalfiles="true" checkForCorruptJournalFiles="true" checksumJournalFiles="true"/> | |
</persistenceAdapter> | |
<!-- The transport connectors ActiveMQ will listen to. Set the same for the serverUrl in the tomee.xml file --> | |
<transportConnectors> | |
<!--Local broker--> | |
<transportConnector name="vm" uri="vm://mybroker?waitForStart=30000&async=true"/> | |
<!--Allow remote connections--> | |
<transportConnector name="nio" enableStatusMonitor="true" uri="nio://0.0.0.0:54545?soTimeout=60000&daemon=true&keepAlive=true&connectionTimeout=120000&wireFormat.tcpNoDelayEnabled=true&wireFormat.maxInactivityDuration=240000&wireFormat.maxInactivityDurationInitalDelay=120000"/> | |
</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://${conf.db.host}/openejb_activemq"/> | |
<property name="username" value="${conf.db.un}"/> | |
<property name="password" value="${conf.db.pw}"/> | |
<property name="poolPreparedStatements" value="true"/> | |
</bean--> | |
</beans> |