Skip to content

Instantly share code, notes, and snippets.

@leon-anavi
Created March 4, 2015 22:45
Show Gist options
  • Save leon-anavi/c57d5f1385d7aba2c91a to your computer and use it in GitHub Desktop.
Save leon-anavi/c57d5f1385d7aba2c91a to your computer and use it in GitHub Desktop.
OpenShift JBoss A-MQ Configuration for MQTT Broker
<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"
>
<!-- Allows us to use system properties and fabric as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="properties">
<bean class="org.fusesource.mq.fabric.ConfigurationProperties" />
</property>
<property name="searchSystemEnvironment" value="true" />
</bean>
<bean class="org.apache.activemq.broker.PublishedAddressPolicy" id="addressPolicy">
<property name="portMapping">
<map>
<entry key="${OPENSHIFT_FUSE_AMQ_PORT}" value="${OPENSHIFT_FUSE_AMQ_PROXY_PORT}" />
</map>
</property>
</bean>
<broker brokerName="${broker-name}" dataDirectory="${data}" start="false" xmlns="http://activemq.apache.org/schema/core">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry producerFlowControl="true" topic="\>">
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000" />
</pendingMessageLimitStrategy>
</policyEntry>
<policyEntry memoryLimit="1mb" producerFlowControl="true" queue=">" />
</policyEntries>
</policyMap>
</destinationPolicy>
<managementContext>
<managementContext createConnector="false" />
</managementContext>
<persistenceAdapter>
<kahaDB directory="${data}/kahadb" />
</persistenceAdapter>
<!--<plugins>
<jaasAuthenticationPlugin configuration="karaf" />
</plugins>-->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="64 mb" />
</memoryUsage>
<storeUsage>
<storeUsage limit="100 gb" />
</storeUsage>
<tempUsage>
<tempUsage limit="50 gb" />
</tempUsage>
</systemUsage>
</systemUsage>
<transportConnectors>
<transportConnector name="openwire" publishedAddressPolicy="#addressPolicy" uri="tcp://${OPENSHIFT_FUSE_IP}:${OPENSHIFT_FUSE_AMQ_PORT}" />
<transportConnector name="mqtt" publishedAddressPolicy="#addressPolicy" uri="mqtt://${OPENSHIFT_FUSE_IP}:1883" />
</transportConnectors>
</broker>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment