camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache Camel > ActiveMQ Journal
Date Sat, 02 Nov 2013 18:35:02 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/en/2176/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><s>ActiveMQ Journal</s></h2>
     <h4>Page <b>removed</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
     <br/>
     <div class="notificationGreySide">
         <h2><a name="ActiveMQJournal-ActiveMQJournalComponent"></a>ActiveMQ
Journal Component</h2>

<p>The ActiveMQ Journal Component allows messages to be stored in a rolling log file
and then consumed from that log file.  The journal aggregates and batches up concurrent writes
so that the overhead of writing and waiting for the disk sync is relatively constant regardless
of how many concurrent writes are being done.  Therefore, this component supports and encourages
you to use multiple concurrent producers to the same journal endpoint.</p>

<p>Each journal endpoint uses a different log file and therefore write batching (and
the associated performance boost) does not occur between multiple endpoints.</p>

<p>This component only supports one active consumer on the endpoint.  After the message
is processed by the consumer's processor, the log file is marked and only subsequent messages
in the log file will get delivered to consumers.</p>


<h3><a name="ActiveMQJournal-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
activemq.journal:directoryName[?options]
</pre>
</div></div>

<p>So for example, to send to the journal located in the <tt>/tmp/data</tt>
directory you would use the following URI:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
activemq.journal:/tmp/data
</pre>
</div></div>

<h3><a name="ActiveMQJournal-Options"></a>Options</h3>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>syncConsume</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> If set to <tt>true</tt>, when the journal is marked
after a message is consumed, wait till the Operating System has verified the mark update is
safely stored on disk. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>syncProduce</tt> </td>
<td class='confluenceTd'> <tt>true</tt> </td>
<td class='confluenceTd'> If set to <tt>true</tt>, wait till the Operating
System has verified the message is safely stored on disk. </td>
</tr>
</tbody></table>
</div>
</div>

<p>You can append query options to the URI in the following format, <tt>?option=value&amp;option=value&amp;...</tt></p>

<h3><a name="ActiveMQJournal-ExpectedExchangeDataTypes"></a>Expected Exchange
Data Types</h3>

<p>The consumer of a Journal endpoint generates <a href="http://activemq.apache.org/camel/maven/camel-core/apidocs/org/apache/camel/impl/DefaultExchange.html"
class="external-link" rel="nofollow">DefaultExchange</a> objects with the <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#getIn()"
class="external-link" rel="nofollow">in message</a> :</p>
<ul>
	<li><a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Message.html#getHeader(java.lang.String)"
class="external-link" rel="nofollow">header</a> "journal" : set to the endpoint uri
of the journal the message came from</li>
	<li><a href="http://camel.apache.org/maven/current//camel-core/apidocs/org/apache/camel/Message.html#getHeader(java.lang.String)"
class="external-link" rel="nofollow">header</a> "location" : set to a <a href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/kaha/impl/async/Location.html"
class="external-link" rel="nofollow">Location</a> which identifies where the recored
was stored on disk</li>
	<li><a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Message.html#getBody()"
class="external-link" rel="nofollow">body</a> : set to <a href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/util/ByteSequence.html"
class="external-link" rel="nofollow">ByteSequence</a> which contains the byte array
data of the stored message</li>
</ul>


<p>The producer to a Journal endpoint expects an <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html"
class="external-link" rel="nofollow">Exchange</a> with an In message where the body
can be converted to a <a href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/util/ByteSequence.html"
class="external-link" rel="nofollow">ByteSequence</a> or a byte[].</p>

<h3><a name="ActiveMQJournal-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

     </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message