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 2019/07/27 08:13:15 UTC

[camel] 05/05: CAMEL-13793: Regen

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0fc150ce7d38fd9ffe4bc901cfd55a6dcdf870c8
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Jul 27 10:12:43 2019 +0200

    CAMEL-13793: Regen
---
 docs/components/modules/ROOT/nav.adoc              |   5 -
 docs/components/modules/ROOT/pages/cdi.adoc        | 214 +--------------------
 .../modules/ROOT/pages/paho-component.adoc         |   1 +
 .../test/spring/CamelSpringRunnerPlainTest.java    |  30 +--
 4 files changed, 10 insertions(+), 240 deletions(-)

diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index 30a74bd..091c5b2 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -83,7 +83,6 @@
 * xref:cxf-component.adoc[CXF Component]
 * xref:cxfrs-component.adoc[CXF-RS Component]
 * xref:dataformat-component.adoc[Data Format Component]
-* xref:dataformat-component.adoc[Data Format Component]
 * xref:dataset-component.adoc[Dataset Component]
 * xref:dataset-test-component.adoc[DataSet Test Component]
 * xref:digitalocean-component.adoc[DigitalOcean Component]
@@ -275,7 +274,6 @@
 * xref:protobuf-dataformat.adoc[Protobuf DataFormat]
 * xref:pubnub-component.adoc[PubNub Component]
 * xref:pulsar-component.adoc[Apache Pulsar Component]
-* xref:pulsar-component.adoc[Apache Pulsar Component]
 * xref:quartz2-component.adoc[Quartz2 Component]
 * xref:quickfix-component.adoc[QuickFix Component]
 * xref:rabbitmq-component.adoc[RabbitMQ Component]
@@ -286,8 +284,6 @@
 * xref:rest-swagger-component.adoc[REST Swagger Component]
 * xref:rest-api-component.adoc[REST API Component]
 * xref:rest-component.adoc[REST Component]
-* xref:rest-api-component.adoc[REST API Component]
-* xref:rest-component.adoc[REST Component]
 * xref:restlet-component.adoc[Restlet Component]
 * xref:ribbon.adoc[Ribbon Component]
 * xref:rss-component.adoc[RSS Component]
@@ -301,7 +297,6 @@
 * xref:scheduler-component.adoc[Scheduler Component]
 * xref:schematron-component.adoc[Schematron Component]
 * xref:seda-component.adoc[SEDA Component]
-* xref:seda-component.adoc[SEDA Component]
 * xref:service-component.adoc[Service Component]
 * xref:servicenow-component.adoc[ServiceNow Component]
 * xref:servlet-component.adoc[Servlet Component]
diff --git a/docs/components/modules/ROOT/pages/cdi.adoc b/docs/components/modules/ROOT/pages/cdi.adoc
index fecba27..05cf6548 100644
--- a/docs/components/modules/ROOT/pages/cdi.adoc
+++ b/docs/components/modules/ROOT/pages/cdi.adoc
@@ -14,11 +14,6 @@ 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.
 
-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.
-
 More details on how to test Camel CDI applications are available in
 Camel CDI testing.
 
