camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r970381 [2/2] - in /websites/production/camel/content: activemq.html book-component-appendix.html book-in-one-page.html cache/main.pageCache
Date Tue, 27 Oct 2015 15:21:50 GMT
Modified: websites/production/camel/content/book-in-one-page.html
==============================================================================
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Tue Oct 27 15:21:50 2015
@@ -3703,11 +3703,11 @@ The tutorial has been designed in two pa
 While not actual tutorials you might find working through the source of the various <a
shape="rect" href="examples.html">Examples</a> useful.</li></ul>
 
 <h2 id="BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting
with JMS</h2><p>&#160;</p><div class="confluence-information-macro
confluence-information-macro-information"><p class="title">Thanks</p><span
class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>This tutorial was kindly donated to
Apache Camel by Martin Gilday.</p></div></div><h2 id="BookInOnePage-Preface">Preface</h2><p>This
tutorial aims to guide the reader through the stages of creating a project which uses Camel
to facilitate the routing of messages from a JMS queue to a <a shape="rect" class="external-link"
href="http://www.springramework.org" rel="nofollow">Spring</a> service. The route
works in a synchronous fashion returning a response to the client.</p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1445768302128 {padding: 0px;}
-div.rbtoc1445768302128 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1445768302128 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1445959137029 {padding: 0px;}
+div.rbtoc1445959137029 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1445959137029 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1445768302128">
+/*]]>*/</style></p><div class="toc-macro rbtoc1445959137029">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial
on Spring Remoting with JMS</a></li><li><a shape="rect" href="#BookInOnePage-Preface">Preface</a></li><li><a
shape="rect" href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a
shape="rect" href="#BookInOnePage-Distribution">Distribution</a></li><li><a
shape="rect" href="#BookInOnePage-About">About</a></li><li><a shape="rect"
href="#BookInOnePage-CreatetheCamelProject">Create the Camel Project</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-UpdatethePOMwithDependencies">Update
the POM with Dependencies</a></li></ul>
 </li><li><a shape="rect" href="#BookInOnePage-WritingtheServer">Writing
the Server</a>
@@ -5812,11 +5812,11 @@ So we completed the last piece in the pi
 <p>This example has been removed from <strong>Camel 2.9</strong> onwards.
Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use <a shape="rect"
href="cxf.html">CXF</a> instead of Axis.</p></div></div>
 
 <style type="text/css">/*<![CDATA[*/
-div.rbtoc1445768302483 {padding: 0px;}
-div.rbtoc1445768302483 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1445768302483 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1445959137963 {padding: 0px;}
+div.rbtoc1445959137963 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1445959137963 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style><div class="toc-macro rbtoc1445768302483">
+/*]]>*/</style><div class="toc-macro rbtoc1445959137963">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialusingAxis1.4withApacheCamel">Tutorial
using Axis 1.4 with Apache Camel</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a
shape="rect" href="#BookInOnePage-Distribution">Distribution</a></li><li><a
shape="rect" href="#BookInOnePage-Introduction">Introduction</a></li><li><a
shape="rect" href="#BookInOnePage-SettinguptheprojecttorunAxis">Setting up the project
to run Axis</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Maven2">Maven
2</a></li><li><a shape="rect" href="#BookInOnePage-wsdl">wsdl</a></li><li><a
shape="rect" href="#BookInOnePage-ConfiguringAxis">Configuring Axis</a></li><li><a
shape="rect" href="#BookInOnePage-RunningtheExample">Running the Example</a></li></ul>
@@ -16323,69 +16323,23 @@ from(&quot;direct:tap&quot;)
 </div></div><h4 id="BookInOnePage-UsinglogDSLinOSGi">Using log DSL in OSGi</h4><p><strong>Improvement
