Author: buildbot
Date: Fri Aug 25 08:24:11 2017
New Revision: 1017262
Log:
Production update by buildbot for activemq
Modified:
websites/production/activemq/content/cache/cms.pageCache
websites/production/activemq/content/cache/main.pageCache
websites/production/activemq/content/cache/nms.pageCache
websites/production/activemq/content/configure-startup-destinations.html
websites/production/activemq/content/dispatch-policies.html
websites/production/activemq/content/jndi-support.html
websites/production/activemq/content/kahadb-replication-experimental.html
websites/production/activemq/content/persistence.html
websites/production/activemq/content/security.html
websites/production/activemq/content/siteindex.html
websites/production/activemq/content/slow-consumer-handling.html
websites/production/activemq/content/version-5-xml-configuration.html
websites/production/activemq/content/virtual-destinations.html
websites/production/activemq/content/xml-configuration.html
Modified: websites/production/activemq/content/cache/cms.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/activemq/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/activemq/content/cache/nms.pageCache
==============================================================================
Binary files - no diff available.
Modified:
websites/production/activemq/content/configure-startup-destinations.html
==============================================================================
--- websites/production/activemq/content/configure-startup-destinations.html
(original)
+++ websites/production/activemq/content/configure-startup-destinations.html
Fri Aug 25 08:24:11 2017
@@ -32,15 +32,6 @@
</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 ™ -- Configure Startup Destinations
@@ -80,8 +71,7 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><p>Typically in Apache ActiveMQ we <a
shape="rect" href="how-do-i-create-new-destinations.html">create destinations
on demand</a> as clients start to use them. However sometimes users want to be
able to configure which destinations are available on startup explicitly in the
<a shape="rect" href="xml-configuration.html">Xml Configuration</a>.</p><div
class="confluence-information-macro
confluence-information-macro-information"><p class="title">4.1 Feature</p><span
class="aui-icon aui-icon-small aui-iconfont-info
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Note this feature is available
from 4.1 onwards. If you try this XML on older versions of ActiveMQ you will
get an exception about the 'destinations' property not being
writable.</p></div></div><h3
id="ConfigureStartupDestinations-Example">Example</h3><p>The following <a
shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/incub
ator/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/broker/destinations-on-start.xml">example</a>
shows how you can configure a number of destinations to be available at
startup.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
+<div class="wiki-content maincontent"><p>Typically in Apache ActiveMQ we <a
shape="rect" href="how-do-i-create-new-destinations.html">create destinations
on demand</a> as clients start to use them. However sometimes users want to be
able to configure which destinations are available on startup explicitly in the
<a shape="rect" href="xml-configuration.html">Xml
Configuration</a>.</p><parameter ac:name="title">4.1
Feature</parameter><rich-text-body><p>Note this feature is available from 4.1
onwards. If you try this XML on older versions of ActiveMQ you will get an
exception about the 'destinations' property not being
writable.</p></rich-text-body><h3
id="ConfigureStartupDestinations-Example">Example</h3><p>The following <a
shape="rect" class="external-link"
href="http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/broker/destinations-on-start.xml">example</a>
shows how you can configure a number of destinations to be available
at startup.<plain-text-body>
<broker xmlns="http://activemq.apache.org/schema/core">
<destinations>
@@ -95,8 +85,7 @@
</broker>
-</pre>
-</div></div></div>
+</plain-text-body></p></div>
</td>
<td valign="top">
<div class="navigation">
Modified: websites/production/activemq/content/dispatch-policies.html
==============================================================================
--- websites/production/activemq/content/dispatch-policies.html (original)
+++ websites/production/activemq/content/dispatch-policies.html Fri Aug 25
08:24:11 2017
@@ -32,16 +32,6 @@
</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 ™ -- Dispatch Policies
@@ -81,10 +71,7 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h1
id="DispatchPolicies-DispatchPolicies">Dispatch Policies</h1><h2
id="DispatchPolicies-Dispatchpoliciesforqueues">Dispatch policies for
queues</h2><p>Plug-able dispatch policies only apply to topics. For Queues,
dispatch is more static, you can choose round robin (the default) or strict
order. Before discussing dispatch policies its worth first understanding <a
shape="rect" href="what-is-the-prefetch-limit-for.html">the purpose of the
prefetch value</a>.</p><p>The out of the box configuration of ActiveMQ is
designed for high performance and high throughput messaging where there are
lots of messages that need to be dispatched to consumers as quickly as
possible. So the default prefetch values are fairly large and the default
dispatch policy will try and fill the prefetch buffers as quickly as
possible.</p><p>However with messaging there are many use cases and sometimes
the default configuration is not ideal to your use case; when you send a sm
all number of messages, they tend to all go to one consumer unless you've lots
of messages. If you have a large number of consumers and a relatively high <a
shape="rect" href="what-is-the-prefetch-limit-for.html">prefetch value</a> and
you have a small number of messages that each message takes quite a while to
process then the default dispatch policy might result in increasing the amount
of time it takes to process all the messages (since the load balancing is not
fair for small numbers of messages).</p><p>For queues, you can define whether
the dispatch will occur in a round-robin fashion (default behaviour) or if one
consumer's prefetch buffer will be exhausted before the dispatch process
selects the next consumer along (strictOrderDispatch).<br clear="none"> The
latter behaviour is enabled by setting the "strictOrderDispatch" attribute on
the <policyEntry /> element. E.g.:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><policyEntry queue=">"
strictOrderDispatch="false" /> </pre>
-</div></div><p>Consumer priorities are observed, so if you have several
consumers with different <a shape="rect" class="external-link"
href="http://activemq.apache.org/consumer-priority.html">priorities</a>, the
one with the highest priority will be flooded first until it can take no more,
then the next one along, etc.</p><p>From version 5.14.0 -
the strictOrderDispatch=true option will ensure strict order for
redispatched messages when there is a single consumer. </p><h2
id="DispatchPolicies-DispatchpoliciesforTopics">Dispatch policies for
Topics</h2><p>There are more options for topics because the dispatch policy is
plug-able. Any implementation of
org.apache.activemq.broker.region.policy.DispatchPolicy will work.<br
clear="none"> The default
org.apache.activemq.broker.region.policy.SimpleDispatchPolicy does what one
would expect and delivers messages to all subscribers. An example of a more
advanced implementation is the org.apache.activemq.broker.region.policy.Priority
NetworkDispatchPolicy which will only dispatch to the highest priority network
consumer. This is useful in a loop network topology where there is more than
route to a consumer.</p><p>Here is an <a shape="rect" class="external-link"
href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/xbean/activemq-policy.xml">example
of destination policy configuration</a>.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><destinationPolicy>
+<div class="wiki-content maincontent"><h1
id="DispatchPolicies-DispatchPolicies">Dispatch Policies</h1><h2
id="DispatchPolicies-Dispatchpoliciesforqueues">Dispatch policies for
queues</h2><p>Plug-able dispatch policies only apply to topics. For Queues,
dispatch is more static, you can choose round robin (the default) or strict
order. Before discussing dispatch policies its worth first understanding <a
shape="rect" href="what-is-the-prefetch-limit-for.html">the purpose of the
prefetch value</a>.</p><p>The out of the box configuration of ActiveMQ is
designed for high performance and high throughput messaging where there are
lots of messages that need to be dispatched to consumers as quickly as
possible. So the default prefetch values are fairly large and the default
dispatch policy will try and fill the prefetch buffers as quickly as
possible.</p><p>However with messaging there are many use cases and sometimes
the default configuration is not ideal to your use case; when you send a sm
all number of messages, they tend to all go to one consumer unless you've lots
of messages. If you have a large number of consumers and a relatively high <a
shape="rect" href="what-is-the-prefetch-limit-for.html">prefetch value</a> and
you have a small number of messages that each message takes quite a while to
process then the default dispatch policy might result in increasing the amount
of time it takes to process all the messages (since the load balancing is not
fair for small numbers of messages).</p><p>For queues, you can define whether
the dispatch will occur in a round-robin fashion (default behaviour) or if one
consumer's prefetch buffer will be exhausted before the dispatch process
selects the next consumer along (strictOrderDispatch).<br clear="none"> The
latter behaviour is enabled by setting the "strictOrderDispatch" attribute on
the <policyEntry /> element. E.g.:</p><plain-text-body><policyEntry
queue=">" strictOrderDispatch="false" /> </plain-text-body><
p>Consumer priorities are observed, so if you have several consumers with
different <a shape="rect" class="external-link"
href="http://activemq.apache.org/consumer-priority.html">priorities</a>, the
one with the highest priority will be flooded first until it can take no more,
then the next one along, etc.</p><p>From version 5.14.0 -
the strictOrderDispatch=true option will ensure strict order for
redispatched messages when there is a single consumer. </p><h2
id="DispatchPolicies-DispatchpoliciesforTopics">Dispatch policies for
Topics</h2><p>There are more options for topics because the dispatch policy is
plug-able. Any implementation of
org.apache.activemq.broker.region.policy.DispatchPolicy will work.<br
clear="none"> The default
org.apache.activemq.broker.region.policy.SimpleDispatchPolicy does what one
would expect and delivers messages to all subscribers. An example of a more
advanced implementation is the
org.apache.activemq.broker.region.policy.PriorityNetworkDispat
chPolicy which will only dispatch to the highest priority network consumer.
This is useful in a loop network topology where there is more than route to a
consumer.</p><p>Here is an <a shape="rect" class="external-link"
href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/xbean/activemq-policy.xml">example
of destination policy configuration</a>.</p><parameter
ac:name="">xml</parameter><plain-text-body><destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic="FOO.>">
@@ -119,8 +106,7 @@
<policyEntry tempQueue="true" advisoryForConsumed="true" />
</policyEntries>
</policyMap>
-</destinationPolicy></pre>
-</div></div></div>
+</destinationPolicy></plain-text-body></div>
</td>
<td valign="top">
<div class="navigation">
Modified: websites/production/activemq/content/jndi-support.html
==============================================================================
--- websites/production/activemq/content/jndi-support.html (original)
+++ websites/production/activemq/content/jndi-support.html Fri Aug 25 08:24:11
2017
@@ -32,15 +32,6 @@
</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 ™ -- JNDI Support
@@ -80,8 +71,7 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><p>ActiveMQ will work with any JNDI
provider capable of storing Java objects. However it is common to require a
JNDI initial context to be able to run many JMS example programs, like <a
shape="rect" class="external-link"
href="http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/jms_tutorialTOC.html"
rel="nofollow">Sun's JMS tutorial.</a></p><p>So we provide a simple
JNDI <strong><code>InitialContextFactory</code></strong> which can be used
to lookup JMS connection factory objects as well as Destination objects. 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 <strong><code>InitialContext</code></strong> and
lookup <strong><code>ConnectionFactory</code></strong> objects
and <strong><code>Destinations</code></strong> etc.</p><div c
lass="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">java.naming.factory.initial =
org.apache.activemq.jndi.ActiveMQInitialContextFactory
+<div class="wiki-content maincontent"><p>ActiveMQ will work with any JNDI
provider capable of storing Java objects. However it is common to require a
JNDI initial context to be able to run many JMS example programs, like <a
shape="rect" class="external-link"
href="http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/jms_tutorialTOC.html"
rel="nofollow">Sun's JMS tutorial.</a></p><p>So we provide a simple
JNDI <strong><code>InitialContextFactory</code></strong> which can be used
to lookup JMS connection factory objects as well as Destination objects. 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 <strong><code>InitialContext</code></strong> and
lookup <strong><code>ConnectionFactory</code></strong> objects
and <strong><code>Destinations</code></strong> etc.</p><plain
-text-body>java.naming.factory.initial =
org.apache.activemq.jndi.ActiveMQInitialContextFactory
# Use the following property to configure the default connector
java.naming.provider.url = vm://localhost
@@ -96,9 +86,7 @@ queue.MyQueue = example.MyQueue
# Register some topics in JNDI using the form:
# topic.[jndiName] = [physicalName]
-topic.MyTopic = example.MyTopic</pre>
-</div></div><p>You can edit
the <strong><code>jndi.properties</code></strong> file to configure the
<strong><code>ActiveMQConnectionFactory</code></strong>'s properties such
as <strong><code>brokerURL</code></strong> 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">how to embed a broker
in a connection</a> for more details.</p><h3
id="JNDISupport-ActiveMQJNDITutorial">ActiveMQ JNDI Tutorial</h3><p>This is a
quick one page tutorial on how to setup and use JNDI to create a connection to
ActiveMQ. The first thing is ActiveMQ does not provide a full JNDI server. This
means JMS clients need to use properties files to create a JNDI
<strong><code>IntialContextFactory</code></strong>. If you need an example
properties file, you can look the source distribution <a shape="rect"
class="external-link"
href="https://github.com/apache/activemq/blob/master/activemq-unit-tests/src/test/resources/jndi.pro
perties"
rel="nofollow">https://github.com/apache/activemq/blob/master/activemq-unit-tests/src/test/resources/jndi.properties</a>.
Before we proceed, here are the properties.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>java.naming.factory.initial</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>org.apache.activemq.jndi.ActiveMQInitialContextFactory</code></p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>java.naming.provider.url</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>tcp://hostname:61616</code></p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>topic.MyTopic</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>example.MyTopic</code></p></t
d></tr></tbody></table></div><p>Make sure to
add <strong><code>activemq-<em><version></em>.jar</code></strong>
and <strong><code>spring-1.x.jar</code></strong> to your classpath. If the
libraries are not in the classpath, you will get
a <strong><code>ClassNotFoundException</code></strong> at runtime. If you
get <strong><code>ClassNotFoundException</code></strong>, try printing out the
classpath and check it is present. You can also run ActiveMQ
with <strong><code>-verbose</code></strong> option to verify the jar was
loaded correctly.</p><p><strong>Sample Code</strong></p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">// Create a new intial context, which loads from
jndi.properties file:
+topic.MyTopic = example.MyTopic</plain-text-body><p>You can edit
the <strong><code>jndi.properties</code></strong> file to configure the
<strong><code>ActiveMQConnectionFactory</code></strong>'s properties such
as <strong><code>brokerURL</code></strong> 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">how to embed a broker
in a connection</a> for more details.</p><h3
id="JNDISupport-ActiveMQJNDITutorial">ActiveMQ JNDI Tutorial</h3><p>This is a
quick one page tutorial on how to setup and use JNDI to create a connection to
ActiveMQ. The first thing is ActiveMQ does not provide a full JNDI server. This
means JMS clients need to use properties files to create a JNDI
<strong><code>IntialContextFactory</code></strong>. If you need an example
properties file, you can look the source distribution <a shape="rect"
class="external-link"
href="https://github.com/apache/activemq/blob/master/activemq-u
nit-tests/src/test/resources/jndi.properties"
rel="nofollow">https://github.com/apache/activemq/blob/master/activemq-unit-tests/src/test/resources/jndi.properties</a>.
Before we proceed, here are the properties.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>java.naming.factory.initial</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>org.apache.activemq.jndi.ActiveMQInitialContextFactory</code></p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>java.naming.provider.url</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>tcp://hostname:61616</code></p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>topic.MyTopic</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><
p><code>example.MyTopic</code></p></td></tr></tbody></table></div><p>Make sure
to add <strong><code>activemq-<em><version></em>.jar</code></strong>
and <strong><code>spring-1.x.jar</code></strong> to your classpath. If the
libraries are not in the classpath, you will get
a <strong><code>ClassNotFoundException</code></strong> at runtime. If you
get <strong><code>ClassNotFoundException</code></strong>, try printing out the
classpath and check it is present. You can also run ActiveMQ
with <strong><code>-verbose</code></strong> option to verify the jar was
loaded correctly.</p><p><strong>Sample Code</strong></p><parameter
ac:name="language">java</parameter><plain-text-body>// Create a new intial
context, which loads from jndi.properties file:
javax.naming.Context ctx = new javax.naming.InitialContext();
// Lookup the connection factory:
@@ -115,24 +103,14 @@ javax.jms.TopicSession session = conn.cr
// Create a new subscriber to receive messages:
javax.jms.TopicSubscriber subscriber = session.createSubscriber(mytopic);
-</pre>
-</div></div><p>Notice the name of the topic in the sample is
<strong><code>MyTopic</code></strong>. ActiveMQ will read
the <strong><code>jndi.properties</code></strong> 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><p>Once you have
the <strong><code>jndi.properties</code></strong> edited and ready, it
needs to be accessible to your application. The easiest way is to
add <strong><code>jndi.properties</code></strong> to a jar file.
When <strong><code>new InitialContext()</code></strong> is called, it will
scan the resources and find the file. If you get
<strong><code>javax.naming.NamingException</code></strong>, it usually means
the <strong><code>jndi.properties</code></strong> file is not
accessible.</p><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 specificati
on will work just fine.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Example Recommended by
Specification</p></th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">Properties props = new Properties();
+</plain-text-body><p>Notice the name of the topic in the sample is
<strong><code>MyTopic</code></strong>. ActiveMQ will read
the <strong><code>jndi.properties</code></strong> 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><p>Once you have
the <strong><code>jndi.properties</code></strong> edited and ready, it
needs to be accessible to your application. The easiest way is to
add <strong><code>jndi.properties</code></strong> to a jar file.
When <strong><code>new InitialContext()</code></strong> is called, it will
scan the resources and find the file. If you get
<strong><code>javax.naming.NamingException</code></strong>, it usually means
the <strong><code>jndi.properties</code></strong> file is not
accessible.</p><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 speci
fication will work just fine.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Example Recommended by
Specification</p></th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><parameter
ac:name="language">java</parameter><plain-text-body>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);||
-</pre>
-</div></div></td></tr></tbody></table></div><p>If ActiveMQ is embedded within
an EJB container, you will need to look at the containers documentation for the
correct JNDI values.</p><h3
id="JNDISupport-DynamicallyCreatingDestinations">Dynamically Creating
Destinations</h3><p>For the easiest possible configuration with JNDI based
programs, there are two dynamic contexts,
namely:</p><ul><li><strong><code>dynamicQueues</code></strong></li><li><strong><code>dynamicTopics</code></strong></li></ul><p>These
allow you to lookup queues and topics using JNDI without any
configuration.</p><p>For example, if you use the following name to lookup into
JNDI:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">dynamicQueues/FOO.BAR
-</pre>
-</div></div><p>you will get back
an <strong><code>ActiveMQQueue</code></strong> of the name
<strong><code>FOO.BAR</code></strong>. This can be very handy if you can easily
reconfigure the JNDI name to use to lookup something in JNDI, but don't want to
have to double configure a <strong><code>jndi.properties</code></strong>
to match.</p><h3 id="JNDISupport-WorkingWithEmbeddedBrokers">Working With
Embedded Brokers</h3><p>It is often useful to use an embedded broker in the
same JVM as the JMS client. For this see <a shape="rect"
href="how-do-i-embed-a-broker-inside-a-connection.html">How do I embed a Broker
inside a Connection</a>.</p><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">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 pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">vm://locahost
-</pre>
-</div></div><p>If you want to customize the broker use something like
this:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">vm:broker:(tcp://localhost:61616)
-</pre>
-</div></div><p>More options are available in the <a shape="rect"
href="vm-transport-reference.html">VM Transport Reference</a></p><h3
id="JNDISupport-ExampleJavaCode">Example Java Code</h3><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 pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">/**
+</plain-text-body></td></tr></tbody></table></div><p>If ActiveMQ is embedded
within an EJB container, you will need to look at the containers documentation
for the correct JNDI values.</p><h3
id="JNDISupport-DynamicallyCreatingDestinations">Dynamically Creating
Destinations</h3><p>For the easiest possible configuration with JNDI based
programs, there are two dynamic contexts,
namely:</p><ul><li><strong><code>dynamicQueues</code></strong></li><li><strong><code>dynamicTopics</code></strong></li></ul><p>These
allow you to lookup queues and topics using JNDI without any
configuration.</p><p>For example, if you use the following name to lookup into
JNDI:</p><plain-text-body>dynamicQueues/FOO.BAR
+</plain-text-body><p>you will get back
an <strong><code>ActiveMQQueue</code></strong> of the name
<strong><code>FOO.BAR</code></strong>. This can be very handy if you can easily
reconfigure the JNDI name to use to lookup something in JNDI, but don't want to
have to double configure a <strong><code>jndi.properties</code></strong>
to match.</p><h3 id="JNDISupport-WorkingWithEmbeddedBrokers">Working With
Embedded Brokers</h3><p>It is often useful to use an embedded broker in the
same JVM as the JMS client. For this see <a shape="rect"
href="how-do-i-embed-a-broker-inside-a-connection.html">How do I embed a Broker
inside a Connection</a>.</p><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">VM Transport</a> to connect to the broker in
your URL. e.g. to create a purely in JVM broker use this
URI</p><plain-text-body>vm://locahost
+</plain-text-body><p>If you want to customize the broker use something like
this:</p><plain-text-body>vm:broker:(tcp://localhost:61616)
+</plain-text-body><p>More options are available in the <a shape="rect"
href="vm-transport-reference.html">VM Transport Reference</a></p><h3
id="JNDISupport-ExampleJavaCode">Example Java Code</h3><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><parameter
ac:name="language">java</parameter><plain-text-body>/**
* The SimpleQueueSender class consists only of a main method,
* which sends several messages to a queue.
*
@@ -253,8 +231,7 @@ public final class SimpleProducer {
}
}
}
-</pre>
-</div></div></div>
+</plain-text-body></div>
</td>
<td valign="top">
<div class="navigation">
Modified:
websites/production/activemq/content/kahadb-replication-experimental.html
==============================================================================
--- websites/production/activemq/content/kahadb-replication-experimental.html
(original)
+++ websites/production/activemq/content/kahadb-replication-experimental.html
Fri Aug 25 08:24:11 2017
@@ -32,17 +32,6 @@
</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
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 ™ -- KahaDB Replication (Experimental)
@@ -82,10 +71,8 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><div class="confluence-information-macro
confluence-information-macro-warning"><p class="title">Note</p><span
class="aui-icon aui-icon-small aui-iconfont-error
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>This is under review - and not
currently supported.</p></div></div><h2
id="KahaDBReplication(Experimental)-Overview">Overview</h2><p>The new KahaDB
store supports a very fast and flexible replication system. It
features:</p><ul><li>Journal level replication (The translates into lower
overhead to the master to replicate records).</li><li>Support for multiple
slaves.</li><li>Support to dynamically add slaves at runtime.</li><li>Uses
multiple concurrent data transfer sessions to do an initial slave
synchronization.</li><li>Big slave synchronizations can be resumed so
synchronization progress is not lost if a slave is restarted.</li><li>A
configurable minimum number of replicas allows you to pause proc
essing until the data has been guaranteed to be replicated enough
times.</li></ul><h2 id="KahaDBReplication(Experimental)-MasterElection">Master
Election</h2><p>KahaDB supports a pluggable Master Election algorithm but the
only current implementation is one based on <a shape="rect"
class="external-link"
href="http://hadoop.apache.org/zookeeper">ZooKeeper</a>.</p><p>ZooKeeper is
used to implement the master election algorithm. ZooKeeper is a very fast,
replicated, in memory database with features that make it easy to implement
cluster control algorithms. It is an Apache project which you can <a
shape="rect" class="external-link"
href="http://hadoop.apache.org/zookeeper/releases.html">freely download</a>.
You must installed and have at least one ZooKeeper server running before
setting up a KahaDB Master Slave configuration.</p><h2
id="KahaDBReplication(Experimental)-ConfiguringaBroker:">Configuring a
Broker:</h2><p>The ActiveMQ binary distribution includes a KahaDB HA broker
configura
tion at <strong>$ACTIVEMQ_HOME/conf/ha.xml</strong>.</p><p>It it setup to look
for a ZooKeeper 3.0.0 server on localhost at port 2181. Edit the configuration
if this is not where you are running your ZooKeeper server.</p><p>Start the
configuation up by running:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">prompt> $ACTIVEMQ_HOME/bin/activemq xbean:ha.xml
-</pre>
-</div></div><p>The actual contents of the configuration file follows:</p><div
class="error"><span class="error">Error formatting macro: snippet:
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div><h2
id="KahaDBReplication(Experimental)-UnderstandingthekahadbReplicationXMLelement">Understanding
the kahadbReplication XML element</h2><h3
id="KahaDBReplication(Experimental)-ThebrokerURIAttribute">The brokerURI
Attribute</h3><p>Notice that the the brokerURI attribute points at another
broker configuration file. The ha-broker.xml contains the actual broker
configuration that the broker uses when the node take over as master. The
ha-broker.xml configuration file is a standard broker configuration except in
these aspects:</p><ul><li>It MUST set the start="false" attribute on the broker
element.</li><li>It MUST not configure a persistenceAdapter.</li></ul><p>The
above rules allows the replication system to inject the replicated KahaDB store
into the Master when it's starti
ng up.</p><h3
id="KahaDBReplication(Experimental)-TheminimumReplicasAttribute">The
minimumReplicas Attribute</h3><p>The minimumReplicas specifies how many copies
of the database are required before synchronous update operations are deemed
successful. Setting this to 0 allows a broker to continue operating even if
there are no slaves attached. If the value is set to 1 or greater, and there
are no slaves attached, the brokers persistent message processing will be
suspended until the minimum number of slaves are attached and the data
synchronized.</p><h3 id="KahaDBReplication(Experimental)-TheuriAttribute">The
uri Attribute</h3><p>The uri attribute should always be configured with a
<strong>kdbr://</strong> based URI. KDBR stands for 'KahaDB Replication' and
this is the replication protocol used between the masters and the slaves. The
master binds the specified port with slaves subsequently connect to and
establish replication sessions. The host name in the uri MUST get updated to
the
actual machine's host name since this is also used to identify the nodes in
the cluster.</p><h3
id="KahaDBReplication(Experimental)-ThedirectoryAttribute">The directory
Attribute</h3><p>This is the data directory where the KahaDB will store it's
persistence files.</p></div>
+<div class="wiki-content maincontent"><parameter
ac:name="title">Note</parameter><rich-text-body><p>This is under review - and
not currently supported.</p></rich-text-body><h2
id="KahaDBReplication(Experimental)-Overview">Overview</h2><p>The new KahaDB
store supports a very fast and flexible replication system. It
features:</p><ul><li>Journal level replication (The translates into lower
overhead to the master to replicate records).</li><li>Support for multiple
slaves.</li><li>Support to dynamically add slaves at runtime.</li><li>Uses
multiple concurrent data transfer sessions to do an initial slave
synchronization.</li><li>Big slave synchronizations can be resumed so
synchronization progress is not lost if a slave is restarted.</li><li>A
configurable minimum number of replicas allows you to pause processing until
the data has been guaranteed to be replicated enough times.</li></ul><h2
id="KahaDBReplication(Experimental)-MasterElection">Master
Election</h2><p>KahaDB supports a plugga
ble Master Election algorithm but the only current implementation is one based
on <a shape="rect" class="external-link"
href="http://hadoop.apache.org/zookeeper">ZooKeeper</a>.</p><p>ZooKeeper is
used to implement the master election algorithm. ZooKeeper is a very fast,
replicated, in memory database with features that make it easy to implement
cluster control algorithms. It is an Apache project which you can <a
shape="rect" class="external-link"
href="http://hadoop.apache.org/zookeeper/releases.html">freely download</a>.
You must installed and have at least one ZooKeeper server running before
setting up a KahaDB Master Slave configuration.</p><h2
id="KahaDBReplication(Experimental)-ConfiguringaBroker:">Configuring a
Broker:</h2><p>The ActiveMQ binary distribution includes a KahaDB HA broker
configuration at <strong>$ACTIVEMQ_HOME/conf/ha.xml</strong>.</p><p>It it setup
to look for a ZooKeeper 3.0.0 server on localhost at port 2181. Edit the
configuration if this is not where you ar
e running your ZooKeeper server.</p><p>Start the configuation up by
running:</p><plain-text-body>prompt> $ACTIVEMQ_HOME/bin/activemq xbean:ha.xml
+</plain-text-body><p>The actual contents of the configuration file
follows:<plain-text-body>{snippet:lang=xml|id=example|url=activemq/trunk/assembly/src/release/conf/ha.xml}</plain-text-body></p><h2
id="KahaDBReplication(Experimental)-UnderstandingthekahadbReplicationXMLelement">Understanding
the kahadbReplication XML element</h2><h3
id="KahaDBReplication(Experimental)-ThebrokerURIAttribute">The brokerURI
Attribute</h3><p>Notice that the the brokerURI attribute points at another
broker configuration file. The ha-broker.xml contains the actual broker
configuration that the broker uses when the node take over as master. The
ha-broker.xml configuration file is a standard broker configuration except in
these aspects:</p><ul><li>It MUST set the start="false" attribute on the broker
element.</li><li>It MUST not configure a persistenceAdapter.</li></ul><p>The
above rules allows the replication system to inject the replicated KahaDB store
into the Master when it's starting up.</p><h3 id="Ka
haDBReplication(Experimental)-TheminimumReplicasAttribute">The minimumReplicas
Attribute</h3><p>The minimumReplicas specifies how many copies of the database
are required before synchronous update operations are deemed successful.
Setting this to 0 allows a broker to continue operating even if there are no
slaves attached. If the value is set to 1 or greater, and there are no slaves
attached, the brokers persistent message processing will be suspended until the
minimum number of slaves are attached and the data synchronized.</p><h3
id="KahaDBReplication(Experimental)-TheuriAttribute">The uri
Attribute</h3><p>The uri attribute should always be configured with a
<strong>kdbr://</strong> based URI. KDBR stands for 'KahaDB Replication' and
this is the replication protocol used between the masters and the slaves. The
master binds the specified port with slaves subsequently connect to and
establish replication sessions. The host name in the uri MUST get updated to
the actual machine's hos
t name since this is also used to identify the nodes in the cluster.</p><h3
id="KahaDBReplication(Experimental)-ThedirectoryAttribute">The directory
Attribute</h3><p>This is the data directory where the KahaDB will store it's
persistence files.</p></div>
</td>
<td valign="top">
<div class="navigation">
Modified: websites/production/activemq/content/persistence.html
==============================================================================
--- websites/production/activemq/content/persistence.html (original)
+++ websites/production/activemq/content/persistence.html Fri Aug 25 08:24:11
2017
@@ -32,16 +32,6 @@
</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 ™ -- Persistence
@@ -81,20 +71,11 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2
id="Persistence-ActiveMQV5.9">ActiveMQ V5.9</h2><p>In ActiveMQ 5.9, the <a
shape="rect" href="replicated-leveldb-store.html">Replicated LevelDB Store</a>
is introduced. It handles using <a shape="rect" class="external-link"
href="http://zookeeper.apache.org/">Apache ZooKeeper</a> to pick a master from
a set of broker nodes configured to replicate single LevelDB Store. Then
synchronizes all slave LevelDB Stores with the master keeps them up to date by
replicating all updates to the master. This might become the preferred <a
shape="rect" href="masterslave.html">Master Slave</a> configuration going
forward.</p><h2 id="Persistence-ActiveMQV5.8">ActiveMQ V5.8</h2><p>In ActiveMQ
5.8, the <a shape="rect" href="leveldb-store.html">LevelDB Store</a> was
introduced. The LevelDB Store is a file based persistence database. It has been
optimized to provide even faster persistence than KahaDB. Although not yet the
default message store, we expect this sto
re implementation become the default in future releases.</p><h2
id="Persistence-ActiveMQV5.3">ActiveMQ V5.3</h2><p>From 5.3 onwards - we
recommend you use <a shape="rect" href="kahadb.html">KahaDB</a> - which offers
improved scalability and recoverability over the <a shape="rect"
href="amq-message-store.html">AMQ Message Store</a>.<br clear="none"> The <a
shape="rect" href="amq-message-store.html">AMQ Message Store</a> which although
faster than <a shape="rect" href="kahadb.html">KahaDB</a> - does not scales as
well as <a shape="rect" href="kahadb.html">KahaDB</a> and recovery times take
longer.</p><h2 id="Persistence-ActiveMQV4">ActiveMQ V4</h2><p>For long term
persistence we recommend using JDBC coupled with our high performance journal.
You can use just JDBC if you wish but its quite slow.</p><p>Our out of the box
default configuration uses <a shape="rect" class="external-link"
href="http://incubator.apache.org/derby/">Apache Derby</a> as the default
database, which is easy to em
bed - but we support all the <a shape="rect" href="jdbc-support.html">major
SQL databases</a> - just reconfigure your JDBC configuration in the <a
shape="rect" href="xml-configuration.html">Xml Configuration</a>.</p><h2
id="Persistence-Highperformancejournal-ActiveMQ4.x">High performance journal -
ActiveMQ 4.x</h2><p>To achieve high performance of durable messaging in
ACtiveMQ V4.x we strongly recommend you use our high performance journal -
which is enabled by default. This works rather like a database; messages (and
transcation commits/rollbacks and message acknowledgements) are written to the
journal as fast as is humanly possible - then at intervals we checkpoint the
journal to the long term persistence storage (in this case JDBC).</p><p>Its
common when using queues for example that messages are consumed fairly shortly
after being published; so you could publish 10,000 messages and only have a few
messages outstanding - so when we checkpoint to the JDBC database, we often
have o
nly a small amount of messages to actually write to JDBC. Even if we have to
write all the messages to the JDBC, we still get performance gains with the
journal, since we can use a large transaction batch to insert the messages into
the JDBC database to boost performance on the JDBC side.</p><p>Our journal is
based on lots of the great work in the <a shape="rect" class="external-link"
href="http://howl.objectweb.org/" rel="nofollow">Howl</a> project; we keep
close ties to the Howl community. However since ActiveMQ has to handle
arbitarily large message sizes, we've had to make our journal handle any size
of message and so we don't use the fixed size record model that Howl
uses.</p><h2 id="Persistence-Configuringpersistence">Configuring
persistence</h2><p>For full explict control over configuration check out the <a
shape="rect" href="xml-configuration.html">Xml Configuration</a>. However a
quick way to set which persistence adapter to use is to set the following
system property to be
the class name of the PersistenceAdapter implementation.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">activemq.persistenceAdapter
-</pre>
-</div></div><p>When running the broker from the command line, we look for the
activemq.xml on the classpath unless you specify one to use. e.g.<br
clear="none"> <strong>AMQ 4.x</strong></p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">activemq xbean:file:myconfig.xml
-</pre>
-</div></div><p><strong>AMQ 3.x</strong></p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">activemq myconfig.xml
-</pre>
-</div></div><p>or just<br clear="none"> <strong>AMQ3.x/AMQ4.x</strong></p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">activemq
-</pre>
-</div></div><p>Here is a sample XML configuration which shows how to configure
the journal and the JDBC persistence.</p><p>AMQ 5.x</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><beans
+<div class="wiki-content maincontent"><h2
id="Persistence-ActiveMQV5.9">ActiveMQ V5.9</h2><p>In ActiveMQ 5.9, the <a
shape="rect" href="replicated-leveldb-store.html">Replicated LevelDB Store</a>
is introduced. It handles using <a shape="rect" class="external-link"
href="http://zookeeper.apache.org/">Apache ZooKeeper</a> to pick a master from
a set of broker nodes configured to replicate single LevelDB Store. Then
synchronizes all slave LevelDB Stores with the master keeps them up to date by
replicating all updates to the master. This might become the preferred <a
shape="rect" href="masterslave.html">Master Slave</a> configuration going
forward.</p><h2 id="Persistence-ActiveMQV5.8">ActiveMQ V5.8</h2><p>In ActiveMQ
5.8, the <a shape="rect" href="leveldb-store.html">LevelDB Store</a> was
introduced. The LevelDB Store is a file based persistence database. It has been
optimized to provide even faster persistence than KahaDB. Although not yet the
default message store, we expect this sto
re implementation become the default in future releases.</p><h2
id="Persistence-ActiveMQV5.3">ActiveMQ V5.3</h2><p>From 5.3 onwards - we
recommend you use <a shape="rect" href="kahadb.html">KahaDB</a> - which offers
improved scalability and recoverability over the <a shape="rect"
href="amq-message-store.html">AMQ Message Store</a>.<br clear="none"> The <a
shape="rect" href="amq-message-store.html">AMQ Message Store</a> which although
faster than <a shape="rect" href="kahadb.html">KahaDB</a> - does not scales as
well as <a shape="rect" href="kahadb.html">KahaDB</a> and recovery times take
longer.</p><h2 id="Persistence-ActiveMQV4">ActiveMQ V4</h2><p>For long term
persistence we recommend using JDBC coupled with our high performance journal.
You can use just JDBC if you wish but its quite slow.</p><p>Our out of the box
default configuration uses <a shape="rect" class="external-link"
href="http://incubator.apache.org/derby/">Apache Derby</a> as the default
database, which is easy to em
bed - but we support all the <a shape="rect" href="jdbc-support.html">major
SQL databases</a> - just reconfigure your JDBC configuration in the <a
shape="rect" href="xml-configuration.html">Xml Configuration</a>.</p><h2
id="Persistence-Highperformancejournal-ActiveMQ4.x">High performance journal -
ActiveMQ 4.x</h2><p>To achieve high performance of durable messaging in
ACtiveMQ V4.x we strongly recommend you use our high performance journal -
which is enabled by default. This works rather like a database; messages (and
transcation commits/rollbacks and message acknowledgements) are written to the
journal as fast as is humanly possible - then at intervals we checkpoint the
journal to the long term persistence storage (in this case JDBC).</p><p>Its
common when using queues for example that messages are consumed fairly shortly
after being published; so you could publish 10,000 messages and only have a few
messages outstanding - so when we checkpoint to the JDBC database, we often
have o
nly a small amount of messages to actually write to JDBC. Even if we have to
write all the messages to the JDBC, we still get performance gains with the
journal, since we can use a large transaction batch to insert the messages into
the JDBC database to boost performance on the JDBC side.</p><p>Our journal is
based on lots of the great work in the <a shape="rect" class="external-link"
href="http://howl.objectweb.org/" rel="nofollow">Howl</a> project; we keep
close ties to the Howl community. However since ActiveMQ has to handle
arbitarily large message sizes, we've had to make our journal handle any size
of message and so we don't use the fixed size record model that Howl
uses.</p><h2 id="Persistence-Configuringpersistence">Configuring
persistence</h2><p>For full explict control over configuration check out the <a
shape="rect" href="xml-configuration.html">Xml Configuration</a>. However a
quick way to set which persistence adapter to use is to set the following
system property to be
the class name of the PersistenceAdapter
implementation.</p><plain-text-body>activemq.persistenceAdapter
+</plain-text-body><p>When running the broker from the command line, we look
for the activemq.xml on the classpath unless you specify one to use. e.g.<br
clear="none"> <strong>AMQ 4.x</strong></p><plain-text-body>activemq
xbean:file:myconfig.xml
+</plain-text-body><p><strong>AMQ 3.x</strong></p><plain-text-body>activemq
myconfig.xml
+</plain-text-body><p>or just<br clear="none">
<strong>AMQ3.x/AMQ4.x</strong></p><plain-text-body>activemq
+</plain-text-body><p>Here is a sample XML configuration which shows how to
configure the journal and the JDBC persistence.</p><p>AMQ 5.x</p><parameter
ac:name="">xml</parameter><plain-text-body><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"
@@ -130,73 +111,23 @@
<property name="poolPreparedStatements" value="true"/>
</bean>
-->
-</beans></pre>
-</div></div><p>For more details see the <a shape="rect"
href="initial-configuration.html">Initial Configuration</a> guide.</p><h2
id="Persistence-JDBCPersistencewithoutJournaling">JDBC Persistence without
Journaling</h2><p>To enable JDBC persistence of JMS messages without
journaling, we need to change the message broker's default persistence
configuration from<br clear="none"> <strong>AMQ 4.x</strong></p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><persistenceAdapter>
+</beans></plain-text-body><p>For more details see the <a shape="rect"
href="initial-configuration.html">Initial Configuration</a> guide.</p><h2
id="Persistence-JDBCPersistencewithoutJournaling">JDBC Persistence without
Journaling</h2><p>To enable JDBC persistence of JMS messages without
journaling, we need to change the message broker's default persistence
configuration from<br clear="none"> <strong>AMQ
4.x</strong></p><plain-text-body><persistenceAdapter>
<journaledJDBC journalLogFiles="5"
dataDirectory="../activemq-data"/>
</persistenceAdapter>
-</pre>
-</div></div><p>to</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><persistenceAdapter>
+</plain-text-body><p>to</p><plain-text-body><persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#my-ds"/>
</persistenceAdapter>
-</pre>
-</div></div><p><strong>For AMQ 3.x</strong></p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><persistence>
+</plain-text-body><p><strong>For AMQ
3.x</strong></p><plain-text-body><persistence>
<journalPersistence directory="../var/journal">
<jdbcPersistence dataSourceRef="derby-ds"/>
</journalPersistence>
</persistence>
-</pre>
-</div></div><p>to</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><persistence>
+</plain-text-body><p>to</p><plain-text-body><persistence>
<jdbcPersistence dataSourceRef="derby-ds"/>
</persistence>
-</pre>
-</div></div><p>Make sure to send durable messages so that it will be persisted
in the database server while waiting to be consumed by clients. More
information on configuration JDBC persistence at <a shape="rect"
href="jdbc-support.html">JDBC Support</a></p><p></p><h2
id="Persistence-KahaPersistence">Kaha Persistence</h2>
-
-<p>Kaha Peristence is a storage solution written especially for message
persistence and is part of the ActiveMQ project. It's tuned to provide optimal
performance for typical message usage patterns, which involves writing/reading
and discarding messages that are persisted very quickly.</p>
-
-<p>Data stored in Kaha is appended to data logs - the log files are discarded
once there is no longer interest in the data contained in the log.</p>
-
-<h3 id="Persistence-ConfiguringKahaPersistence">Configuring Kaha
Persistence</h3>
-
-<p>In the broker XML specify the persistence adaptor to be Kaha e.g.</p>
-
-<p>ActiveMQ 5.0 and above:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
- <broker brokerName="broker" persistent="true" useShutdownHook="false">
- <transportConnectors>
- <transportConnector uri="tcp://localhost:61616"/>
- </transportConnectors>
- <persistenceAdapter>
- <kahaPersistenceAdapter directory="activemq-data"
maxDataFileLength="33554432"/>
- </persistenceAdapter>
- </broker>
-</pre>
-</div></div>
-
-
-<p>ActiveMQ 4.1 and earlier:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
- <broker brokerName="broker" persistent="true" useShutdownHook="false">
- <transportConnectors>
- <transportConnector uri="tcp://localhost:61616"/>
- </transportConnectors>
- <persistenceAdapter>
- <kahaPersistenceAdapter dir="activemq-data"
maxDataFileLength="33554432"/>
- </persistenceAdapter>
- </broker>
-</pre>
-</div></div><h2 id="Persistence-DisasterRecoveryoptions">Disaster Recovery
options</h2><p>For people with high <a shape="rect" href="dr.html">DR</a>
requirements we have various options for providing a <a shape="rect"
href="replicated-message-store.html">Replicated Message Store</a> to allow full
failover in times of major data centre failure.</p><h2
id="Persistence-DisablingPersistence">Disabling Persistence</h2><p>If you don't
want persistence at all you can disable it easily via the <a shape="rect"
href="xml-configuration.html">Xml Configuration</a>. e.g.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><broker persistent="false">
+</plain-text-body><p>Make sure to send durable messages so that it will be
persisted in the database server while waiting to be consumed by clients. More
information on configuration JDBC persistence at <a shape="rect"
href="jdbc-support.html">JDBC Support</a></p><p><parameter ac:name=""><a
shape="rect" href="kaha-persistence.html">Kaha
Persistence</a></parameter></p><h2
id="Persistence-DisasterRecoveryoptions">Disaster Recovery options</h2><p>For
people with high <a shape="rect" href="dr.html">DR</a> requirements we have
various options for providing a <a shape="rect"
href="replicated-message-store.html">Replicated Message Store</a> to allow full
failover in times of major data centre failure.</p><h2
id="Persistence-DisablingPersistence">Disabling Persistence</h2><p>If you don't
want persistence at all you can disable it easily via the <a shape="rect"
href="xml-configuration.html">Xml Configuration</a>.
e.g.</p><plain-text-body><broker persistent="false">
</broker>
-</pre>
-</div></div><p>This will make the broker use the <a shape="rect"
class="external-link"
href="http://activemq.apache.org/maven/apidocs/org/apache/activemq/store/memory/MemoryPersistenceAdapter.html"><memoryPersistenceAdapter></a><br
clear="none"> For an example of using a configuration URI see <a shape="rect"
href="how-to-unit-test-jms-code.html">How To Unit Test JMS Code</a></p></div>
+</plain-text-body><p>This will make the broker use the <a shape="rect"
class="external-link"
href="http://activemq.apache.org/maven/apidocs/org/apache/activemq/store/memory/MemoryPersistenceAdapter.html"><memoryPersistenceAdapter></a><br
clear="none"> For an example of using a configuration URI see <a shape="rect"
href="how-to-unit-test-jms-code.html">How To Unit Test JMS Code</a></p></div>
</td>
<td valign="top">
<div class="navigation">