You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/08/09 11:50:21 UTC
[camel] 02/05: Polish and cleanup documentation
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 680f5713a68d37371536ed1489863eb3ed535926
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Aug 9 13:18:26 2021 +0200
Polish and cleanup documentation
---
docs/user-manual/modules/ROOT/nav.adoc | 1 -
.../modules/ROOT/pages/bean-injection.adoc | 12 ++-
.../modules/ROOT/pages/bean-integration.adoc | 30 ++------
docs/user-manual/modules/ROOT/pages/binding.adoc | 90 ----------------------
.../modules/ROOT/pages/browsable-endpoint.adoc | 8 +-
docs/user-manual/modules/ROOT/pages/index.adoc | 1 -
6 files changed, 19 insertions(+), 123 deletions(-)
diff --git a/docs/user-manual/modules/ROOT/nav.adoc b/docs/user-manual/modules/ROOT/nav.adoc
index f17ffa2..299674c 100644
--- a/docs/user-manual/modules/ROOT/nav.adoc
+++ b/docs/user-manual/modules/ROOT/nav.adoc
@@ -40,7 +40,6 @@
** xref:batch-consumer.adoc[Batch Consumer]
** xref:bean-binding.adoc[Bean Binding]
** xref:bean-integration.adoc[Bean Integration]
-** xref:binding.adoc[Binding]
** xref:browsable-endpoint.adoc[BrowsableEndpoint]
** xref:camel-core.adoc[Core]
** xref:camelcontext.adoc[Context]
diff --git a/docs/user-manual/modules/ROOT/pages/bean-injection.adoc b/docs/user-manual/modules/ROOT/pages/bean-injection.adoc
index 4ae2c9d..4f6e678 100644
--- a/docs/user-manual/modules/ROOT/pages/bean-injection.adoc
+++ b/docs/user-manual/modules/ROOT/pages/bean-injection.adoc
@@ -9,7 +9,7 @@ when used with xref:components::mock-component.adoc[Mock] endpoints; see the
xref:spring-testing.adoc[Spring Testing] for an example.
* xref:producertemplate.adoc[ProducerTemplate] instances for
xref:pojo-producing.adoc[POJO Producing]
-* client side proxies for xref:pojo-producing.adoc[POJO Producing]
+* client side proxies for xref:pojo-producing.adoc[POJO Producing]
[[BeanInjection-Using-BeanInject]]
== Using @BeanInject
@@ -51,3 +51,13 @@ xref:registry.adoc[Registry].
@BeanInject
MyFooBean foo;
----
+
+== Bean Injection with Quarkus or CDI
+
+When using Camel with CDI, Spring Boot, or Quarkus, then the `@Inject`, or `@Named` annotations can
+be used to inject Camel resources as well.
+
+== Bean Injection with Spring Boot
+
+Camel has first class support for Spring Boot, and you can use the Spring annotations
+such as `@Autowired` to also inject Camel resources.
\ No newline at end of file
diff --git a/docs/user-manual/modules/ROOT/pages/bean-integration.adoc b/docs/user-manual/modules/ROOT/pages/bean-integration.adoc
index 1b04820..e9dda9f 100644
--- a/docs/user-manual/modules/ROOT/pages/bean-integration.adoc
+++ b/docs/user-manual/modules/ROOT/pages/bean-integration.adoc
@@ -1,7 +1,7 @@
[[BeanIntegration-BeanIntegration]]
= Bean Integration
-Camel supports the integration of beans and POJOs in a number of ways
+Camel supports the integration of beans and POJOs in a number of ways.
[[BeanIntegration-Annotations]]
== Annotations
@@ -20,12 +20,15 @@ The following annotations is supported and inject by Camel's
|Annotation |Description
|`@EndpointInject` |To inject an endpoint, see more details at xref:pojo-producing.adoc[POJO Producing].
|`@BeanInject` |To inject a bean obtained from the Registry. See xref:bean-injection.adoc[Bean Injection].
+|`@BeanConfigInject` |To inject a configuration bean obtained from the Registry. The bean is a POJO that represents
+a set of configuration options, which is automatic configured with values loaded via Camel xref:latest@manual::using-propertyplaceholder.adoc[Property Placeholders].
|`@PropertyInject` |To inject a value using property placeholder.
|`@Produce` |To inject a producer to send message to an endpoint. See xref:pojo-producing.adoc[POJO Producing].
|`@Consume` |To inject a consumer on a method. See xref:pojo-consuming.adoc[POJO Consuming].
|`@BindToRegistry` |Used for binding a bean to the registry.
If no name is specified then the bean will have its name auto computed based on the class name,
field name, or method name where the annotation is configured.
+|`@DeferredContextBinding` | Used to indicate that if the target type is `CamelContextAware` then the `CamelContext` is deferred and injected later; after the bootstrap of Camel so the `CamelContext` is ready for use.
|=======================================================================
See more details at:
@@ -50,29 +53,6 @@ for how to use the annotations for routing and messaging.
The xref:components::bean-component.adoc[Bean] component allows one to invoke a particular
method. Alternately the xref:components::bean-component.adoc[Bean] component supports the
-creation of a proxy via `ProxyHelper` to a Java interface; which allows to hide sending data
+creation of a proxy via `ProxyHelper` to a Java interface; which allows hiding sending data
to the endpoint via an interface. See more at xref:hiding-middleware.adoc[Hiding Middleware].
-[[BeanIntegration-SpringRemoting]]
-== Spring Remoting
-
-We support a Spring Remoting provider which
-uses Camel as the underlying transport mechanism. The nice thing about
-this approach is we can use any of the Camel transport
-Components to communicate between beans. It also
-means we can use Content Based Router
-and the other xref:{eip-vc}:eips:enterprise-integration-patterns.adoc[Enterprise
-Integration Patterns] in between the beans; in particular we can use
-Message Translator to be able to convert
-what the on-the-wire messages look like in addition to adding various
-headers and so forth.
-
-*Bean binding*
-
-Whenever Camel invokes a bean method via one of the above methods
-(xref:components::bean-component.adoc[Bean] component, or POJO Consuming) then the
-*Bean Binding* mechanism is used to figure out
-what method to use (if it is not explicit) and how to bind the
-Message to the parameters possibly using the
-Parameter Binding Annotations
-or using a method name option.
diff --git a/docs/user-manual/modules/ROOT/pages/binding.adoc b/docs/user-manual/modules/ROOT/pages/binding.adoc
deleted file mode 100644
index 8d618f2..0000000
--- a/docs/user-manual/modules/ROOT/pages/binding.adoc
+++ /dev/null
@@ -1,90 +0,0 @@
-[[Binding-Binding]]
-= Binding
-
-In Camel terms a _binding_ is a way of wrapping an
-xref:endpoint.adoc[Endpoint] in a contract; such as a
-xref:data-format.adoc[Data Format], a xref:{eip-vc}:eips:content-enricher.adoc[Content
-Enricher] or validation step. Bindings are completely optional and you
-can choose to use them on any xref:components::index.adoc[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-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 xref:data-format.adoc[Data Format] to marshal and unmarshal
-messages.
-
-[[Binding-UsingaBindingComponent]]
-== Using a BindingComponent
-
-There is a xref:component.adoc[Component] called BindingComponent which
-can be configured in your xref:registry.adoc[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")
-------------------------------------------------
-
-This would use the queues "foo.myQueue" and "foo.anotherQueue" and would
-use the given Jackson xref:data-format.adoc[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.
diff --git a/docs/user-manual/modules/ROOT/pages/browsable-endpoint.adoc b/docs/user-manual/modules/ROOT/pages/browsable-endpoint.adoc
index 3d8adf4..573aba5 100644
--- a/docs/user-manual/modules/ROOT/pages/browsable-endpoint.adoc
+++ b/docs/user-manual/modules/ROOT/pages/browsable-endpoint.adoc
@@ -1,15 +1,13 @@
[[BrowsableEndpoint-BrowsableEndpoint]]
= BrowsableEndpoint
-https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/spi/BrowsableEndpoint.html[BrowsableEndpoint]
-is an extension interface an Endpoint may implement
+The `BrowseableEndpoint` is an extension interface an `Endpoint` may implement
to support the browsing of the Message exchanges
which are pending or have been sent on it.
-Some example implementations include
+Some example implementations include:
-* xref:components::jms-component.adoc[JMS] for queues only (as of 1.3.0)
-* List
+* xref:components::jms-component.adoc[JMS] for queues only
* xref:components::mock-component.adoc[Mock]
* xref:components::seda-component.adoc[Seda]
* xref:components::vm-component.adoc[VM]
diff --git a/docs/user-manual/modules/ROOT/pages/index.adoc b/docs/user-manual/modules/ROOT/pages/index.adoc
index c6a8332..941d466 100644
--- a/docs/user-manual/modules/ROOT/pages/index.adoc
+++ b/docs/user-manual/modules/ROOT/pages/index.adoc
@@ -79,7 +79,6 @@ camel routes without them knowing
* xref:backlogdebugger.adoc[BacklogDebugger]
* xref:backlog-tracer.adoc[BacklogTracer]
* xref:batch-consumer.adoc[Batch Consumer]
-* xref:binding.adoc[Binding]
* xref:browsable-endpoint.adoc[BrowsableEndpoint]
* xref:camelcontext.adoc[CamelContext]
* xref:camel-core.adoc[Camel Core]