as of Camel 2.12.4/2.13.1</strong></p><p>When using log DSL inside OSGi
(e.g., in Karaf), the underlying logging mechanisms are provided by PAX logging. It searches
for a bundle which invokes&#160;<code>org.slf4j.LoggerFactory.getLogger()</code>
method and associates the bundle with the logger instance. Passing only logger name to log
DSL results in associating&#160;<code>camel-core</code> bundle with the logger
instance created.</p><p>In some scenarios it is required that the bundle associated
with logger should be the bundle which contains route definition. This is possible using provided
logger instance both for Java DSL and Spring DSL (see the examples above).</p><p></p><h4
id="BookInOnePage-UsingThisPattern.48">Using This Pattern</h4>
 
 <p>If you would like to use this EIP Pattern then please read the <a shape="rect"
href="getting-started.html">Getting Started</a>, you may also find the <a shape="rect"
href="architecture.html">Architecture</a> useful particularly the description of
<a shape="rect" href="endpoint.html">Endpoint</a> and <a shape="rect" href="uris.html">URIs</a>.
Then you could try out some of the <a shape="rect" href="examples.html">Examples</a>
first before trying this pattern out.</p></div>
-<div class="chapter" id="chapter-component-appendix"><h1 id="BookInOnePage-ComponentAppendix">Component
Appendix</h1><p>There now follows the documentation on each Camel component.</p><h2
id="BookInOnePage-ActiveMQComponent">ActiveMQ Component</h2>
-
-<p>The ActiveMQ component allows messages to be sent to a <a shape="rect" class="external-link"
href="http://java.sun.com/products/jms/" rel="nofollow">JMS</a> Queue or Topic or
messages to be consumed from a JMS Queue or Topic using <a shape="rect" class="external-link"
href="http://activemq.apache.org/" title="The most popular and powerful open source message
broker">Apache ActiveMQ</a>. </p>
-
-<p>This component is based on <a shape="rect" href="jms.html">JMS Component</a>
and uses Spring's JMS support for declarative transactions, using Spring's <code>JmsTemplate</code>
for sending and a <code>MessageListenerContainer</code> for consuming. All the
options from the <a shape="rect" href="jms.html">JMS</a> component also applies
for this component.</p>
-
-<p>To use this component make sure you have the <code>activemq.jar</code>
or <code>activemq-core.jar</code> on your classpath along with any Camel dependencies
such as <code>camel-core.jar</code>, <code>camel-spring.jar</code>
and <code>camel-jms.jar</code>.</p>
-
-<div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Transacted
and caching</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
-<p>See section <em>Transactions and Cache Levels</em> below on <a shape="rect"
href="jms.html">JMS</a> page if you are using transactions with <a shape="rect"
href="jms.html">JMS</a> as it can impact performance.</p></div></div>
-
-<h3 id="BookInOnePage-URIformat.1">URI format</h3>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-activemq:[queue:|topic:]destinationName
+<div class="chapter" id="chapter-component-appendix"><h1 id="BookInOnePage-ComponentAppendix">Component
Appendix</h1><p>There now follows the documentation on each Camel component.</p><h2
id="BookInOnePage-ActiveMQComponent">ActiveMQ Component</h2><p>The ActiveMQ
component allows messages to be sent to a <a shape="rect" class="external-link" href="http://java.sun.com/products/jms/"
rel="nofollow">JMS</a> Queue or Topic or messages to be consumed from a JMS Queue
or Topic using <a shape="rect" class="external-link" href="http://activemq.apache.org/"
title="The most popular and powerful open source message broker">Apache ActiveMQ</a>.</p><p>This
component is based on <a shape="rect" href="jms.html">JMS Component</a> and uses
Spring's JMS support for declarative transactions, using Spring's <code>JmsTemplate</code>
for sending and a <code>MessageListenerContainer</code> for consuming. All the
options from the <a shape="rect" href="jms.html">JMS</a> component also applies
for this compo
 nent.</p><p>To use this component make sure you have the <code>activemq.jar</code>
