Repository: camel Updated Branches: refs/heads/master d8e7da226 -> 3a9292317
CAMEL-11786: Migrate docs to more correct ascii doc format Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3a929231 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3a929231 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3a929231 Branch: refs/heads/master Commit: 3a9292317633dc7e3a8964a665cd6c258d2db1c7 Parents: d8e7da2 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Sep 20 14:06:41 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Sep 20 14:13:17 2017 +0200 ---------------------------------------------------------------------- .../src/main/docs/eips/pipes-and-filters.adoc | 71 ++++++++++---------- .../main/docs/eips/point-to-point-channel.adoc | 30 +++------ .../docs/eips/publish-subscribe-channel.adoc | 47 +++++-------- 3 files changed, 61 insertions(+), 87 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/3a929231/camel-core/src/main/docs/eips/pipes-and-filters.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/eips/pipes-and-filters.adoc b/camel-core/src/main/docs/eips/pipes-and-filters.adoc index 3a820a6..5c86150 100644 --- a/camel-core/src/main/docs/eips/pipes-and-filters.adoc +++ b/camel-core/src/main/docs/eips/pipes-and-filters.adoc @@ -1,6 +1,5 @@ [[PipesandFilters-PipesandFilters]] -Pipes and Filters -^^^^^^^^^^^^^^^^^ +== Pipes and Filters Camel supports the http://www.enterpriseintegrationpatterns.com/PipesAndFilters.html[Pipes @@ -13,9 +12,8 @@ With Camel you can split your processing across multiple independent link:endpoint.html[Endpoint] instances which can then be chained together. -[[PipesandFilters-UsingRoutingLogic]] -Using Routing Logic -+++++++++++++++++++ +[[PipesandFilters-Samples]] +=== Samples You can create pipelines of logic using multiple link:endpoint.html[Endpoint] or link:message-translator.html[Message @@ -26,10 +24,30 @@ multiple outputs in Camel. The opposite to pipeline is multicast; which fires the same message into each of its outputs. (See the example below). -In Spring XML you can use the <pipeline/> element +In Java you do: +[source,java] +---- +from("activemq:SomeQueue") + .pipeline() + .bean("foo") + .bean("bar") + .to("acitvemq:OutputQueueu"); +---- + +The pipeline is the default mode, which can be omitted, and therefore you almost often write as: [source,java] ------------------------------------- +---- +from("activemq:SomeQueue") + .bean("foo") + .bean("bar") + .to("acitvemq:OutputQueueu"); +---- + +In XML you can use the `<pipeline>` element + +[source,xml] +---- <route> <from uri="activemq:SomeQueue"/> <pipeline> @@ -38,27 +56,26 @@ In Spring XML you can use the <pipeline/> element <to uri="activemq:OutputQueue"/> </pipeline> </route> ------------------------------------- +---- -In the above the pipeline element is actually unnecessary, you could use -this... +In the above the pipeline element is actually unnecessary, you could use this: -[source,java] ----------------------------------- +[source,xml] +---- <route> <from uri="activemq:SomeQueue"/> <bean ref="foo"/> <bean ref="bar"/> <to uri="activemq:OutputQueue"/> </route> ----------------------------------- +---- -Its just a bit more explicit. However if you wish to use <multicast/> to +Its just a bit more explicit. However if you wish to use `<multicast/>` to avoid a pipeline - to send the same message into multiple pipelines - -then the <pipeline/> element comes into its own. +then the `<pipeline>` element comes into its own. -[source,java] --------------------------------------- +[source,xml] +---- <route> <from uri="activemq:SomeQueue"/> <multicast> @@ -73,21 +90,5 @@ then the <pipeline/> element comes into its own. </pipeline> </multicast> </route> --------------------------------------- - -In the above example we are routing from a single -link:endpoint.html[Endpoint] to a list of different endpoints specified -using link:uris.html[URIs]. If you find the above a bit confusing, try -reading about the link:architecture.html[Architecture] or try the -link:examples.html[Examples] - -[[PipesandFilters-UsingThisPattern]] -Using This Pattern -++++++++++++++++++ - -If you would like to use this EIP Pattern then please read the -link:getting-started.html[Getting Started], you may also find the -link:architecture.html[Architecture] useful particularly the description -of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could -try out some of the link:examples.html[Examples] first before trying -this pattern out. +---- + http://git-wip-us.apache.org/repos/asf/camel/blob/3a929231/camel-core/src/main/docs/eips/point-to-point-channel.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/eips/point-to-point-channel.adoc b/camel-core/src/main/docs/eips/point-to-point-channel.adoc index ca8ff56..db3f61b 100644 --- a/camel-core/src/main/docs/eips/point-to-point-channel.adoc +++ b/camel-core/src/main/docs/eips/point-to-point-channel.adoc @@ -1,6 +1,5 @@ [[PointtoPointChannel-PointtoPointChannel]] -Point to Point Channel -^^^^^^^^^^^^^^^^^^^^^^ +== Point to Point Channel Camel supports the http://www.enterpriseintegrationpatterns.com/PointToPointChannel.html[Point @@ -20,33 +19,22 @@ image:http://www.enterpriseintegrationpatterns.com/img/PointToPointSolution.gif[ The following example demonstrates point to point messaging using the link:jms.html[JMS] component -*Using the link:fluent-builders.html[Fluent Builders]* +[[PointtoPointChannel-Samples]] +=== Samples [source,java] -------------------------- +---- from("direct:start") .to("jms:queue:foo"); -------------------------- +---- - - -**Using the link:spring-xml-extensions.html[Spring XML Extensions]** +And in XML: [source,xml] ------------------------------- +---- <route> <from uri="direct:start"/> <to uri="jms:queue:foo"/> </route> ------------------------------- - -[[PointtoPointChannel-UsingThisPattern]] -Using This Pattern -++++++++++++++++++ - -If you would like to use this EIP Pattern then please read the -link:getting-started.html[Getting Started], you may also find the -link:architecture.html[Architecture] useful particularly the description -of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could -try out some of the link:examples.html[Examples] first before trying -this pattern out. +---- + http://git-wip-us.apache.org/repos/asf/camel/blob/3a929231/camel-core/src/main/docs/eips/publish-subscribe-channel.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/eips/publish-subscribe-channel.adoc b/camel-core/src/main/docs/eips/publish-subscribe-channel.adoc index 5665251..1ce16e6 100644 --- a/camel-core/src/main/docs/eips/publish-subscribe-channel.adoc +++ b/camel-core/src/main/docs/eips/publish-subscribe-channel.adoc @@ -1,6 +1,5 @@ [[PublishSubscribeChannel-PublishSubscribeChannel]] -Publish Subscribe Channel -^^^^^^^^^^^^^^^^^^^^^^^^^ +== Publish Subscribe Channel Camel supports the http://www.enterpriseintegrationpatterns.com/PublishSubscribeChannel.html[Publish @@ -18,34 +17,31 @@ allowing multiple consumers. image:http://www.enterpriseintegrationpatterns.com/img/PublishSubscribeSolution.gif[image] -[[PublishSubscribeChannel-UsingRoutingLogic]] -Using Routing Logic -+++++++++++++++++++ +[[PublishSubscribeChannel-Samples]] +=== Samples Another option is to explicitly list the publish-subscribe relationship in your routing logic; this keeps the producer and consumer decoupled but lets you control the fine grained routing configuration using the link:dsl.html[DSL] or link:xml-configuration.html[Xml Configuration]. -*Using the link:fluent-builders.html[Fluent Builders]* +In Java code: [source,java] ---------------------------------------------------- -RouteBuilder builder = new RouteBuilder() { - public void configure() { - errorHandler(deadLetterChannel("mock:error")); - - from("direct:a") - .multicast().to("direct:b", "direct:c", "direct:d"); - } -}; ---------------------------------------------------- +---- +from("direct:a") + .multicast() + .to("direct:b") + .to("direct:c") + .to("direct:d") + .end() // end multicast +---- -*Using the link:spring-xml-extensions.html[Spring XML Extensions]* +And in XML: [source,xml] ---------------------------------------------------- -<camelContext errorHandlerRef="errorHandler" xmlns="http://camel.apache.org/schema/spring"> +---- +<camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="direct:a"/> <multicast> @@ -55,15 +51,4 @@ RouteBuilder builder = new RouteBuilder() { </multicast> </route> </camelContext> ---------------------------------------------------- - -[[PublishSubscribeChannel-UsingThisPattern]] -Using This Pattern -++++++++++++++++++ - -If you would like to use this EIP Pattern then please read the -link:getting-started.html[Getting Started], you may also find the -link:architecture.html[Architecture] useful particularly the description -of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could -try out some of the link:examples.html[Examples] first before trying -this pattern out. +----