You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2013/07/12 14:46:31 UTC
svn commit: r869232 [19/44] - in /websites/production/activemq/content: ./
cache/ cms/ nms/ styles/highlighter/ styles/highlighter/scripts/
styles/highlighter/styles/ visualisation.thumbs/ web-console.thumbs/
Modified: websites/production/activemq/content/jms-to-jms-bridge.html
==============================================================================
--- websites/production/activemq/content/jms-to-jms-bridge.html (original)
+++ websites/production/activemq/content/jms-to-jms-bridge.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,17 @@
</style>
<![endif]-->
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
+
<title>
Apache ActiveMQ ™ -- JMS to JMS Bridge
</title>
@@ -50,8 +61,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -80,14 +91,14 @@
<p>e.g. in your Spring XML file just add:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag"><camelContext xmlns=<span class="code-quote">"http://camel.apache.org/schema/spring"</span>></span>
- <span class="code-tag"><route></span>
- <span class="code-tag"><from uri=<span class="code-quote">"mqseries:Foo.Bar"</span>/></span>
- <span class="code-tag"><to uri=<span class="code-quote">"activemq:Cheese"</span>/></span>
- <span class="code-tag"></route></span>
-<span class="code-tag"></camelContext></span>
-</pre>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="mqseries:Foo.Bar"/>
+ <to uri="activemq:Cheese"/>
+ </route>
+</camelContext>
+]]></script>
</div></div></td></tr></table></div>
<p>ActiveMQ provides bridging functionality to other JMS providers that implement the JMS 1.0.2 and above specification.<br clear="none">
@@ -141,141 +152,142 @@ In order to support JMS 1.0.2 there is s
<p>The following <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/network/jms/queue-xbean.xml">example config file</a> shows how to use the regular <a shape="rect" href="xml-configuration.html" title="Xml Configuration">Xml Configuration</a> to configure a JMS to JMS bridge.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml"><broker xmlns=<span class="code-quote">"http://activemq.apache.org/schema/core"</span> id=<span class="code-quote">"localbroker"</span>
- brokerName=<span class="code-quote">"localBroker"</span> persistent=<span class="code-quote">"false"</span>>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<broker xmlns="http://activemq.apache.org/schema/core" id="localbroker"
+ brokerName="localBroker" persistent="false">
- <span class="code-tag"><jmsBridgeConnectors></span>
+ <jmsBridgeConnectors>
<jmsQueueConnector
- outboundQueueConnectionFactory=<span class="code-quote">"#remoteFactory"</span>>
- <span class="code-tag"><inboundQueueBridges></span>
+ outboundQueueConnectionFactory="#remoteFactory">
+ <inboundQueueBridges>
<inboundQueueBridge
- inboundQueueName=<span class="code-quote">"org.apache.activemq.network.jms.QueueBridgeXBeanTest"</span> />
- <span class="code-tag"></inboundQueueBridges></span>
- <span class="code-tag"></jmsQueueConnector></span>
- <span class="code-tag"></jmsBridgeConnectors></span>
-
- <span class="code-tag"><transportConnectors></span>
- <span class="code-tag"><transportConnector uri=<span class="code-quote">"tcp://localhost:61234"</span> /></span>
- <span class="code-tag"></transportConnectors></span>
-
-<span class="code-tag"></broker></span>
-
-<span class="code-tag"><span class="code-comment"><!-- JMS ConnectionFactory to use remote --></span></span>
-<bean id=<span class="code-quote">"remoteFactory"</span>
- class=<span class="code-quote">"org.apache.activemq.ActiveMQConnectionFactory"</span>>
- <span class="code-tag"><property name=<span class="code-quote">"brokerURL"</span> value=<span class="code-quote">"tcp://localhost:61666"</span> /></span>
-<span class="code-tag"></bean></span>
-</pre>
+ inboundQueueName="org.apache.activemq.network.jms.QueueBridgeXBeanTest" />
+ </inboundQueueBridges>
+ </jmsQueueConnector>
+ </jmsBridgeConnectors>
+
+ <transportConnectors>
+ <transportConnector uri="tcp://localhost:61234" />
+ </transportConnectors>
+
+</broker>
+
+<!-- JMS ConnectionFactory to use remote -->
+<bean id="remoteFactory"
+ class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61666" />
+</bean>
+]]></script>
</div></div>
<h3><a shape="rect" name="JMStoJMSBridge-ExamplepureSpringConfiguration"></a>Example pure Spring Configuration</h3>
<p>The following example shows how to use raw Spring XML to wire together a broker - bridging to a Foreign JMS provider</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag"><span class="code-comment"><!-- local broker with embedded Jms to Jms bridge (ok - it's contrived) --></span></span>
- <bean id=<span class="code-quote">"localbroker"</span> class=<span class="code-quote">"org.apache.activemq.broker.BrokerService"</span>
- init-method=<span class="code-quote">"start"</span>>
- <span class="code-tag"><property name=<span class="code-quote">"brokerName"</span> value = <span class="code-quote">"localBroker"</span>/></span>
- <span class="code-tag"><property name=<span class="code-quote">"persistent"</span> value = <span class="code-quote">"false"</span>/></span>
- <span class="code-tag"><property name=<span class="code-quote">"transportConnectorURIs"</span>></span>
- <span class="code-tag"><list></span>
- <span class="code-tag"><value></span>tcp://localhost:61234<span class="code-tag"></value></span>
- <span class="code-tag"></list></span>
- <span class="code-tag"></property></span>
- <span class="code-tag"><property name=<span class="code-quote">"jmsBridgeConnectors"</span>></span>
- <span class="code-tag"><list></span>
- <span class="code-tag"><ref bean=<span class="code-quote">"jmsConnector"</span>/></span>
- <span class="code-tag"></list></span>
- <span class="code-tag"></property></span>
- <span class="code-tag"></bean></span>
-
- <span class="code-tag"><span class="code-comment"><!-- JMS ConnectionFactory to use local broker (the one with the bridge) --></span></span>
- <bean id=<span class="code-quote">"localFactory"</span>
- class=<span class="code-quote">"org.apache.activemq.ActiveMQConnectionFactory"</span>>
- <span class="code-tag"><property name=<span class="code-quote">"brokerURL"</span> value=<span class="code-quote">"tcp://localhost:61234"</span> /></span>
- <span class="code-tag"></bean></span>
-
- <span class="code-tag"><span class="code-comment"><!--JmsTopicConnector - the Jms bridge --></span></span>
- <bean id=<span class="code-quote">"jmsConnector"</span>
- class=<span class="code-quote">"org.apache.activemq.network.jms.JmsTopicConnector"</span>>
- <span class="code-tag"><property name = <span class="code-quote">"outboundTopicConnectionFactory"</span> ref = <span class="code-quote">"remoteFactory"</span>/></span>
-
- <span class="code-tag"><property name = <span class="code-quote">"inboundTopicBridges"</span>></span>
- <span class="code-tag"><list></span>
- <span class="code-tag"><ref bean=<span class="code-quote">"InboundTopicBridge"</span> /></span>
- <span class="code-tag"></list></span>
- <span class="code-tag"></property></span>
-
- <span class="code-tag"></bean></span>
-
- <span class="code-tag"><bean id =<span class="code-quote">"InboundTopicBridge"</span> class=<span class="code-quote">"org.apache.activemq.network.jms.InboundTopicBridge"</span>></span>
- <span class="code-tag"><property name = <span class="code-quote">"inboundTopicName"</span> value = <span class="code-quote">"org.apache.activemq.network.jms.TopicBridgeSpringTest"</span>/></span>
- <span class="code-tag"></bean></span>
-<span class="code-tag"></beans></span>
-</pre>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<!-- local broker with embedded Jms to Jms bridge (ok - it's contrived) -->
+ <bean id="localbroker" class="org.apache.activemq.broker.BrokerService"
+ init-method="start">
+ <property name="brokerName" value = "localBroker"/>
+ <property name="persistent" value = "false"/>
+ <property name="transportConnectorURIs">
+ <list>
+ <value>tcp://localhost:61234</value>
+ </list>
+ </property>
+ <property name="jmsBridgeConnectors">
+ <list>
+ <ref bean="jmsConnector"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- JMS ConnectionFactory to use local broker (the one with the bridge) -->
+ <bean id="localFactory"
+ class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61234" />
+ </bean>
+
+ <!--JmsTopicConnector - the Jms bridge -->
+ <bean id="jmsConnector"
+ class="org.apache.activemq.network.jms.JmsTopicConnector">
+ <property name = "outboundTopicConnectionFactory" ref = "remoteFactory"/>
+
+ <property name = "inboundTopicBridges">
+ <list>
+ <ref bean="InboundTopicBridge" />
+ </list>
+ </property>
+
+ </bean>
+
+ <bean id ="InboundTopicBridge" class="org.apache.activemq.network.jms.InboundTopicBridge">
+ <property name = "inboundTopicName" value = "org.apache.activemq.network.jms.TopicBridgeSpringTest"/>
+ </bean>
+</beans>
+]]></script>
</div></div>
<h3><a shape="rect" name="JMStoJMSBridge-ExampleXBeanConfigurationtoBridgeActiveMQtoProviderWithNoURLSetter"></a>Example XBean Configuration to Bridge ActiveMQ to Provider With No URL Setter</h3>
<p>Some JMS providers, WebLogic for instance, do not expose a setter for connection properties like host and port (setBrokerUrl) on their ConnectionFactory object. In this case you need to set outboundQueueConnectionFactoryName and jndiOutboundTemplate in your activemq.xml config file.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag"><span class="code-comment"><!-- START SNIPPET: example --></span></span>
-<span class="code-tag"><beans></span>
-
- <span class="code-tag"><span class="code-comment"><!-- Allows us to use system properties as variables in this configuration file --></span></span>
- <span class="code-tag"><bean class=<span class="code-quote">"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"</span>/></span>
-
- <span class="code-tag"><broker useJmx=<span class="code-quote">"true"</span> xmlns=<span class="code-quote">"http://activemq.org/config/1.0"</span>></span>
-
- <span class="code-tag"><persistenceAdapter></span>
- <span class="code-tag"><journaledJDBC journalLogFiles=<span class="code-quote">"5"</span> dataDirectory=<span class="code-quote">"${activemq.home}/activemq-data"</span>/></span>
- <span class="code-tag"></persistenceAdapter></span>
-
- <span class="code-tag"><transportConnectors></span>
- <span class="code-tag"><transportConnector name=<span class="code-quote">"default"</span> uri=<span class="code-quote">"tcp://localhost:61616"</span> discoveryUri=<span class="code-quote">"multicast://default"</span>/></span>
- <span class="code-tag"><transportConnector name=<span class="code-quote">"stomp"</span> uri=<span class="code-quote">"stomp://localhost:61613"</span>/></span>
- <span class="code-tag"></transportConnectors></span>
-
- <span class="code-tag"><networkConnectors></span>
- <span class="code-tag"><networkConnector name=<span class="code-quote">"default"</span> uri=<span class="code-quote">"multicast://default"</span>/></span>
- <span class="code-tag"></networkConnectors></span>
-
- <span class="code-tag"><jmsBridgeConnectors></span>
- <jmsQueueConnector name=<span class="code-quote">"JreportRequestBridge-Inbound"</span>
- jndiOutboundTemplate=<span class="code-quote">"#remoteJndi"</span>
- outboundQueueConnectionFactoryName=<span class="code-quote">"jms/ConnectionFactory"</span>
- localQueueConnectionFactory=<span class="code-quote">"#localFactory"</span>>
- <span class="code-tag"><inboundQueueBridges></span>
- <span class="code-tag"><inboundQueueBridge inboundQueueName=<span class="code-quote">"jms/queue/jreport/request"</span>/></span>
- <span class="code-tag"></inboundQueueBridges></span>
- <span class="code-tag"></jmsQueueConnector></span>
- <span class="code-tag"></jmsBridgeConnectors></span>
-
- <span class="code-tag"></broker></span>
-
- <span class="code-tag"><span class="code-comment"><!-- Set up the template for connecting to Weblogic --></span></span>
- <span class="code-tag"><bean id=<span class="code-quote">"remoteJndi"</span> class=<span class="code-quote">"org.springframework.jndi.JndiTemplate"</span>></span>
- <span class="code-tag"><property name=<span class="code-quote">"environment"</span>></span>
- <span class="code-tag"><props></span>
- <span class="code-tag"><prop key=<span class="code-quote">"java.naming.factory.initial"</span>></span>weblogic.jndi.WLInitialContextFactory<span class="code-tag"></prop></span>
- <span class="code-tag"><prop key=<span class="code-quote">"java.naming.provider.url"</span>></span>t3://<span class="code-tag"><your ip here></span>:7001<span class="code-tag"></prop></span>
- <span class="code-tag"></props></span>
- <span class="code-tag"></property></span>
- <span class="code-tag"></bean></span>
-
- <bean id=<span class="code-quote">"localFactory"</span>
- class=<span class="code-quote">"org.apache.activemq.ActiveMQConnectionFactory"</span>>
- <span class="code-tag"><property name=<span class="code-quote">"brokerURL"</span> value=<span class="code-quote">"tcp://localhost:61616"</span> /></span>
- <span class="code-tag"></bean></span>
-
- <span class="code-tag"><bean id=<span class="code-quote">"localQueue"</span> class=<span class="code-quote">"org.apache.activemq.command.ActiveMQQueue"</span>></span>
- <span class="code-tag"><constructor-arg value=<span class="code-quote">"dynamic/jms.queue.jreport.request"</span>/></span>
- <span class="code-tag"></bean></span>
-<span class="code-tag"></beans></span>
-<span class="code-tag"><span class="code-comment"><!-- END SNIPPET: xbean --></span></span>
-</pre>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<!-- START SNIPPET: example -->
+<beans>
+
+ <!-- Allows us to use system properties as variables in this configuration file -->
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
+ <broker useJmx="true" xmlns="http://activemq.org/config/1.0">
+
+ <persistenceAdapter>
+ <journaledJDBC journalLogFiles="5" dataDirectory="${activemq.home}/activemq-data"/>
+ </persistenceAdapter>
+
+ <transportConnectors>
+ <transportConnector name="default" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
+ <transportConnector name="stomp" uri="stomp://localhost:61613"/>
+ </transportConnectors>
+
+ <networkConnectors>
+ <networkConnector name="default" uri="multicast://default"/>
+ </networkConnectors>
+
+ <jmsBridgeConnectors>
+ <jmsQueueConnector name="JreportRequestBridge-Inbound"
+ jndiOutboundTemplate="#remoteJndi"
+ outboundQueueConnectionFactoryName="jms/ConnectionFactory"
+ localQueueConnectionFactory="#localFactory">
+ <inboundQueueBridges>
+ <inboundQueueBridge inboundQueueName="jms/queue/jreport/request"/>
+ </inboundQueueBridges>
+ </jmsQueueConnector>
+ </jmsBridgeConnectors>
+
+ </broker>
+
+ <!-- Set up the template for connecting to Weblogic -->
+ <bean id="remoteJndi" class="org.springframework.jndi.JndiTemplate">
+ <property name="environment">
+ <props>
+ <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
+ <prop key="java.naming.provider.url">t3://<your ip here>:7001</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="localFactory"
+ class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61616" />
+ </bean>
+
+ <bean id="localQueue" class="org.apache.activemq.command.ActiveMQQueue">
+ <constructor-arg value="dynamic/jms.queue.jreport.request"/>
+ </bean>
+</beans>
+<!-- END SNIPPET: xbean -->
+]]></script>
</div></div>
<h3><a shape="rect" name="JMStoJMSBridge-ExamplepureSpringConfigurationforsendingmessagestoexternalActiveMQdestinationthroughbridge"></a>Example pure Spring Configuration for sending messages to external ActiveMQ destination through bridge</h3>
@@ -283,83 +295,83 @@ In order to support JMS 1.0.2 there is s
<p>Spring beans:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag"><?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span>?></span>
-<span class="code-tag"><!DOCTYPE beans PUBLIC <span class="code-quote">"-//SPRING//DTD BEAN//EN"</span> <span class="code-quote">"http://www.springframework.org/dtd/spring-beans.dtd"</span>></span>
-
-<span class="code-tag"><beans></span>
-
- <span class="code-tag"><bean id=<span class="code-quote">"mainBroker"</span> class=<span class="code-quote">"org.apache.activemq.broker.BrokerService"</span> init-method=<span class="code-quote">"start"</span> destroy-method=<span class="code-quote">"stop"</span>></span>
- <span class="code-tag"><property name=<span class="code-quote">"brokerName"</span> value = <span class="code-quote">"mainBroker"</span>/></span>
- <span class="code-tag"><property name=<span class="code-quote">"persistent"</span> value=<span class="code-quote">"false"</span>/></span>
- <span class="code-tag"><property name=<span class="code-quote">"transportConnectorURIs"</span>></span>
- <span class="code-tag"><list></span>
- <span class="code-tag"><value></span>tcp://localhost:7000<span class="code-tag"></value></span>
- <span class="code-tag"></list></span>
- <span class="code-tag"></property></span>
- <span class="code-tag"></bean></span>
-
- <span class="code-tag"><bean id=<span class="code-quote">"bridgedBroker"</span> class=<span class="code-quote">"org.apache.activemq.broker.BrokerService"</span> init-method=<span class="code-quote">"start"</span> destroy-method=<span class="code-quote">"stop"</span>></span>
- <span class="code-tag"><property name=<span class="code-quote">"brokerName"</span> value = <span class="code-quote">"bridgedBroker"</span>/></span>
- <span class="code-tag"><property name=<span class="code-quote">"persistent"</span> value=<span class="code-quote">"false"</span>/></span>
- <span class="code-tag"><property name=<span class="code-quote">"transportConnectorURIs"</span>></span>
- <span class="code-tag"><list></span>
- <span class="code-tag"><value></span>tcp://localhost:7001<span class="code-tag"></value></span>
- <span class="code-tag"></list></span>
- <span class="code-tag"></property></span>
- <span class="code-tag"><property name=<span class="code-quote">"jmsBridgeConnectors"</span>></span>
- <span class="code-tag"><list></span>
- <span class="code-tag"><bean class=<span class="code-quote">"org.apache.activemq.network.jms.JmsQueueConnector"</span>></span>
- <span class="code-tag"><property name=<span class="code-quote">"outboundQueueConnectionFactory"</span>></span>
- <span class="code-tag"><bean class=<span class="code-quote">"org.apache.activemq.ActiveMQConnectionFactory"</span>></span>
- <span class="code-tag"><property name=<span class="code-quote">"brokerURL"</span> value=<span class="code-quote">"tcp://localhost:7000"</span> /></span>
- <span class="code-tag"></bean></span>
- <span class="code-tag"></property></span>
- <span class="code-tag"><property name=<span class="code-quote">"outboundQueueBridges"</span>></span>
- <span class="code-tag"><list></span>
- <span class="code-tag"><bean class=<span class="code-quote">"org.apache.activemq.network.jms.OutboundQueueBridge"</span>></span>
- <span class="code-tag"><constructor-arg value=<span class="code-quote">"messages.input"</span>/></span>
- <span class="code-tag"></bean></span>
- <span class="code-tag"></list></span>
- <span class="code-tag"></property></span>
- <span class="code-tag"></bean></span>
- <span class="code-tag"></list></span>
- <span class="code-tag"></property></span>
- <span class="code-tag"></bean></span>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+
+ <bean id="mainBroker" class="org.apache.activemq.broker.BrokerService" init-method="start" destroy-method="stop">
+ <property name="brokerName" value = "mainBroker"/>
+ <property name="persistent" value="false"/>
+ <property name="transportConnectorURIs">
+ <list>
+ <value>tcp://localhost:7000</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="bridgedBroker" class="org.apache.activemq.broker.BrokerService" init-method="start" destroy-method="stop">
+ <property name="brokerName" value = "bridgedBroker"/>
+ <property name="persistent" value="false"/>
+ <property name="transportConnectorURIs">
+ <list>
+ <value>tcp://localhost:7001</value>
+ </list>
+ </property>
+ <property name="jmsBridgeConnectors">
+ <list>
+ <bean class="org.apache.activemq.network.jms.JmsQueueConnector">
+ <property name="outboundQueueConnectionFactory">
+ <bean class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:7000" />
+ </bean>
+ </property>
+ <property name="outboundQueueBridges">
+ <list>
+ <bean class="org.apache.activemq.network.jms.OutboundQueueBridge">
+ <constructor-arg value="messages.input"/>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
-<span class="code-tag"></beans></span>
-</pre>
+</beans>
+]]></script>
</div></div>
<p>Java code:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
public class BridgeTest {
public BridgeTest() throws Exception {
Log log = LogFactory.getLog(getClass());
- new ClassPathXmlApplicationContext(<span class="code-quote">"bridge/context-bridge.xml"</span>);
+ new ClassPathXmlApplicationContext("bridge/context-bridge.xml");
- ActiveMQConnection connection = ActiveMQConnection.makeConnection(<span class="code-quote">"tcp://localhost:7001"</span>);
+ ActiveMQConnection connection = ActiveMQConnection.makeConnection("tcp://localhost:7001");
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Destination destination = session.createQueue(<span class="code-quote">"messages.input"</span>);
+ Destination destination = session.createQueue("messages.input");
MessageProducer producer = session.createProducer(destination);
- producer.send(session.createTextMessage(<span class="code-quote">"Test Message"</span>));
- log.debug(<span class="code-quote">"send message"</span>);
+ producer.send(session.createTextMessage("Test Message"));
+ log.debug("send message");
session.close();
connection.close();
- connection = ActiveMQConnection.makeConnection(<span class="code-quote">"tcp://localhost:7000"</span>);
+ connection = ActiveMQConnection.makeConnection("tcp://localhost:7000");
connection.start();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- destination = session.createQueue(<span class="code-quote">"messages.input"</span>);
+ destination = session.createQueue("messages.input");
MessageConsumer consumer = session.createConsumer(destination);
- log.debug(<span class="code-quote">"receive message"</span>);
+ log.debug("receive message");
Message message = consumer.receive(5000);
- log.debug(<span class="code-quote">"Received: "</span> + message);
+ log.debug("Received: " + message);
session.close();
connection.close();
}
@@ -369,7 +381,7 @@ public class BridgeTest {
}
}
-</pre>
+]]></script>
</div></div>
</div>
</td>
@@ -384,8 +396,8 @@ public class BridgeTest {
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/jms.html
==============================================================================
--- websites/production/activemq/content/jms.html (original)
+++ websites/production/activemq/content/jms.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,7 @@
</style>
<![endif]-->
+
<title>
Apache ActiveMQ ™ -- JMS
</title>
@@ -50,8 +51,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -89,8 +90,8 @@
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/jmstemplate-gotchas.html
==============================================================================
--- websites/production/activemq/content/jmstemplate-gotchas.html (original)
+++ websites/production/activemq/content/jmstemplate-gotchas.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,7 @@
</style>
<![endif]-->
+
<title>
Apache ActiveMQ ™ -- JmsTemplate Gotchas
</title>
@@ -50,8 +51,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -101,8 +102,8 @@
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/jmsxuserid.html
==============================================================================
--- websites/production/activemq/content/jmsxuserid.html (original)
+++ websites/production/activemq/content/jmsxuserid.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,16 @@
</style>
<![endif]-->
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
+
<title>
Apache ActiveMQ ™ -- JMSXUserID
</title>
@@ -50,8 +60,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -77,32 +87,30 @@
<p>It is sometimes useful to know the authenticated username of the sender of a message. This is not added by default but you can enable it by setting the <b>populateJMSXUserID</b> property on the broker via Java code</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-BrokerService broker = <span class="code-keyword">new</span> BrokerService();
-broker.setPopulateJMSXUserID(<span class="code-keyword">true</span>);
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+BrokerService broker = new BrokerService();
+broker.setPopulateJMSXUserID(true);
broker.start();
-</pre>
+]]></script>
</div></div>
<p>Or via the <a shape="rect" href="xml-configuration.html" title="Xml Configuration">Xml Configuration</a></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<broker xmlns=<span class="code-quote">"http:<span class="code-comment">//activemq.org/config/1.0"</span> populateJMSXUserID=<span class="code-quote">"<span class="code-keyword">true</span>"</span>>
-</span>...
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<broker xmlns="http://activemq.org/config/1.0" populateJMSXUserID="true">
+...
</broker>
-</pre>
+]]></script>
</div></div>
<p>Or via the <a shape="rect" href="broker-configuration-uri.html" title="Broker Configuration URI">Broker Configuration URI</a>.</p>
<p>Once enabled this feature adds the JMS property <b>JMSXUserID</b> to each JMS message so that a consumer can know exactly who the sender was using the broker's authentication policy. i.e. it is not possibile for a producer to spoof this value if this feature is enabled since the broker attaches the property to the message after the senders connection is authenticated.</p>
-<p>If you allow anonymous access, you MUST also add the </p>
-<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">useAuthenticatedPrincipalForJMSXUserID=<span class="code-quote">"<span class="code-keyword">true</span>"</span></pre>
-</div></div>
-<p> property of the broker element. Otherwise, anonymous clients can spoof identities by setting the JMSXUserID property on from the client. This property is available in version 5.5 or 5.5-SNAPSHOT > March 12th. Note, though, that for SSL certificate based authentication, e.g., when using TextFileCertificateLoginModule JAAS module, this will change the semantics of the broker-provided JMSXUserID. Instead of returning the DN of the certificate, it will provide the name the DN is mapped to by the JAAS module.</p>
+<p>If you allow anonymous access, you MUST also add the </p><div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[useAuthenticatedPrincipalForJMSXUserID="true"]]></script>
+</div></div> property of the broker element. Otherwise, anonymous clients can spoof identities by setting the JMSXUserID property on from the client. This property is available in version 5.5 or 5.5-SNAPSHOT > March 12th. Note, though, that for SSL certificate based authentication, e.g., when using TextFileCertificateLoginModule JAAS module, this will change the semantics of the broker-provided JMSXUserID. Instead of returning the DN of the certificate, it will provide the name the DN is mapped to by the JAAS module.
</div>
</td>
<td valign="top">
@@ -116,8 +124,8 @@ broker.start();
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/jmx-support.html
==============================================================================
--- websites/production/activemq/content/jmx-support.html (original)
+++ websites/production/activemq/content/jmx-support.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,7 @@
</style>
<![endif]-->
+
<title>
Apache ActiveMQ ™ -- JMX Support
</title>
@@ -50,8 +51,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -128,8 +129,8 @@
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/jmx.html
==============================================================================
--- websites/production/activemq/content/jmx.html (original)
+++ websites/production/activemq/content/jmx.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,17 @@
</style>
<![endif]-->
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
+
<title>
Apache ActiveMQ ™ -- JMX
</title>
@@ -50,8 +61,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -84,17 +95,17 @@
<p>For xbean configuration</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<broker useJmx=<span class="code-quote">"<span class="code-keyword">true</span>"</span> brokerName=<span class="code-quote">"BROKER1"</span>>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<broker useJmx="true" brokerName="BROKER1">
...
</broker>
-</pre>
+]]></script>
</div></div>
<p>2. Run a JMX console </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">$ jconsole </pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[$ jconsole ]]></script>
</div></div>
@@ -104,9 +115,9 @@
<p>To connect to a remote ActiveMQ instance, or if the local process does not show up, use Remote Process option, and enter an URL. Here is an example localhost URL:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-service:jmx:rmi:<span class="code-comment">///jndi/rmi://localhost:1099/jmxrmi</span>
-</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
+]]></script>
</div></div>
<p>Using the Apache ActiveMQ version on OS X it appears as follows:</p>
@@ -153,19 +164,19 @@ service:jmx:rmi:<span class="code-commen
<p>1. Make sure JMX is enabled, but tell ActiveMQ <b>not</b> create its own connector so that it will use the default JVM JMX connector. </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-<span class="code-tag"><broker xmlns=<span class="code-quote">"http://activemq.org/config/1.0"</span> brokerName=<span class="code-quote">"localhost"</span>useJmx=<span class="code-quote">"true"</span>></span>
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
+<broker xmlns="http://activemq.org/config/1.0" brokerName="localhost"useJmx="true">
...
- <span class="code-tag"><managementContext></span>
- <span class="code-tag"><managementContext createConnector=<span class="code-quote">"false"</span>/></span>
- <span class="code-tag"></managementContext></span>
+ <managementContext>
+ <managementContext createConnector="false"/>
+ </managementContext>
...
-<span class="code-tag"></broker></span>
-</pre>
+</broker>
+]]></script>
</div></div>
<p>2. Create access and password files</p>
@@ -173,23 +184,23 @@ service:jmx:rmi:<span class="code-commen
<p>conf/jmx.access:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-# The <span class="code-quote">"monitorRole"</span> role has readonly access.
-# The <span class="code-quote">"controlRole"</span> role has readwrite access.
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+# The "monitorRole" role has readonly access.
+# The "controlRole" role has readwrite access.
monitorRole readonly
controlRole readwrite
-</pre>
+]]></script>
</div></div>
<p>conf/jmx.password:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-# The <span class="code-quote">"monitorRole"</span> role has password <span class="code-quote">"abc123"</span>.
-# The <span class="code-quote">"controlRole"</span> role has password <span class="code-quote">"abcd1234"</span>.
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+# The "monitorRole" role has password "abc123".
+# The "controlRole" role has password "abcd1234".
monitorRole abc123
controlRole abcd1234
-</pre>
+]]></script>
</div></div>
<p>(Make sure both files are not world readable - more info can be find <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#auth" rel="nofollow">here</a> to protect files)</p>
@@ -201,30 +212,30 @@ controlRole abcd1234
<p>Find the "SUNJMX=" line and change it too:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
1. Windows
- SUNJMX=-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.ssl=<span class="code-keyword">false</span> \
+ SUNJMX=-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.password.file=%ACTIVEMQ_BASE%/conf/jmx.password \
-Dcom.sun.management.jmxremote.access.file=%ACTIVEMQ_BASE%/conf/jmx.access
2. Unix
- SUNJMX="-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.ssl=<span class="code-keyword">false</span> \
+ SUNJMX="-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_BASE}/conf/jmx.password \
-Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_BASE}/conf/jmx.access"
-</pre>
+]]></script>
</div></div>
<p>This could be set in /etc/activemq.conf instead (if you have root access):</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
1. Windows
ACTIVEMQ_HOME=DRIVE_LETTER:/where/ActiveMQ/is/installed
ACTIVEMQ_BASE=%ACTIVEMQ_HOME%
-SUNJMX=-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.ssl=<span class="code-keyword">false</span> \
+SUNJMX=-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.password.file=%ACTIVEMQ_BASE%/conf/jmx.password \
-Dcom.sun.management.jmxremote.access.file=%ACTIVEMQ_BASE%/conf/jmx.access
@@ -232,10 +243,10 @@ SUNJMX=-Dcom.sun.management.jmxremote.po
ACTIVEMQ_HOME=DRIVE_LETTER:/where/ActiveMQ/is/installed
ACTIVEMQ_BASE=${ACTIVEMQ_HOME}
-SUNJMX="-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.ssl=<span class="code-keyword">false</span> \
+SUNJMX="-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_BASE}/conf/jmx.password \
-Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_BASE}/conf/jmx.access"
-</pre>
+]]></script>
</div></div>
@@ -244,9 +255,9 @@ SUNJMX="-Dcom.sun.management.jmxremote.p
<p>You should be able to connect to JMX on the JMX URL</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-service:jmx:rmi:<span class="code-comment">///jndi/rmi://<your hostname>:1616/jmxrmi</span>
-</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+service:jmx:rmi:///jndi/rmi://<your hostname>:1616/jmxrmi
+]]></script>
</div></div>
<p>And you will be forced to login.</p>
@@ -259,13 +270,13 @@ service:jmx:rmi:<span class="code-commen
<h4><a shape="rect" name="JMX-Example%3A"></a>Example:</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<broker useJmx=<span class="code-quote">"<span class="code-keyword">true</span>"</span>>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<broker useJmx="true">
<managementContext>
- <managementContext connectorPort=<span class="code-quote">"2011"</span> jmxDomainName=<span class="code-quote">"test.domain"</span>/>
+ <managementContext connectorPort="2011" jmxDomainName="test.domain"/>
</managementContext>
</broker>
-</pre>
+]]></script>
</div></div>
<p>In 4.0.1 or later, on Java 1.5 or later we try and use the default platform MBeanServer (so that things like the JVM threads & memory settings are visible). </p>
@@ -275,10 +286,10 @@ service:jmx:rmi:<span class="code-commen
<p>For example you can enable remote JMX connections to the Sun JMX connector, via setting the following environment variable (using <b>set</b> or <b>export</b> depending on your platform). These settings only configure the Sun JMX connector within Java 1.5+, not the JMX connector that ActiveMQ creates by default.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-SUNJMX=-Dcom.sun.management.jmxremote=<span class="code-keyword">true</span> -Dcom.sun.management.jmxremote.port=1616 \
--Dcom.sun.management.jmxremote.authenticate=<span class="code-keyword">false</span> -Dcom.sun.management.jmxremote.ssl=<span class="code-keyword">false</span>
-</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+SUNJMX=-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1616 \
+-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
+]]></script>
</div></div>
<p>(The SUNJMX environment variable is simple used by the "activemq" startup script, as additional startup parameters for java. If you start ActiveMQ directly, you'll have to pass these parameters yourself.)</p>
@@ -303,8 +314,8 @@ SUNJMX=-Dcom.sun.management.jmxremote=<s
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/jndi-support.html
==============================================================================
--- websites/production/activemq/content/jndi-support.html (original)
+++ websites/production/activemq/content/jndi-support.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,17 @@
</style>
<![endif]-->
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushPlain.js' type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
+
<title>
Apache ActiveMQ ™ -- JNDI Support
</title>
@@ -50,8 +61,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -80,7 +91,8 @@
<p>For example if you place this <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-unit-tests/src/test/resources/jndi.properties">jndi.properties</a> file on your classpath, you can look inside the InitialContext and lookup ConnectionFactory objects and Destinations etc.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-none">
+<script class="theme: Default; brush: plain; gutter: false" type="syntaxhighlighter"><![CDATA[
+
java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
# use the following property to configure the default connector
@@ -99,7 +111,7 @@ queue.MyQueue = example.MyQueue
# topic.[jndiName] = [physicalName]
topic.MyTopic = example.MyTopic
-</pre>
+]]></script>
</div></div>
<p>You can edit the jndi.properties file to configure the ActiveMQConnectionFactory's properties such as brokerURL and whether or not there should be an embedded broker etc. See <a shape="rect" href="how-do-i-embed-a-broker-inside-a-connection.html" title="How do I embed a Broker inside a Connection">how to embed a broker in a connection</a> for more details.</p>
@@ -115,20 +127,20 @@ topic.MyTopic = example.MyTopic
<p><b>Sample code</b></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-comment">// create a <span class="code-keyword">new</span> intial context, which loads from jndi.properties file
-</span>javax.naming.Context ctx = <span class="code-keyword">new</span> javax.naming.InitialContext();
-<span class="code-comment">// lookup the connection factory
-</span>javax.jms.TopicConnectionFactory factory = (javax.jms.TopicConnectionFactory)ctx.lookup(<span class="code-quote">"ConnectionFactory"</span>);
-<span class="code-comment">// create a <span class="code-keyword">new</span> TopicConnection <span class="code-keyword">for</span> pub/sub messaging
-</span>javax.jms.TopicConnection conn = factory.getTopicConnection();
-<span class="code-comment">// lookup an existing topic
-</span>javax.jms.Topic mytopic = (javax.jms.Topic)ctx.lookup(<span class="code-quote">"MyTopic"</span>);
-<span class="code-comment">// create a <span class="code-keyword">new</span> TopicSession <span class="code-keyword">for</span> the client
-</span>javax.jms.TopicSession session = conn.createTopicSession(<span class="code-keyword">false</span>,TopicSession.AUTO_ACKNOWLEDGE);
-<span class="code-comment">// create a <span class="code-keyword">new</span> subscriber to receive messages
-</span>javax.jms.TopicSubscriber subscriber = session.createSubscriber(mytopic);
-</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+// create a new intial context, which loads from jndi.properties file
+javax.naming.Context ctx = new javax.naming.InitialContext();
+// lookup the connection factory
+javax.jms.TopicConnectionFactory factory = (javax.jms.TopicConnectionFactory)ctx.lookup("ConnectionFactory");
+// create a new TopicConnection for pub/sub messaging
+javax.jms.TopicConnection conn = factory.getTopicConnection();
+// lookup an existing topic
+javax.jms.Topic mytopic = (javax.jms.Topic)ctx.lookup("MyTopic");
+// create a new TopicSession for the client
+javax.jms.TopicSession session = conn.createTopicSession(false,TopicSession.AUTO_ACKNOWLEDGE);
+// create a new subscriber to receive messages
+javax.jms.TopicSubscriber subscriber = session.createSubscriber(mytopic);
+]]></script>
</div></div>
<p>Notice the name of the topic in the sample is "MyTopic". ActiveMQ will read the jndi.properties files and creates the topics and queues in a lazy fashion. The prefix topic and queue is stripped, so the jndi name begins after the prefix.</p>
@@ -137,12 +149,12 @@ topic.MyTopic = example.MyTopic
<p>You can also try to create a new initial context using either an instance of properties file or a map. For example, the approach recommended by JMS specification will work just fine.</p>
<div class="table-wrap">
<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Example recommended by specification </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-Properties props = <span class="code-keyword">new</span> Properties();
-props.setProperty(Context.INITIAL_CONTEXT_FACTORY,<span class="code-quote">"org.apache.activemq.jndi.ActiveMQInitialContextFactory"</span>);
-props.setProperty(Context.PROVIDER_URL,<span class="code-quote">"tcp:<span class="code-comment">//hostname:61616"</span>);
-</span>javax.naming.Context ctx = <span class="code-keyword">new</span> InitialContext(props);||
-</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+Properties props = new Properties();
+props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+props.setProperty(Context.PROVIDER_URL,"tcp://hostname:61616");
+javax.naming.Context ctx = new InitialContext(props);||
+]]></script>
</div></div> </td></tr></tbody></table>
</div>
@@ -158,9 +170,9 @@ props.setProperty(Context.PROVIDER_URL,<
<p>e.g. if you use the following name to lookup into JNDI</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
dynamicQueues/FOO.BAR
-</pre>
+]]></script>
</div></div>
<p>you will get back an ActiveMQQueue of the name "FOO.BAR".</p>
@@ -172,15 +184,15 @@ dynamicQueues/FOO.BAR
<p>If you want to use an embedded broker with your JNDI provider you can just use the <a shape="rect" href="vm-transport-reference.html" title="VM Transport Reference">VM Transport</a> to connect to the broker in your URL. e.g. to create a purely in JVM broker use this URI</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-vm:<span class="code-comment">//locahost</span>
-</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+vm://locahost
+]]></script>
</div></div>
<p>If you want to customize the broker use something like this</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-vm:broker:(tcp:<span class="code-comment">//localhost:61616)</span>
-</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+vm:broker:(tcp://localhost:61616)
+]]></script>
</div></div>
<p>More options are available in the <a shape="rect" href="vm-transport-reference.html" title="VM Transport Reference">VM Transport Reference</a></p>
@@ -188,20 +200,21 @@ vm:broker:(tcp:<span class="code-comment
<p>Once you have configured JNDI on the classpath you can run any normal JMS application such as the following <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java">example</a>. Notice that the Java code just uses pure JMS APIs and is not in any way ActiveMQ specific</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">import</span> javax.jms.Connection;
-<span class="code-keyword">import</span> javax.jms.ConnectionFactory;
-<span class="code-keyword">import</span> javax.jms.Destination;
-<span class="code-keyword">import</span> javax.jms.JMSException;
-<span class="code-keyword">import</span> javax.jms.MessageProducer;
-<span class="code-keyword">import</span> javax.jms.Session;
-<span class="code-keyword">import</span> javax.jms.TextMessage;
-<span class="code-keyword">import</span> javax.naming.Context;
-<span class="code-keyword">import</span> javax.naming.InitialContext;
-<span class="code-keyword">import</span> javax.naming.NamingException;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-<span class="code-keyword">import</span> org.slf4j.Logger;
-<span class="code-keyword">import</span> org.slf4j.LoggerFactory;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A simple polymorphic JMS producer which can work with Queues or Topics which
@@ -209,74 +222,74 @@ vm:broker:(tcp:<span class="code-comment
*
*
*/
-<span class="code-keyword">public</span> <span class="code-keyword">final</span> class SimpleProducer {
+public final class SimpleProducer {
- <span class="code-keyword">private</span> <span class="code-keyword">static</span> <span class="code-keyword">final</span> Logger LOG = LoggerFactory.getLogger(SimpleProducer.class);
+ private static final Logger LOG = LoggerFactory.getLogger(SimpleProducer.class);
- <span class="code-keyword">private</span> SimpleProducer() {
+ private SimpleProducer() {
}
/**
* @param args the destination name to send to and optionally, the number of
* messages to send
*/
- <span class="code-keyword">public</span> <span class="code-keyword">static</span> void main(<span class="code-object">String</span>[] args) {
- Context jndiContext = <span class="code-keyword">null</span>;
- ConnectionFactory connectionFactory = <span class="code-keyword">null</span>;
- Connection connection = <span class="code-keyword">null</span>;
- Session session = <span class="code-keyword">null</span>;
- Destination destination = <span class="code-keyword">null</span>;
- MessageProducer producer = <span class="code-keyword">null</span>;
- <span class="code-object">String</span> destinationName = <span class="code-keyword">null</span>;
- <span class="code-keyword">final</span> <span class="code-object">int</span> numMsgs;
-
- <span class="code-keyword">if</span> ((args.length < 1) || (args.length > 2)) {
- LOG.info(<span class="code-quote">"Usage: java SimpleProducer <destination-name> [<number-of-messages>]"</span>);
- <span class="code-object">System</span>.exit(1);
+ public static void main(String[] args) {
+ Context jndiContext = null;
+ ConnectionFactory connectionFactory = null;
+ Connection connection = null;
+ Session session = null;
+ Destination destination = null;
+ MessageProducer producer = null;
+ String destinationName = null;
+ final int numMsgs;
+
+ if ((args.length < 1) || (args.length > 2)) {
+ LOG.info("Usage: java SimpleProducer <destination-name> [<number-of-messages>]");
+ System.exit(1);
}
destinationName = args[0];
- LOG.info(<span class="code-quote">"Destination name is "</span> + destinationName);
- <span class="code-keyword">if</span> (args.length == 2) {
- numMsgs = (<span class="code-keyword">new</span> <span class="code-object">Integer</span>(args[1])).intValue();
- } <span class="code-keyword">else</span> {
+ LOG.info("Destination name is " + destinationName);
+ if (args.length == 2) {
+ numMsgs = (new Integer(args[1])).intValue();
+ } else {
numMsgs = 1;
}
/*
* Create a JNDI API InitialContext object
*/
- <span class="code-keyword">try</span> {
- jndiContext = <span class="code-keyword">new</span> InitialContext();
- } <span class="code-keyword">catch</span> (NamingException e) {
- LOG.info(<span class="code-quote">"Could not create JNDI API context: "</span> + e.toString());
- <span class="code-object">System</span>.exit(1);
+ try {
+ jndiContext = new InitialContext();
+ } catch (NamingException e) {
+ LOG.info("Could not create JNDI API context: " + e.toString());
+ System.exit(1);
}
/*
* Look up connection factory and destination.
*/
- <span class="code-keyword">try</span> {
- connectionFactory = (ConnectionFactory)jndiContext.lookup(<span class="code-quote">"ConnectionFactory"</span>);
+ try {
+ connectionFactory = (ConnectionFactory)jndiContext.lookup("ConnectionFactory");
destination = (Destination)jndiContext.lookup(destinationName);
- } <span class="code-keyword">catch</span> (NamingException e) {
- LOG.info(<span class="code-quote">"JNDI API lookup failed: "</span> + e);
- <span class="code-object">System</span>.exit(1);
+ } catch (NamingException e) {
+ LOG.info("JNDI API lookup failed: " + e);
+ System.exit(1);
}
/*
- * Create connection. Create session from connection; <span class="code-keyword">false</span> means
+ * Create connection. Create session from connection; false means
* session is not transacted. Create sender and text message. Send
* messages, varying text slightly. Send end-of-messages message.
* Finally, close connection.
*/
- <span class="code-keyword">try</span> {
+ try {
connection = connectionFactory.createConnection();
- session = connection.createSession(<span class="code-keyword">false</span>, Session.AUTO_ACKNOWLEDGE);
+ session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
producer = session.createProducer(destination);
TextMessage message = session.createTextMessage();
- <span class="code-keyword">for</span> (<span class="code-object">int</span> i = 0; i < numMsgs; i++) {
- message.setText(<span class="code-quote">"This is message "</span> + (i + 1));
- LOG.info(<span class="code-quote">"Sending message: "</span> + message.getText());
+ for (int i = 0; i < numMsgs; i++) {
+ message.setText("This is message " + (i + 1));
+ LOG.info("Sending message: " + message.getText());
producer.send(message);
}
@@ -284,20 +297,20 @@ vm:broker:(tcp:<span class="code-comment
* Send a non-text control message indicating end of messages.
*/
producer.send(session.createMessage());
- } <span class="code-keyword">catch</span> (JMSException e) {
- LOG.info(<span class="code-quote">"Exception occurred: "</span> + e);
- } <span class="code-keyword">finally</span> {
- <span class="code-keyword">if</span> (connection != <span class="code-keyword">null</span>) {
- <span class="code-keyword">try</span> {
+ } catch (JMSException e) {
+ LOG.info("Exception occurred: " + e);
+ } finally {
+ if (connection != null) {
+ try {
connection.close();
- } <span class="code-keyword">catch</span> (JMSException e) {
+ } catch (JMSException e) {
}
}
}
}
}
-</pre>
+]]></script>
</div></div>
</div>
</td>
@@ -312,8 +325,8 @@ vm:broker:(tcp:<span class="code-comment
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/journal-is-already-opened-by-this-application.html
==============================================================================
--- websites/production/activemq/content/journal-is-already-opened-by-this-application.html (original)
+++ websites/production/activemq/content/journal-is-already-opened-by-this-application.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,16 @@
</style>
<![endif]-->
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
+
<title>
Apache ActiveMQ ™ -- Journal is already opened by this application
</title>
@@ -50,8 +60,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -77,8 +87,8 @@
<p>You get something like this</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-java.io.IOException: Journal is already opened by <span class="code-keyword">this</span> application.
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+java.io.IOException: Journal is already opened by this application.
at
org.apache.activeio.journal.active.ControlFile.lock(ControlFile.java:71)
at
@@ -91,7 +101,7 @@ org.apache.activeio.journal.active.Journ
org.apache.activemq.store.DefaultPersistenceAdapterFactory.createJournal(DefaultPersistenceAdapterFactory.java:198)
at
org.apache.activemq.store.DefaultPersistenceAdapterFactory.getJournal(DefaultPersistenceAdapterFactory.java:134)
-</pre>
+]]></script>
</div></div>
<h3><a shape="rect" name="Journalisalreadyopenedbythisapplication-Description"></a>Description</h3>
@@ -118,8 +128,8 @@ org.apache.activemq.store.DefaultPersist
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/junit-reports.html
==============================================================================
--- websites/production/activemq/content/junit-reports.html (original)
+++ websites/production/activemq/content/junit-reports.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,7 @@
</style>
<![endif]-->
+
<title>
Apache ActiveMQ ™ -- JUnit Reports
</title>
@@ -50,8 +51,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -86,8 +87,8 @@
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/kaha-persistence.html
==============================================================================
--- websites/production/activemq/content/kaha-persistence.html (original)
+++ websites/production/activemq/content/kaha-persistence.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,16 @@
</style>
<![endif]-->
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
+
<title>
Apache ActiveMQ ™ -- Kaha Persistence
</title>
@@ -50,8 +60,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -85,32 +95,32 @@
<p>ActiveMQ 5.0 and above:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
- <broker brokerName=<span class="code-quote">"broker"</span> persistent=<span class="code-quote">"<span class="code-keyword">true</span>"</span> useShutdownHook=<span class="code-quote">"<span class="code-keyword">false</span>"</span>>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+ <broker brokerName="broker" persistent="true" useShutdownHook="false">
<transportConnectors>
- <transportConnector uri=<span class="code-quote">"tcp:<span class="code-comment">//localhost:61616"</span>/>
-</span> </transportConnectors>
+ <transportConnector uri="tcp://localhost:61616"/>
+ </transportConnectors>
<persistenceAdapter>
- <kahaPersistenceAdapter directory=<span class="code-quote">"activemq-data"</span> maxDataFileLength=<span class="code-quote">"33554432"</span>/>
+ <kahaPersistenceAdapter directory="activemq-data" maxDataFileLength="33554432"/>
</persistenceAdapter>
</broker>
-</pre>
+]]></script>
</div></div>
<p>ActiveMQ 4.1 and earlier:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
- <broker brokerName=<span class="code-quote">"broker"</span> persistent=<span class="code-quote">"<span class="code-keyword">true</span>"</span> useShutdownHook=<span class="code-quote">"<span class="code-keyword">false</span>"</span>>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+ <broker brokerName="broker" persistent="true" useShutdownHook="false">
<transportConnectors>
- <transportConnector uri=<span class="code-quote">"tcp:<span class="code-comment">//localhost:61616"</span>/>
-</span> </transportConnectors>
+ <transportConnector uri="tcp://localhost:61616"/>
+ </transportConnectors>
<persistenceAdapter>
- <kahaPersistenceAdapter dir=<span class="code-quote">"activemq-data"</span> maxDataFileLength=<span class="code-quote">"33554432"</span>/>
+ <kahaPersistenceAdapter dir="activemq-data" maxDataFileLength="33554432"/>
</persistenceAdapter>
</broker>
-</pre>
+]]></script>
</div></div>
</div>
</td>
@@ -125,8 +135,8 @@
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/kahadb-master-slave.html
==============================================================================
--- websites/production/activemq/content/kahadb-master-slave.html (original)
+++ websites/production/activemq/content/kahadb-master-slave.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,17 @@
</style>
<![endif]-->
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushXml.js' type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
+
<title>
Apache ActiveMQ ™ -- KahaDB Master Slave
</title>
@@ -50,8 +61,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -97,9 +108,9 @@
<p>Start the configuation up by running:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
prompt> $ACTIVEMQ_HOME/bin/activemq xbean:ha.xml
-</pre>
+]]></script>
</div></div>
<p>The actual contents of the configuration file follows:</p>
@@ -143,8 +154,8 @@ prompt> $ACTIVEMQ_HOME/bin/activemq x
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/kahadb.html
==============================================================================
--- websites/production/activemq/content/kahadb.html (original)
+++ websites/production/activemq/content/kahadb.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,16 @@
</style>
<![endif]-->
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
+ <link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
+ <script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
+
<title>
Apache ActiveMQ ™ -- KahaDB
</title>
@@ -50,8 +60,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -79,16 +89,16 @@
<p>You can configure ActiveMQ to use KahaDB for its persistence adapter - like below :</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
- <broker brokerName=<span class="code-quote">"broker"</span> ... >
+ <broker brokerName="broker" ... >
<persistenceAdapter>
- <kahaDB directory=<span class="code-quote">"activemq-data"</span> journalMaxFileLength=<span class="code-quote">"32mb"</span>/>
+ <kahaDB directory="activemq-data" journalMaxFileLength="32mb"/>
</persistenceAdapter>
...
</broker>
-</pre>
+]]></script>
</div></div>
<h3><a shape="rect" name="KahaDB-KahaDBProperties"></a>KahaDB Properties</h3>
@@ -106,17 +116,17 @@
If database operation is slower than that threshold (for example if you set it to 500), you may see messages like </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
Slow KahaDB access: cleanup took 1277 | org.apache.activemq.store.kahadb.MessageDatabase | ActiveMQ Journal Checkpoint Worker
-</pre>
+]]></script>
</div></div>
<p>You can configure a threshold used to log these messages by using a system property and adjust it to your disk speed so that you can easily pick up runtime anomalies.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-Dorg.apache.activemq.store.kahadb.LOG_SLOW_ACCESS_TIME=1500
-</pre>
+]]></script>
</div></div>
<h1><a shape="rect" name="KahaDB-Multi%28m%29kahaDBpersistenceadapter"></a>Multi(m) kahaDB persistence adapter</h1>
@@ -129,22 +139,22 @@ In these cases you can use the mKahaDB p
<h2><a shape="rect" name="KahaDB-Configuration"></a>Configuration</h2>
<p>Each instance of kahaDB can be configured independently. If no destination is supplied to a <tt>filteredKahaDB</tt>, the implicit default value will match any destination, queue or topic. This is a handy catch all. If no matching persistence adapter can be found, destination creation will fail with an exception. The <tt>filteredKahaDB</tt> shares its wildcard matching rules with <a shape="rect" href="per-destination-policies.html" title="Per Destination Policies">Per Destination Policies</a>.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<broker brokerName=<span class="code-quote">"broker"</span> ... >
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<broker brokerName="broker" ... >
<persistenceAdapter>
- <mKahaDB directory=<span class="code-quote">"${activemq.base}/data/kahadb"</span>>
+ <mKahaDB directory="${activemq.base}/data/kahadb">
<filteredPersistenceAdapters>
<!-- match all queues -->
- <filteredKahaDB queue=<span class="code-quote">">"</span>>
+ <filteredKahaDB queue=">">
<persistenceAdapter>
- <kahaDB journalMaxFileLength=<span class="code-quote">"32mb"</span>/>
+ <kahaDB journalMaxFileLength="32mb"/>
</persistenceAdapter>
</filteredKahaDB>
<!-- match all destinations -->
<filteredKahaDB>
<persistenceAdapter>
- <kahaDB enableJournalDiskSyncs=<span class="code-quote">"<span class="code-keyword">false</span>"</span>/>
+ <kahaDB enableJournalDiskSyncs="false"/>
</persistenceAdapter>
</filteredKahaDB>
</filteredPersistenceAdapters>
@@ -152,21 +162,21 @@ In these cases you can use the mKahaDB p
</persistenceAdapter>
...
</broker>
-</pre>
+]]></script>
</div></div>
<h3><a shape="rect" name="KahaDB-Automaticperdestinationpersistenceadapter"></a>Automatic per destination persistence adapter</h3>
<p>When the <tt>perDestination</tt> boolean attribute is set to true on the catch all (no explicit destination set), <tt>filteredKahaDB</tt>. Each matching destination will get its own <tt>kahaDB</tt> instance.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<broker brokerName=<span class="code-quote">"broker"</span> ... >
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<broker brokerName="broker" ... >
<persistenceAdapter>
- <mKahaDB directory=<span class="code-quote">"${activemq.base}/data/kahadb"</span>>
+ <mKahaDB directory="${activemq.base}/data/kahadb">
<filteredPersistenceAdapters>
<!-- kahaDB per destinations -->
- <filteredKahaDB perDestination=<span class="code-quote">"<span class="code-keyword">true</span>"</span> >
+ <filteredKahaDB perDestination="true" >
<persistenceAdapter>
- <kahaDB journalMaxFileLength=<span class="code-quote">"32mb"</span> />
+ <kahaDB journalMaxFileLength="32mb" />
</persistenceAdapter>
</filteredKahaDB>
</filteredPersistenceAdapters>
@@ -174,7 +184,7 @@ In these cases you can use the mKahaDB p
</persistenceAdapter>
...
</broker>
-</pre>
+]]></script>
</div></div>
</div>
@@ -190,8 +200,8 @@ In these cases you can use the mKahaDB p
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
Modified: websites/production/activemq/content/known-bad-os-and-jvm-combinations.html
==============================================================================
--- websites/production/activemq/content/known-bad-os-and-jvm-combinations.html (original)
+++ websites/production/activemq/content/known-bad-os-and-jvm-combinations.html Fri Jul 12 12:46:14 2013
@@ -32,6 +32,7 @@
</style>
<![endif]-->
+
<title>
Apache ActiveMQ ™ -- Known Bad OS and JVM Combinations
</title>
@@ -50,8 +51,8 @@
<div>
<!-- Banner -->
-
- <div id="asf_logo">
+<p>
+ </p><div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a> ™
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
@@ -90,8 +91,8 @@
<h3><a shape="rect" name="Navigation-Search"></a>Search</h3>
-
-<div>
+<p>
+</p><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">