Skip to content

Commit

Permalink
Active mq config and tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
rsanheim committed Oct 9, 2009
1 parent f850eb3 commit bcc4056
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
79 changes: 79 additions & 0 deletions config/activemq.xml
@@ -0,0 +1,79 @@
<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.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">

<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:///${activemq.base}/conf/credentials.properties</value>
</property>
</bean>

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data">

<!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">" memoryLimit="5mb"/>
<policyEntry topic=">" memoryLimit="5mb">
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>

<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
<managementContext>
<managementContext createConnector="false"/>
</managementContext>

<persistenceAdapter>
<amqPersistenceAdapter syncOnWrite="false" directory="${activemq.base}/data" maxFileLength="20 mb"/>
</persistenceAdapter>

<sslContext>
<sslContext keyStore="file:${activemq.base}/conf/broker.ks" keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts" trustStorePassword="password"/>
</sslContext>

<!-- The maximum about of space the broker will use before slowing down producers -->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>


<!-- The transport connectors ActiveMQ will listen to -->
<transportConnectors>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors>

</broker>


<!-- An embedded servlet engine for serving up the Admin console -->
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
<connectors>
<nioConnector port="8161"/>
</connectors>

<handlers>
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
<webAppContext contextPath="/fileserver" resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
</handlers>
</jetty>

</beans>
<!-- END SNIPPET: example -->
13 changes: 13 additions & 0 deletions lib/tasks/activemq.rake
@@ -0,0 +1,13 @@
namespace :activemq do
desc "Start ActiveMQ"
task :start do
system("$ACTIVEMQ_HOME/bin/activemq xbean:file:./config/activemq.xml &") || abort("Starting ActiveMQ failed")
end

desc "Stop ActiveMQ"
task :stop do
pid = `ps -ax |grep [a]ctivemq.xml|awk '{print $1}'`
puts "Stopping ActiveMQ at PID #{pid}"
system("kill #{pid}") || abort("Stoppin ActiveMQ failed")
end
end

0 comments on commit bcc4056

Please sign in to comment.