@@ -58,7 +53,7 @@ route is as simple as declaring a class, e.g.:
 [source,java]
 ----
 class MyRouteBean extends RouteBuilder {
- 
+
     @Override
     public void configure() {
         from("jms:invoices").to("file:/invoices");
@@ -71,8 +66,6 @@ Besides, `RouteContainer` beans are also automatically collected,
 instantiated and added to the `CamelContext` bean instance managed by
 Camel CDI when the container initializes.
 
-*Available as of Camel 2.19*
-
 In some situations, it may be necessary to disable the auto-configuration of the `RouteBuilder` and `RouteContainer` beans. That can be achieved by observing for the `CdiCamelConfiguration` event, e.g.:
 
 [source,java]
@@ -126,7 +119,7 @@ you can used the `@ContextName` qualifier provided by Camel CDI, e.g.:
 ----
 @ContextName("camel-context")
 class MyRouteBean extends RouteBuilder {
- 
+
     @Override
     public void configure() {
         from("jms:invoices").to("file:/invoices");
@@ -214,100 +207,6 @@ class ManualStartupCamelContext extends DefaultCamelContext {
 }
 ----
 
-=== Multiple Camel contexts
-
-Any number of `CamelContext` beans can actually be declared in the
-application as documented above. In that case, the CDI qualifiers
-declared on these `CamelContext` beans are used to bind the Camel routes
-and other Camel primitives to the corresponding Camel contexts. From
-example, if the following beans get declared:
-
-[source,java]
-----
-@ApplicationScoped
-@ContextName("foo")
-class FooCamelContext extends DefaultCamelContext {
-}
-
-@ApplicationScoped
-@BarContextQualifier
-class BarCamelContext extends DefaultCamelContext {
-}
- 
-@ContextName("foo")
-class RouteAddedToFooCamelContext extends RouteBuilder {
-
-    @Override
-    public void configure() {
-        // ...
-    }
-}
- 
-@BarContextQualifier
-class RouteAddedToBarCamelContext extends RouteBuilder {
-
-    @Override
-    public void configure() {
-        // ...
-    }
-}
- 
-@ContextName("baz")
-class RouteAddedToBazCamelContext extends RouteBuilder {
-
-    @Override
-    public void configure() {
-        // ...
-    }
-}
- 
-@MyOtherQualifier
-class RouteNotAddedToAnyCamelContext extends RouteBuilder {
-
-    @Override
-    public void configure() {
-        // ...
-    }
-}
-----
-
-The `RoutesBuilder` beans qualified with `@ContextName` are
-automatically added to the corresponding `CamelContext` beans by Camel
-CDI. If no such `CamelContext` bean exists, it gets automatically
-created, as for the `RouteAddedToBazCamelContext` bean. Note this only
-happens for the `@ContextName` qualifier provided by Camel CDI. Hence
-the `RouteNotAddedToAnyCamelContext` bean qualified with the
-user-defined `@MyOtherQualifier` qualifier does not get added to any
-Camel contexts. That may be useful, for example, for Camel routes that
-may be required to be added later during the application execution.
-
-Camel CDI is capable of managing any kind of `CamelContext` beans (e.g. `DefaultCamelContext`).
-
-The CDI qualifiers declared on the `CamelContext` beans are also used to
-bind the corresponding Camel primitives, e.g.:
-
-[source,java]
-----
-@Inject
-@ContextName("foo")
-@Uri("direct:inbound")
-ProducerTemplate producerTemplate;
-
-@Inject
-@ContextName("foo")
-@Uri("direct:inbound")
-FluentProducerTemplate fluentProducerTemplate;
-
-@Inject
-@BarContextQualifier
-MockEndpoint outbound; // URI defaults to the member name, i.e. mock:outbound
-
-@Inject
-@ContextName("baz")
-@Uri("direct:inbound")
-Endpoint endpoint;
-----
-
 === Configuration properties
 
 To configure the sourcing of the configuration properties used by Camel
@@ -450,16 +349,6 @@ Endpoint endpoint;
 Endpoint endpoint;
 ----
 
-|Endpoint injection (Camel context by name) a|
-[source,java]
-----
-@EndpointInject(value = "direct:inbound",
-                context = "foo")
-Endpoint contextEndpoint;
-----
-
- a|
-[source,java]
 ----
 @Inject
 @ContextName("foo")
@@ -564,8 +453,6 @@ PlatformTransactionManager createTransactionManager(TransactionManager transacti
 
 === Camel events to CDI events
 
-*Available as of Camel 2.17*
-
 Camel provides a set
 of http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/event/package-summary.html[management
 events] that can be subscribed to for listening to Camel context,
@@ -581,7 +468,7 @@ void onContextStarting(@Observes CamelContextStartingEvent event) {
 }
 ----
 
-As of Camel 2.18, it is possible to observe events for a particular route (`RouteAddedEvent`,
+It is possible to observe events for a particular route (`RouteAddedEvent`,
 `RouteStartedEvent`, `RouteStoppedEvent` and `RouteRemovedEvent`) should it have
 an explicit defined, e.g.:
 
@@ -631,8 +518,6 @@ detected in the deployment, and that per Camel context.
 
 === CDI events endpoint
 
-*Available as of Camel 2.17*
-
 The CDI event endpoint bridges
 the http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#events[CDI
 events] with the Camel routes so that CDI events can be seamlessly
@@ -777,8 +662,6 @@ deployment phase.
 
 === Camel XML configuration import
 
-*Available as of Camel 2.18*
-
 While CDI favors a typesafe dependency injection mechanism, it may be
 useful to reuse existing Camel XML configuration files into a Camel CDI
 application. In other use cases, it might be handy to rely on the Camel
@@ -862,8 +745,6 @@ configuration, e.g.:
 
 === Transaction support
 
-*Available as of Camel 2.19*
-
 Camel CDI provides support for Camel transactional client using JTA.
 
 That support is optional hence you need to have JTA in your application classpath, e.g., by explicitly add JTA as a dependency when using Maven:
@@ -959,29 +840,6 @@ class MyRouteBean extends CdiRouteBuilder {
 ----
 
 
-=== Auto-configured OSGi integration
-
-*Available as of Camel 2.17*
-
-The Camel context beans are automatically adapted by Camel CDI so that
-they are registered as OSGi services and the various resolvers
-(like `ComponentResolver` and `DataFormatResolver`) integrate with the
-OSGi registry. That means that the Karaf Camel commands
-can be used to operate the Camel contexts auto-configured by Camel CDI,
-e.g.:
-
-[source,text]
-----
-karaf@root()> camel:context-list
- Context        Status              Total #       Failed #     Inflight #   Uptime
- -------        ------              -------       --------     ----------   ------
- camel-cdi      Started                   1              0              0   1 minute
-----
-
-See the `camel-example-cdi-osgi` example for a working example of the
-Camel CDI OSGi integration.
-
-
 === 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]
@@ -1077,72 +935,6 @@ a Camel CDI Maven project, e.g.:
 mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-cdi
 ----
 
-=== 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
-following runtimes:
-
-[width="100%",cols="2,1m,2",options="header",]
-|============================================
-|Container |Version |Runtime
-|Weld SE |1.1.28.Final |CDI 1.0 / Java SE 7
-|OpenWebBeans |1.2.7 |CDI 1.0 / Java SE 7
-|Weld SE |2.4.2.Final |CDI 1.2 / Java SE 7
-|OpenWebBeans |1.7.2 |CDI 1.2 / Java SE 7
-|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
-|============================================
-
-
-=== 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
-|Illustrates how to work with Camel using CDI to configure components,
-endpoints and beans
-
-|camel-example-cdi-kubernetes
-|Illustrates the integration between Camel, CDI and Kubernetes
-
-|camel-example-cdi-metrics
-|Illustrates the integration between Camel, Dropwizard Metrics and CDI
-
-|camel-example-cdi-properties
-|Illustrates the integration between Camel, DeltaSpike and CDI for
-configuration properties
-
-|camel-example-cdi-osgi
-|A CDI application using the SJMS component that can be executed
-inside an OSGi container using PAX CDI
-
-|camel-example-cdi-rest-servlet
-|Illustrates the Camel REST DSL being used in a Web application that
-uses CDI as dependency injection framework
-
-|camel-example-cdi-test
-|Demonstrates the testing features that are provided as part of
-the integration between Camel and CDI
-
-|camel-example-cdi-xml
-|Illustrates the use of Camel XML configuration
-files into a Camel CDI application
-
-|camel-example-swagger-cdi
-|An example using REST DSL and Swagger Java with CDI
-
-|camel-example-widget-gadget-cdi
-|The Widget and Gadget use-case from the EIP book implemented
-in Java with CDI dependency Injection
-
-|===
 
 === See Also
 
diff --git a/docs/components/modules/ROOT/pages/paho-component.adoc b/docs/components/modules/ROOT/pages/paho-component.adoc
index 08bb67a..546fea0 100644
--- a/docs/components/modules/ROOT/pages/paho-component.adoc
+++ b/docs/components/modules/ROOT/pages/paho-component.adoc
@@ -154,6 +154,7 @@ The following headers are recognized by the Paho component:
 |Header |Java constant |Endpoint type |Value type |Description
 
 |CamelMqttTopic |PahoConstants.MQTT_TOPIC |Consumer |String |The name of the topic
+|CamelMqttQoS |PahoConstants.MQTT_QOS |Consumer |Integer |QualityOfService of the incoming message
 |CamelPahoOverrideTopic |PahoConstants.CAMEL_PAHO_OVERRIDE_TOPIC |Producer |String |Name of topic to override and send to instead of topic specified on endpoint
 |===
 
diff --git a/docs/user-manual/modules/ROOT/examples/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerPlainTest.java b/docs/user-manual/modules/ROOT/examples/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerPlainTest.java
index 64c829b..d21008d 100644
--- a/docs/user-manual/modules/ROOT/examples/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerPlainTest.java
+++ b/docs/user-manual/modules/ROOT/examples/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerPlainTest.java
@@ -39,8 +39,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-// START SNIPPET: e1
-// tag::example[]
 @RunWith(CamelSpringRunner.class)
 // must tell Spring to bootstrap with Camel
 @BootstrapWith(CamelTestContextBootstrapper.class)
@@ -54,38 +52,25 @@ public class CamelSpringRunnerPlainTest {
     @Autowired
     protected CamelContext camelContext;
     
-    @Autowired
-    protected CamelContext camelContext2;
-    
-    @EndpointInject(value = "mock:a", context = "camelContext")
+    @EndpointInject(value = "mock:a")
     protected MockEndpoint mockA;
     
-    @EndpointInject(value = "mock:b", context = "camelContext")
+    @EndpointInject(value = "mock:b")
     protected MockEndpoint mockB;
     
-    @EndpointInject(value = "mock:c", context = "camelContext2")
-    protected MockEndpoint mockC;
-    
-    @Produce(value = "direct:start", context = "camelContext")
+    @Produce(value = "direct:start")
     protected ProducerTemplate start;
     
-    @Produce(value = "direct:start2", context = "camelContext2")
-    protected ProducerTemplate start2;
-    
     @Test
     public void testPositive() throws Exception {
         assertEquals(ServiceStatus.Started, camelContext.getStatus());
-        assertEquals(ServiceStatus.Started, camelContext2.getStatus());
-        
+
         mockA.expectedBodiesReceived("David");
         mockB.expectedBodiesReceived("Hello David");
-        mockC.expectedBodiesReceived("David");
-        
+
         start.sendBody("David");
-        start2.sendBody("David");
-        
+
         MockEndpoint.assertIsSatisfied(camelContext);
-        MockEndpoint.assertIsSatisfied(camelContext2);
     }
     
     @Test
@@ -115,7 +100,6 @@ public class CamelSpringRunnerPlainTest {
     @Test
     public void testProvidesBreakpoint() {
         assertNull(camelContext.getDebugger());
-        assertNull(camelContext2.getDebugger());
     }
 
     @Test
@@ -124,5 +108,3 @@ public class CamelSpringRunnerPlainTest {
     }
 
 }
-// end::example[]
-// END SNIPPET: e1