or <code>activemq-core.jar</code> on your classpath along with any Camel dependencies
such as <code>camel-core.jar</code>, <code>camel-spring.jar</code>
and <code>camel-jms.jar</code>.</p><div class="confluence-information-macro
confluence-information-macro-tip"><p class="title">Transacted and caching</p><span
class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>See section <em>Transactions and
Cache Levels</em> below on <a shape="rect" href="jms.html">JMS</a> page
if you are using transactions with <a shape="rect" href="jms.html">JMS</a> as
it can impact performance.</p></div></div><h3 id="BookInOnePage-URIformat.1">URI
format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[activemq:[queue:|topic:]destinationName
 ]]></script>
-</div></div>
-
-<p>Where <strong>destinationName</strong> is an ActiveMQ queue or topic
name. By default, the <strong>destinationName</strong> is interpreted as a queue
name. For example, to connect to the queue, <code>FOO.BAR</code>, use:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-activemq:FOO.BAR
+</div></div><p>Where <strong>destinationName</strong> is an
ActiveMQ queue or topic name. By default, the <strong>destinationName</strong>
is interpreted as a queue name. For example, to connect to the queue, <code>FOO.BAR</code>,
use:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[activemq:FOO.BAR
 ]]></script>
-</div></div>
-
-<p>You can include the optional <code>queue:</code> prefix, if you prefer:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-activemq:queue:FOO.BAR
+</div></div><p>You can include the optional <code>queue:</code>
prefix, if you prefer:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[activemq:queue:FOO.BAR
 ]]></script>
-</div></div>
-
-<p>To connect to a topic, you must include the <code>topic:</code> prefix.
For example, to connect to the topic, <code>Stocks.Prices</code>, use:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-activemq:topic:Stocks.Prices
+</div></div><p>To connect to a topic, you must include the <code>topic:</code>
prefix. For example, to connect to the topic, <code>Stocks.Prices</code>, use:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[activemq:topic:Stocks.Prices
 ]]></script>
-</div></div>
-
-<h3 id="BookInOnePage-Options.21">Options</h3>
-<p>See Options on the <a shape="rect" href="jms.html">JMS</a> component
as all these options also apply for this component.</p>
-
-<h3 id="BookInOnePage-ConfiguringtheConnectionFactory">Configuring the Connection Factory</h3>
-
-<p>This <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQRouteTest.java">test
case</a> shows how to add an ActiveMQComponent to the <a shape="rect" href="camelcontext.html">CamelContext</a>
using the <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/5.5.0/activemq-camel/apidocs/org/apache/activemq/camel/component/ActiveMQComponent.html#activeMQComponent%28java.lang.String%29"><code>activeMQComponent()</code>
method</a> while specifying the <a shape="rect" class="external-link" href="http://activemq.apache.org/configuring-transports.html">brokerURL</a>
used to connect to ActiveMQ. </p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-camelContext.addComponent(&quot;activemq&quot;, activeMQComponent(&quot;vm://localhost?broker.persistent=false&quot;));
+</div></div><h3 id="BookInOnePage-Options.21">Options</h3><p>See
Options on the <a shape="rect" href="jms.html">JMS</a> component as all these
options also apply for this component.</p><h3 id="BookInOnePage-ConfiguringtheConnectionFactory">Configuring
the Connection Factory</h3><p>This <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQRouteTest.java">test
case</a> shows how to add an ActiveMQComponent to the <a shape="rect" href="camelcontext.html">CamelContext</a>
using the <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/5.5.0/activemq-camel/apidocs/org/apache/activemq/camel/component/ActiveMQComponent.html#activeMQComponent%28java.lang.String%29"><code>activeMQComponent()</code>
method</a> while specifying the <a shape="rect" class="external-link" href="http://activemq.apache.org/configuring-transports.html">brokerURL</a>
used to connect to
  ActiveMQ.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[camelContext.addComponent(&quot;activemq&quot;,
activeMQComponent(&quot;vm://localhost?broker.persistent=false&quot;));
 ]]></script>
-</div></div>
-
-<h3 id="BookInOnePage-ConfiguringtheConnectionFactoryusingSpringXML">Configuring the
Connection Factory using Spring XML</h3>
-
-<p>You can configure the ActiveMQ broker URL on the ActiveMQComponent as follows</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
+</div></div><h3 id="BookInOnePage-ConfiguringtheConnectionFactoryusingSpringXML">Configuring
the Connection Factory using Spring XML</h3><p>You can configure the ActiveMQ
broker URL on the ActiveMQComponent as follows</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;beans
xmlns=&quot;http://www.springframework.org/schema/beans&quot;
    xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    xsi:schemaLocation=&quot;
    http://www.springframework.org/schema/beans 
@@ -16403,27 +16357,15 @@ camelContext.addComponent(&quot;activemq
 
 &lt;/beans&gt;
 ]]></script>
-</div></div>
-
-<h3 id="BookInOnePage-Usingconnectionpooling">Using connection pooling</h3>
-<p>When sending to an ActiveMQ broker using Camel it's recommended to use a pooled
connection factory to efficiently handle  pooling of JMS connections, sessions and producers.
This is documented on the <a shape="rect" class="external-link" href="http://activemq.apache.org/spring-support.html">ActiveMQ
Spring Support </a> page.</p>
-
-<p>You can grab ActiveMQ's <code>org.apache.activemq.pool.PooledConnectionFactory</code>
with Maven:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-&lt;dependency&gt;
+</div></div><h3 id="BookInOnePage-Usingconnectionpooling">Using connection
pooling</h3><p>When sending to an ActiveMQ broker using Camel it's recommended
to use a pooled connection factory to efficiently handle pooling of JMS connections, sessions
and producers. This is documented on the <a shape="rect" class="external-link" href="http://activemq.apache.org/spring-support.html">ActiveMQ
Spring Support </a> page.</p><p>You can grab ActiveMQ's <code>org.apache.activemq.pool.PooledConnectionFactory</code>
with Maven:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
    &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
    &lt;artifactId&gt;activemq-pool&lt;/artifactId&gt;
    &lt;version&gt;5.6.0&lt;/version&gt;
 &lt;/dependency&gt;
 ]]></script>
