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 2017/12/20 09:20:14 UTC
[camel] branch camel-2.20.x updated: Polish docs and show that
camel-cdi is deprecated in OSGi
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-2.20.x by this push:
new 764b34a Polish docs and show that camel-cdi is deprecated in OSGi
764b34a is described below
commit 764b34af2b7590ad14fd763b84256b26856f1e40
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Dec 20 10:02:34 2017 +0100
Polish docs and show that camel-cdi is deprecated in OSGi
---
components/camel-cdi/src/main/docs/cdi.adoc | 72 +++++++++++++++--------------
1 file changed, 37 insertions(+), 35 deletions(-)
diff --git a/components/camel-cdi/src/main/docs/cdi.adoc b/components/camel-cdi/src/main/docs/cdi.adoc
index 30c7512..23d8e7f 100644
--- a/components/camel-cdi/src/main/docs/cdi.adoc
+++ b/components/camel-cdi/src/main/docs/cdi.adoc
@@ -1,4 +1,4 @@
-## Camel CDI
+== Camel CDI
The Camel CDI component provides auto-configuration for Apache Camel
using CDI as dependency injection framework based
@@ -13,15 +13,20 @@ bridges Camel events (e.g. `RouteAddedEvent`,
and provides a CDI events endpoint that can be used to consume / produce
CDI events from / to Camel routes.
-NOTE: While the Camel CDI component is available as of **Camel 2.10**, it's
+While the Camel CDI component is available as of **Camel 2.10**, it's
been rewritten in *Camel 2.17* to better fit into the CDI programming
model. Hence some of the features like the Camel events to CDI events
bridge and the CDI events endpoint only apply starting Camel 2.17.
-NOTE: More details on how to test Camel CDI applications are available in
+More details on how to test Camel CDI applications are available in
link:cdi-testing.html[Camel CDI testing].
-### Auto-configured Camel context
+[CAUTION]
+====
+camel-cdi is deprecated in OSGi and not supported. Use OSGi Blueprint if using Camel with OSGi.
+====
+
+=== Auto-configured Camel context
Camel CDI automatically deploys and configures a `CamelContext` bean.
That `CamelContext` bean is automatically instantiated, configured and
@@ -41,7 +46,7 @@ type `DefaultCamelContext`.
Note that this bean can be customized programmatically and other Camel
context beans can be deployed in the application as well.
-### Auto-detecting Camel routes
+=== Auto-detecting Camel routes
Camel CDI automatically collects all the `RoutesBuilder` beans in the
application, instantiates and add them to the `CamelContext` bean
@@ -84,7 +89,7 @@ static void configuration(@Observes CdiCamelConfiguration configuration) {
}
----
-### Auto-configured Camel primitives
+=== Auto-configured Camel primitives
Camel CDI provides beans for common Camel primitives that can be
injected in any CDI beans, e.g.:
@@ -110,7 +115,7 @@ Endpoint endpoint;
TypeConverter converter;
----
-### Camel context configuration
+=== Camel context configuration
If you just want to change the name of the default `CamelContext` bean,
you can used the `@ContextName` qualifier provided by Camel CDI, e.g.:
@@ -207,7 +212,7 @@ class ManualStartupCamelContext extends DefaultCamelContext {
}
----
-### Multiple Camel contexts
+=== Multiple Camel contexts
Any number of `CamelContext` beans can actually be declared in the
application as documented above. In that case, the CDI qualifiers
@@ -304,7 +309,7 @@ MockEndpoint outbound; // URI defaults to the member name, i.e. mock:outbound
Endpoint endpoint;
----
-### Configuration properties
+=== Configuration properties
To configure the sourcing of the configuration properties used by Camel
to resolve properties placeholders, you can declare
@@ -355,7 +360,7 @@ You can see the `camel-example-cdi-properties` example for a working
example of a Camel CDI application using DeltaSpike configuration
mechanism.
-### Auto-configured type converters
+=== Auto-configured type converters
CDI beans annotated with the `@Converter` annotation are automatically
registered into the deployed Camel contexts, e.g.:
@@ -374,9 +379,9 @@ public class MyTypeConverter {
Note that CDI injection is supported within the type converters.
-### Camel bean integration
+=== Camel bean integration
-#### Camel annotations
+==== Camel annotations
As part of the Camel link:http://camel.apache.org/bean-integration.html[bean
integration], Camel comes with a set
@@ -385,7 +390,7 @@ are seamlessly supported by Camel CDI. So you can use any of these
annotations in your CDI beans, e.g.:
[width="100%",cols="1,2a,2a",options="header",]
-|=======================================================================
+|===
| |Camel annotation |CDI equivalent
|Configuration property a|
[source,java]
@@ -502,9 +507,9 @@ void consume(@Body String body) {
----
|
-|=======================================================================
+|===
-#### Bean component
+==== Bean component
You can refer to CDI beans, either by type or name, From the Camel DSL,
e.g. with the Java Camel DSL:
@@ -530,7 +535,7 @@ class MyNamedBean {
from("direct:inbound").bean("foo");
----
-#### Referring beans from Endpoint URIs
+==== Referring beans from Endpoint URIs
When configuring endpoints using the URI syntax you can refer to beans
in the link:registry.html[Registry] using the `#` notation. If the URI
@@ -558,7 +563,7 @@ PlatformTransactionManager createTransactionManager(TransactionManager transacti
}
----
-### Camel events to CDI events
+=== Camel events to CDI events
*Available as of Camel 2.17*
@@ -625,7 +630,7 @@ Note that the support for Camel events translation into CDI events is
only activated if observer methods listening for Camel events are
detected in the deployment, and that per Camel context.
-### CDI events endpoint
+=== CDI events endpoint
*Available as of Camel 2.17*
@@ -771,7 +776,7 @@ endpoint instances and the observer methods as the CDI container doesn't
have any ways of discovering the Camel context model during the
deployment phase.
-### Camel XML configuration import
+=== Camel XML configuration import
*Available as of Camel 2.18*
@@ -856,7 +861,7 @@ configuration, e.g.:
----
-### Transaction support
+=== Transaction support
*Available as of Camel 2.19*
@@ -882,7 +887,7 @@ Note that, for the time being, the transaction manager is looked up as JNDI reso
More flexible strategies will be added in the future to support a wider range of deployment scenarios.
====
-#### Transaction policies
+==== Transaction policies
Camel CDI provides implementation for the typically supported Camel `TransactedPolicy` as CDI beans. It is possible to have these policies looked up by name using the transacted EIP, e.g.:
@@ -932,7 +937,7 @@ The list of supported transaction policy names is:
- `PROPAGATION_NESTED`,
- `PROPAGATION_MANDATORY`.
-#### Transactional error handler
+==== Transactional error handler
Camel CDI provides a transactional error handler that extends the redelivery error handler, forces a rollback whenever an exception occurs and creates a new transaction for each redelivery.
@@ -955,7 +960,7 @@ class MyRouteBean extends CdiRouteBuilder {
----
-### Auto-configured OSGi integration
+=== Auto-configured OSGi integration
*Available as of Camel 2.17*
@@ -966,7 +971,7 @@ OSGi registry. That means that the link:karaf.html[Karaf Camel commands]
can be used to operate the Camel contexts auto-configured by Camel CDI,
e.g.:
-[source,brush:,text;,gutter:,false;,theme:,Default]
+[source,text]
----
karaf@root()> camel:context-list
Context Status Total # Failed # Inflight # Uptime
@@ -978,7 +983,7 @@ See the `camel-example-cdi-osgi` example for a working example of the
Camel CDI OSGi integration.
-### Lazy Injection / Programmatic Lookup
+=== Lazy Injection / Programmatic Lookup
While the CDI programmatic model favors a http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#typesafe_resolution[typesafe resolution]
mechanism that occurs at application initialization time, it is possible to perform
@@ -1062,18 +1067,18 @@ for (CamelContext context : contexts)
----
-### Maven Archetype
+=== Maven Archetype
Among the available link:camel-maven-archetypes.html[Camel Maven
archetypes], you can use the provided `camel-archetype-cdi` to generate
a Camel CDI Maven project, e.g.:
-[source,bash]
+[source,text]
----
mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-cdi
----
-### Supported containers
+=== Supported containers
The Camel CDI component is compatible with any CDI 1.0, CDI 1.1 and CDI
1.2 compliant runtime. It's been successfully tested against the
@@ -1089,19 +1094,16 @@ following runtimes:
|WildFly |8.2.1.Final |CDI 1.2 / Java EE 7
|WildFly |9.0.1.Final |CDI 1.2 / Java EE 7
|WildFly |10.1.0.Final |CDI 1.2 / Java EE 7
-|Karaf |2.4.4 |CDI 1.2 / OSGi 4 / PAX CDI
-|Karaf |3.0.5 |CDI 1.2 / OSGi 5 / PAX CDI
-|Karaf |4.0.4 |CDI 1.2 / OSGi 6 / PAX CDI
|============================================
-### Examples
+=== Examples
The following examples are available in the `examples` directory of the
Camel project:
[width="100%",cols="1m,3",options="header",]
-|============================================
+|===
|Example |Description
|camel-example-cdi
@@ -1141,9 +1143,9 @@ files into a Camel CDI application
|The Widget and Gadget use-case from the EIP book implemented
in Java with CDI dependency Injection
-|============================================
+|===
-### See Also
+=== See Also
* link:cdi-testing.html[Camel CDI testing]
* http://www.cdi-spec.org[CDI specification Web site]
--
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].