You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/06/09 14:35:50 UTC

[1/3] camel git commit: Added bean docs to Gitbook

Repository: camel
Updated Branches:
  refs/heads/master 7e6ebc3cb -> d4951f441


Added bean docs to Gitbook


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b40a5b87
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b40a5b87
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b40a5b87

Branch: refs/heads/master
Commit: b40a5b87cd8cb5da1ed79e806e6bf499312c2b1d
Parents: 7e6ebc3
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jun 9 16:29:10 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jun 9 16:29:10 2016 +0200

----------------------------------------------------------------------
 camel-core/src/main/docs/bean.adoc | 160 ++++++++++++++++++++++++++++++++
 docs/user-manual/en/SUMMARY.md     |   1 +
 2 files changed, 161 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b40a5b87/camel-core/src/main/docs/bean.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/bean.adoc b/camel-core/src/main/docs/bean.adoc
new file mode 100644
index 0000000..fc8d348
--- /dev/null
+++ b/camel-core/src/main/docs/bean.adoc
@@ -0,0 +1,160 @@
+[[Bean-BeanComponent]]
+Bean Component
+~~~~~~~~~~~~~~
+
+The *bean:* component binds beans to Camel message exchanges.
+
+[[Bean-URIformat]]
+URI format
+^^^^^^^^^^
+
+[source,java]
+---------------------
+bean:beanID[?options]
+---------------------
+
+Where *beanID* can be any string which is used to look up the bean in
+the link:registry.html[Registry]
+
+[[Bean-Options]]
+Options
+^^^^^^^
+
+
+// component options: START
+The Bean component has no options.
+// component options: END
+
+
+
+// endpoint options: START
+The Bean component supports 7 endpoint options which are listed below:
+
+{% raw %}
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| beanName | producer |  | String | *Required* Sets the name of the bean to invoke
+| method | producer |  | String | Sets the name of the method to invoke on the bean
+| cache | advanced | false | boolean | If enabled Camel will cache the result of the first Registry look-up. Cache can be enabled if the bean in the Registry is defined as a singleton scope.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange.
+| multiParameterArray | advanced | false | boolean | How to treat the parameters which are passed from the message body; if it is true the message body should be an array of parameters. Note: This option is used internally by Camel and is not intended for end users to use.
+| parameters | advanced |  | Map | Used for configuring additional properties on the bean
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+|=======================================================================
+{% endraw %}
+// endpoint options: END
+
+
+You can append query options to the URI in the following format,
+`?option=value&option=value&...`
+
+[[Bean-Using]]
+Using
+^^^^^
+
+The object instance that is used to consume messages must be explicitly
+registered with the link:registry.html[Registry]. For example, if you
+are using Spring you must define the bean in the Spring configuration,
+`spring.xml`; or if you don't use Spring, by registering the bean in
+JNDI.
+
+Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:
+Index: 20, Size: 20
+
+Once an endpoint has been registered, you can build Camel routes that
+use it to process exchanges.
+
+A *bean:* endpoint cannot be defined as the input to the route; i.e. you
+cannot consume from it, you can only route from some inbound message
+link:endpoint.html[Endpoint] to the bean endpoint as output. So consider
+using a *direct:* or *queue:* endpoint as the input.
+
+You can use the `createProxy()` methods on
+http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/bean/ProxyHelper.html[ProxyHelper]
+to create a proxy that will generate BeanExchanges and send them to any
+endpoint:
+
+And the same route using Spring DSL:
+
+[source,xml]
+----------------------------
+<route>
+   <from uri="direct:hello">
+   <to uri="bean:bye"/>
+</route>
+----------------------------
+
+[[Bean-Beanasendpoint]]
+Bean as endpoint
+^^^^^^^^^^^^^^^^
+
+Camel also supports invoking link:bean.html[Bean] as an Endpoint. In the
+route below:
+
+What happens is that when the exchange is routed to the `myBean` Camel
+will use the link:bean-binding.html[Bean Binding] to invoke the bean. +
+ The source for the bean is just a plain POJO:
+
+Camel will use link:bean-binding.html[Bean Binding] to invoke the
+`sayHello` method, by converting the Exchange's In body to the `String`
+type and storing the output of the method on the Exchange Out body.
+
+[[Bean-JavaDSLbeansyntax]]
+Java DSL bean syntax
+^^^^^^^^^^^^^^^^^^^^
+
+Java DSL comes with syntactic sugar for the link:bean.html[Bean]
+component. Instead of specifying the bean explicitly as the endpoint
+(i.e. `to("bean:beanName")`) you can use the following syntax:
+
+[source,java]
+-------------------------------------------------------
+// Send message to the bean endpoint
+// and invoke method resolved using Bean Binding.
+from("direct:start").beanRef("beanName");
+
+// Send message to the bean endpoint
+// and invoke given method.
+from("direct:start").beanRef("beanName", "methodName");
+-------------------------------------------------------
+
+Instead of passing name of the reference to the bean (so that Camel will
+lookup for it in the registry), you can specify the bean itself:
+
+[source,java]
+---------------------------------------------------------------
+// Send message to the given bean instance.
+from("direct:start").bean(new ExampleBean());
+
+// Explicit selection of bean method to be invoked.
+from("direct:start").bean(new ExampleBean(), "methodName");
+
+// Camel will create the instance of bean and cache it for you.
+from("direct:start").bean(ExampleBean.class);
+---------------------------------------------------------------
+
+[[Bean-BeanBinding]]
+Bean Binding
+^^^^^^^^^^^^
+
+How bean methods to be invoked are chosen (if they are not specified
+explicitly through the *method* parameter) and how parameter values are
+constructed from the link:message.html[Message] are all defined by the
+link:bean-binding.html[Bean Binding] mechanism which is used throughout
+all of the various link:bean-integration.html[Bean Integration]
+mechanisms in Camel.
+
+[[Bean-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+
+* link:class.html[Class] component
+* link:bean-binding.html[Bean Binding]
+* link:bean-integration.html[Bean Integration]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/b40a5b87/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 7e0f244..e4430fc 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -96,6 +96,7 @@
     * [Bam](bam.adoc)
     * [Barcode](barcode-data-format.adoc)
     * [Base64](base64.adoc)
+    * [Bean](bean.adoc)
     * [Beanstalk](beanstalk.adoc)
     * [Bean-validator](bean-validator.adoc)
     * [Bindy](bindy.adoc)


[2/3] camel git commit: Added binding docs to Gitbook

Posted by ac...@apache.org.
Added binding docs to Gitbook


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/053ff759
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/053ff759
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/053ff759

Branch: refs/heads/master
Commit: 053ff759a7d50faebef99244d37bc756d314d7da
Parents: b40a5b8
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jun 9 16:32:31 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jun 9 16:32:31 2016 +0200

----------------------------------------------------------------------
 camel-core/src/main/docs/binding.adoc | 124 +++++++++++++++++++++++++++++
 docs/user-manual/en/SUMMARY.md        |   1 +
 2 files changed, 125 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/053ff759/camel-core/src/main/docs/binding.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/binding.adoc b/camel-core/src/main/docs/binding.adoc
new file mode 100644
index 0000000..bb45104
--- /dev/null
+++ b/camel-core/src/main/docs/binding.adoc
@@ -0,0 +1,124 @@
+[[Binding-Binding]]
+Binding
+-------
+
+In Camel terms a _binding_ is a way of wrapping an
+link:endpoint.html[Endpoint] in a contract; such as a
+link:data-format.html[Data Format], a link:content-enricher.html[Content
+Enricher] or validation step. Bindings are completely optional and you
+can choose to use them on any link:components.html[camel endpoint].
+
+Bindings are inspired by the work of
+http://www.jboss.org/switchyard[SwitchYard project] adding service
+contracts to various technologies like Camel and many others. But rather
+than the SwitchYard approach of wrapping Camel in SCA, _Camel Bindings_
+provide a way of wrapping Camel endpoints with contracts inside the
+Camel framework itself; so you can use them easily inside any Camel
+route.
+
+[[Binding-Options]]
+Options
+^^^^^^^
+
+
+// component options: START
+The Binding component has no options.
+// component options: END
+
+
+
+// endpoint options: START
+The Binding component supports 6 endpoint options which are listed below:
+
+{% raw %}
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| bindingName | common |  | String | *Required* Name of the binding to lookup in the Camel registry.
+| delegateUri | common |  | String | *Required* Uri of the delegate endpoint.
+| bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange.
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+|=======================================================================
+{% endraw %}
+// endpoint options: END
+
+
+[[Binding-UsingBindings]]
+Using Bindings
+~~~~~~~~~~~~~~
+
+A Binding is currently a bean which defines the contract (though we'll
+hopefully add bindings to the Camel DSL).
+
+There are a few approaches to defining a bound endpoint (i.e. an
+endpoint bound with a Binding).
+
+[[Binding-UsingthebindingURI]]
+Using the binding URI
+^^^^^^^^^^^^^^^^^^^^^
+
+You can prefix any endpoint URI with *binding:nameOfBinding:* where
+_nameOfBinding_ is the name of the Binding bean in your registry.
+
+[source,java]
+------------------------------------------------------------------------------
+from("binding:jaxb:activemq:myQueue").to("binding:jaxb:activemq:anotherQueue")
+------------------------------------------------------------------------------
+
+Here we are using the "jaxb" binding which may, for example, use the
+JAXB link:data-format.html[Data Format] to marshal and unmarshal
+messages.
+
+[[Binding-UsingaBindingComponent]]
+Using a BindingComponent
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+There is a link:component.html[Component] called BindingComponent which
+can be configured in your link:registry.html[Registry] by dependency
+injection which allows the creation of endpoints which are already bound
+to some binding.
+
+For example if you registered a new component called "jsonmq" in your
+registry using code like this
+
+[source,java]
+-----------------------------------------------------------------------------------------------------
+        JacksonDataFormat format = new JacksonDataFormat(MyBean.class);
+        context.bind("jsonmq", new BindingComponent(new DataFormatBinding(format), "activemq:foo."));
+-----------------------------------------------------------------------------------------------------
+
+Then you could use the endpoint as if it were any other endpoint.
+
+[source,java]
+------------------------------------------------
+from("jsonmq:myQueue").to("jsonmq:anotherQueue")
+------------------------------------------------
+
+which would be using the queueus "foo.myQueue" and "foo.anotherQueue"
+and would use the given Jackson link:data-format.html[Data Format] to
+marshal on and off the queue.
+
+[[Binding-WhentouseBindings]]
+When to use Bindings
+~~~~~~~~~~~~~~~~~~~~
+
+If you only use an endpoint once in a single route; a binding may
+actually be more complex and more work than just using the 'raw'
+endpoint directly and using explicit marshalling and validation in the
+camel route as normal.
+
+However bindings can help when you are composing many routes together;
+or using a single route as a 'template' that is configured input and
+output endpoints; bindings then provide a nice way to wrap up a contract
+and endpoint together.
+
+Another good use case for bindings is when you are using many endpoints
+which use the same binding; rather than always having to mention a
+specific data format or validation rule, you can just use the
+BindingComponent to wrap the endpoints in the binding of your choice.
+
+So bindings are a composition tool really; only use them when they make
+sense - the extra complexity may not be worth it unless you have lots of
+routes or endpoints.

http://git-wip-us.apache.org/repos/asf/camel/blob/053ff759/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index e4430fc..0a842c4 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -99,6 +99,7 @@
     * [Bean](bean.adoc)
     * [Beanstalk](beanstalk.adoc)
     * [Bean-validator](bean-validator.adoc)
+    * [Binding](binding.adoc)
     * [Bindy](bindy.adoc)
     * [Blueprint](blueprint-testing.adoc)
     * [Boon](boon.adoc)


[3/3] camel git commit: Rename cassadraql link

Posted by ac...@apache.org.
Rename cassadraql link


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d4951f44
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d4951f44
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d4951f44

Branch: refs/heads/master
Commit: d4951f441fa7dc9e46ebedec82b76f7100967ca0
Parents: 053ff75
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jun 9 16:34:12 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jun 9 16:34:12 2016 +0200

----------------------------------------------------------------------
 docs/user-manual/en/SUMMARY.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d4951f44/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 0a842c4..f51320b 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -106,7 +106,7 @@
     * [Box](box.adoc)
     * [Braintree](braintree.adoc)
     * [Cache](cache.adoc)
-    * [Cassandraql](cassandra.adoc)
+    * [Cassandraql](cql.adoc)
     * [Castor](castor.adoc)
     * [CDI](cdi.adoc)
     * [Chunk](chunk.adoc)