-</div></div>
-
-<p>And then setup the <strong>activemq</strong> Camel component as follows:</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-&lt;bean id=&quot;jmsConnectionFactory&quot; 
+</div></div><p>And then setup the <strong>activemq</strong>
Camel component as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean
id=&quot;jmsConnectionFactory&quot; 
    class=&quot;org.apache.activemq.ActiveMQConnectionFactory&quot;&gt;
    &lt;property name=&quot;brokerURL&quot; value=&quot;tcp://localhost:61616&quot;
/&gt;
 &lt;/bean&gt;
@@ -16451,59 +16393,21 @@ camelContext.addComponent(&quot;activemq
     --&gt;
 &lt;/bean&gt;
 ]]></script>
-</div></div>
-
-<div class="confluence-information-macro confluence-information-macro-note"><span
class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
-<p>Notice the <strong>init</strong> and <strong>destroy</strong>
methods on the pooled connection factory. This is important to ensure the connection pool
is properly started and shutdown.</p></div></div>
-
-<div class="confluence-information-macro confluence-information-macro-information"><p
class="title">Important information about when using transactions</p><span class="aui-icon
aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
-<p>If you are using transactions then see more details at <a shape="rect" href="jms.html">JMS</a>.
And remember to set <code>cacheLevelName</code> to <code>CACHE_CONSUMER</code>
if you are not using XA transactions. This can dramatically improve performance.</p></div></div>
-
-<p>The <code>PooledConnectionFactory</code> will then create a connection
pool with up to 8 connections in use at the same time. Each connection can be shared by many
sessions. There is an option named <code>maximumActive</code> you can use to configure
the maximum number of sessions per connection; the default value is <code>500</code>.
From <strong>ActiveMQ 5.7</strong> onwards the option has been renamed to better
reflect its purpose, being named as <code>maximumActiveSessionPerConnection</code>.
Notice the <code>concurrentConsumers</code> is set to a higher value than <code>maxConnections</code>
is. This is okay, as each consumer is using a session, and as a session can share the same
connection, we are in the safe. In this example we can have 8 * 500 = 4000 active sessions
at the same time.</p>
-
-<h3 id="BookInOnePage-InvokingMessageListenerPOJOsinaCamelroute">Invoking MessageListener
POJOs in a Camel route</h3>
-
-<p>The ActiveMQ component also provides a helper <a shape="rect" href="type-converter.html">Type
Converter</a> from a JMS MessageListener to a <a shape="rect" href="processor.html">Processor</a>.
This means that the <a shape="rect" href="bean.html">Bean</a> component is capable
of invoking any JMS MessageListener bean directly inside any route.</p>
-
-<p>So for example you can create a MessageListener in JMS like this:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-public class MyListener implements MessageListener {
+</div></div><div class="confluence-information-macro confluence-information-macro-note"><span
class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Notice the <strong>init</strong>
and <strong>destroy</strong> methods on the pooled connection factory. This is
important to ensure the connection pool is properly started and shutdown.</p></div></div><div
class="confluence-information-macro confluence-information-macro-information"><p class="title">Important
information about when using transactions</p><span class="aui-icon aui-icon-small
aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>If
you are using transactions then see more details at <a shape="rect" href="jms.html">JMS</a>.
And remember to set <code>cacheLevelName</code> to <code>CACHE_CONSUMER</code>
if you are not using XA transactions. This can dramatically improve performance.<
 /p></div></div><p>The <code>PooledConnectionFactory</code>
will then create a connection pool with up to 8 connections in use at the same time. Each
connection can be shared by many sessions. There is an option named <code>maximumActive</code>
you can use to configure the maximum number of sessions per connection; the default value
is <code>500</code>. From <strong>ActiveMQ 5.7</strong> onwards the
option has been renamed to better reflect its purpose, being named as <code>maximumActiveSessionPerConnection</code>.
Notice the <code>concurrentConsumers</code> is set to a higher value than <code>maxConnections</code>
is. This is okay, as each consumer is using a session, and as a session can share the same
connection, we are in the safe. In this example we can have 8 * 500 = 4000 active sessions
at the same time.</p><h3 id="BookInOnePage-InvokingMessageListenerPOJOsinaCamelroute">Invoking
MessageListener POJOs in a Camel route</h3><p>The ActiveMQ component also provides
a helper <a sha
 pe="rect" href="type-converter.html">Type Converter</a> from a JMS MessageListener
to a <a shape="rect" href="processor.html">Processor</a>. This means that the
<a shape="rect" href="bean.html">Bean</a> component is capable of invoking any
JMS MessageListener bean directly inside any route.</p><p>So for example you can
create a MessageListener in JMS like this:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public
class MyListener implements MessageListener {
    public void onMessage(Message jmsMessage) {
        // ...
    }
 }
 ]]></script>
-</div></div>
-
-<p>Then use it in your Camel route as follows</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-from(&quot;file://foo/bar&quot;).
+</div></div><p>Then use it in your Camel route as follows</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;file://foo/bar&quot;).
   bean(MyListener.class);
 ]]></script>
-</div></div>
-
-<p>That is, you can reuse any of the Camel <a shape="rect" href="components.html">Components</a>
and easily integrate them into your JMS <code>MessageListener</code> POJO!</p>
-
-<h3 id="BookInOnePage-UsingActiveMQDestinationOptions">Using ActiveMQ Destination Options</h3>
-<p><strong>Available as of ActiveMQ 5.6</strong></p>
-
-<p>You can configure the <a shape="rect" class="external-link" href="http://activemq.apache.org/destination-options.html">Destination
Options</a> in the endpoint uri, using the "destination." prefix. For example to mark
a consumer as exclusive, and set its prefetch size to 50, you can do as follows:</p>
-
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:
Index: 20, Size: 20</span> </div>
-
-
-<h3 id="BookInOnePage-ConsumingAdvisoryMessages">Consuming Advisory Messages</h3>
-
-<p>ActiveMQ can generate <a shape="rect" class="external-link" href="http://activemq.apache.org/advisory-message.html">Advisory
messages </a> which are put in topics that you can consume. Such messages can help you
send alerts in case you detect slow consumers or to build statistics (number of messages/produced
per day, etc.) The following Spring DSL example shows you how to read messages from a topic.</p>
-
-<p>The below route starts by reading the topic <em>ActiveMQ.Advisory.Connection</em>.
To watch another topic, simply change the name according to the name provided in ActiveMQ
Advisory Messages documentation. The parameter mapJmsMessage=false allows for converting the
org.apache.activemq.command.ActiveMqMessage object from the jms queue.  Next, the body received
is converted into a String for the purposes of this example and a carriage return is added.
Finally, the string is added to a file</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-&lt;route&gt;
+</div></div><p>That is, you can reuse any of the Camel <a shape="rect"
href="components.html">Components</a> and easily integrate them into your JMS <code>MessageListener</code>
POJO!</p><h3 id="BookInOnePage-UsingActiveMQDestinationOptions">Using ActiveMQ
Destination Options</h3><p><strong>Available as of ActiveMQ 5.6</strong></p><p>You
can configure the <a shape="rect" class="external-link" href="http://activemq.apache.org/destination-options.html">Destination
Options</a> in the endpoint uri, using the "destination." prefix. For example to mark
a consumer as exclusive, and set its prefetch size to 50, you can do as follows:</p><p>&#160;</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;from
uri=&quot;activemq:foo?destination.consumer.exclusive=true&amp;amp;destination.consumer.prefetchSize=50&quot;/&gt;]]></script>
+</div></div><h3 id="BookInOnePage-ConsumingAdvisoryMessages">Consuming
Advisory Messages</h3><p>ActiveMQ can generate <a shape="rect" class="external-link"
href="http://activemq.apache.org/advisory-message.html">Advisory messages </a> which
are put in topics that you can consume. Such messages can help you send alerts in case you
detect slow consumers or to build statistics (number of messages/produced per day, etc.) The
following Spring DSL example shows you how to read messages from a topic.</p><p>The
below route starts by reading the topic <em>ActiveMQ.Advisory.Connection</em>.
To watch another topic, simply change the name according to the name provided in ActiveMQ
Advisory Messages documentation. The parameter mapJmsMessage=false allows for converting the
org.apache.activemq.command.ActiveMqMessage object from the jms queue. Next, the body received
is converted into a String for the purposes of this example and a carriage return is added.
Finally, the string is added to a file<
 /p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;route&gt;
    &lt;from uri=&quot;activemq:topic:ActiveMQ.Advisory.Connection?mapJmsMessage=false&quot;
/&gt;
    &lt;convertBodyTo type=&quot;java.lang.String&quot;/&gt;
    &lt;transform&gt;
@@ -16512,18 +16416,8 @@ from(&quot;file://foo/bar&quot;).
    &lt;to uri=&quot;file://data/activemq/?fileExist=Append&amp;amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt&quot;
/&gt;
 &lt;/route&gt;
 ]]></script>
-</div></div>
-
-<p>If you consume a message on a queue, you should see the following files under the
data/activemq folder :</p>
-
-<p>advisoryConnection-20100312.txt<br clear="none">
-advisoryProducer-20100312.txt</p>
-
-<p>and containing string:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-ActiveMQMessage {commandId = 0, responseRequired = false, 
+</div></div><p>If you consume a message on a queue, you should see the
following files under the data/activemq folder :</p><p>advisoryConnection-20100312.txt<br
clear="none"> advisoryProducer-20100312.txt</p><p>and containing string:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ActiveMQMessage
{commandId = 0, responseRequired = false, 
 messageId = ID:dell-charles-3258-1268399815140
 -1:0:0:0:221, originalDestination = null, originalTransactionId = null,
 producerId = ID:dell-charles-3258-1268399815140-1:0:0:0, 
@@ -16542,28 +16436,14 @@ clientMaster = true}, redeliveryCounter
 originBrokerURL=vm://master}, readOnlyProperties = true, readOnlyBody = true, 
 droppable = false}
 ]]></script>
-</div></div>
-
-<h3 id="BookInOnePage-GettingComponentJAR">Getting Component JAR</h3>
-
-<p>You will need this dependency</p>
-<ul class="alternate"><li><code>activemq-camel</code></li></ul>
-
-
-<p><a shape="rect" href="activemq.html">ActiveMQ</a> is an extension of
the <a shape="rect" href="jms.html">JMS</a> component released with the <a
shape="rect" class="external-link" href="http://activemq.apache.org">ActiveMQ project</a>.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-&lt;dependency&gt;
+</div></div><h3 id="BookInOnePage-GettingComponentJAR">Getting Component
JAR</h3><p>You will need this dependency</p><ul class="alternate"><li><code>activemq-camel</code></li></ul><p><a
shape="rect" href="activemq.html">ActiveMQ</a> is an extension of the <a shape="rect"
href="jms.html">JMS</a> component released with the <a shape="rect" class="external-link"
href="http://activemq.apache.org">ActiveMQ project</a>.</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
   &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
   &lt;artifactId&gt;activemq-camel&lt;/artifactId&gt;
   &lt;version&gt;5.6.0&lt;/version&gt;
 &lt;/dependency&gt;
 ]]></script>
-</div></div>
-
-
-<h3 id="BookInOnePage-SeeAlso.20">See Also</h3>
+</div></div><p></p><h3 id="BookInOnePage-SeeAlso.20">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a
shape="rect" href="component.html">Component</a></li><li><a shape="rect"
href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting
Started</a></li></ul> <div class="error"><span class="error">Unable
to render {include}</span> The included page could not be found.</div> <h2
id="BookInOnePage-AMQP">AMQP</h2><p><strong>Available as of Camel X.X</strong></p><p>The
<strong>amqp:</strong> component supports the <a shape="rect" class="external-link"
href="http://www.amqp.org/" rel="nofollow">AMQP protocol</a> using the JMS Client
API of the <a shape="rect" class="external-link" href="http://qpid.apache.org/">Qpid</a>
project. In case you want to use AMQP with RabbitMQ you might also be interested in the <a
shape="rect" href="rabbitmq.html">Camel RabbitMQ</a> component.</p><p>Maven
users will need to add the following dependency to their <code>pom.xml</code>
for this co
 mponent:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
@@ -17431,11 +17311,11 @@ template.send(&quot;direct:alias-verify&
 ]]></script>
 </div></div><p></p><h3 id="BookInOnePage-SeeAlso.28">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a
shape="rect" href="component.html">Component</a></li><li><a shape="rect"
href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting
Started</a></li></ul><ul><li><a shape="rect" href="crypto.html">Crypto</a>
Crypto is also available as a <a shape="rect" href="data-format.html">Data Format</a></li></ul>
<h2 id="BookInOnePage-CXFComponent">CXF Component</h2><div class="confluence-information-macro
confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning
confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When
using CXF as a consumer, the <a shape="rect" href="cxf-bean-component.html">CXF Bean
Component</a> allows you to factor out how message payloads are received from their
processing as a RESTful or SOAP web service. This has the potential of using a multitude of
transports to consume web 
 services. The bean component's configuration is also simpler and provides the fastest method
to implement web services using Camel and CXF.</p></div></div><div class="confluence-information-macro
confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve
confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When
using CXF in streaming modes (see DataFormat option), then also read about <a shape="rect"
href="stream-caching.html">Stream caching</a>.</p></div></div><p>The
<strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache
CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1445768308967 {padding: 0px;}
-div.rbtoc1445768308967 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1445768308967 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1445959200379 {padding: 0px;}
+div.rbtoc1445959200379 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1445959200379 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1445768308967">
+/*]]>*/</style></p><div class="toc-macro rbtoc1445959200379">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-CXFComponent">CXF
Component</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-URIformat">URI
format</a></li><li><a shape="rect" href="#BookInOnePage-Options">Options</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Thedescriptionsofthedataformats">The
descriptions of the dataformats</a>

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.



Mime
View raw message