Skip to content

Commit

Permalink
Revisit the documentation #2136 #2470 #2374
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Apr 14, 2021
1 parent 03ec238 commit bb64853
Show file tree
Hide file tree
Showing 14 changed files with 458 additions and 187 deletions.
5 changes: 4 additions & 1 deletion docs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ To setup the environment you need to execute the following command once (and eve

[code,shell]
----
yarn install
yarn install --immutable
----

`--immutable` makes the install command respect the content of `yarn.lock` file.
You may want to omit it if you want upgrade the versions in `yarn.lock` file.

== Build the Documentation Website

To generate the documentation website, execute:
Expand Down
5 changes: 4 additions & 1 deletion docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
* xref:user-guide/index.adoc[User guide]
** xref:user-guide/first-steps.adoc[First steps]
** xref:user-guide/bootstrap.adoc[Bootstrap]
** xref:user-guide/dependency-management.adoc[Dependency management]
** xref:user-guide/defining-camel-routes.adoc[Defining routes]
** xref:user-guide/configuration.adoc[Configuration]
** xref:user-guide/cdi.adoc[CDI]
** xref:user-guide/observability.adoc[Observability]
** xref:user-guide/native-mode.adoc[Native mode]
** xref:user-guide/command-mode.adoc[Command mode]
** xref:user-guide/testing.adoc[Testing]
** xref:user-guide/examples.adoc[Examples]
* xref:contributor-guide/index.adoc[Contributor guide]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Check the xref:contributor-guide/extension-metadata.adoc[Extension metadata] pag
[TIP]
====
If your test application is going to be configured via `camel.component.*` properties, you need to add the
`camel-quarkus-main` dependency to the test project. See the xref:user-guide/bootstrap.adoc[Bootstrap] section of
`camel-quarkus-main` dependency to the test project. See the xref:user-guide/configuration.adoc[Bootstrap] section of
the User guide for more details.
====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ mvn clean verify -Pnative
[TIP]
====
If your test application is going to be configured via `camel.component.*` properties, you need to add the
`camel-quarkus-main` dependency to the test project. See the xref:user-guide/bootstrap.adoc[Bootstrap] section of
`camel-quarkus-main` dependency to the test project. See the xref:user-guide/configuration.adoc[Bootstrap] section of
the User guide for more details.
====
+
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Camel Quarkus provides xref:reference/index.adoc[Quarkus extensions] for many of

Camel Quarkus also takes advantage of the many performance improvements made in Camel 3, which results in a lower memory footprint, less reliance on reflection (which is good for native application support) and faster startup times.

You can define Camel routes using the Java DSL, XML & Kotlin (see the xref:user-guide/examples.adoc[examples]).
You can xref:user-guide/defining-camel-routes.adoc[define Camel routes] using the Java DSL, XML, Kotlin, Groovy, YAML or JavaScript.

=== Where to go next?

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/reference/extensions/core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ What to do if it is not possible to extract CSimple expressions from a route def

|icon:lock[title=Fixed at build time] [[quarkus.camel.main.enabled]]`link:#quarkus.camel.main.enabled[quarkus.camel.main.enabled]`

If `true` all `camel-main` features are enabled; otherwise no `camel-main` features are enabled. See described the xref:user-guide/bootstrap.adoc#_camel_main[Bootstrap] section of Camel Quarkus documentation for more details.
If `true` all `camel-main` features are enabled; otherwise no `camel-main` features are enabled. See described the xref:user-guide/configuration.adoc#_camel_main[Bootstrap] section of Camel Quarkus documentation for more details.
| `boolean`
| `true`

Expand Down
176 changes: 0 additions & 176 deletions docs/modules/ROOT/pages/user-guide/bootstrap.adoc

This file was deleted.

23 changes: 23 additions & 0 deletions docs/modules/ROOT/pages/user-guide/cdi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ you really need it.

TIP: Please refer to the https://quarkus.io/blog/quarkus-dependency-injection[Quarkus Dependency Injection guide] for more details.

=== Accessing `CamelContext`

To access `CamelContext` just inject it into your bean:

[source,java]
----
import javax.inject.Inject;
import javax.enterprise.context.ApplicationScoped;
import java.util.stream.Collectors;
import java.util.List;
import org.apache.camel.CamelContext;
@ApplicationScoped
public static class MyBean {
@Inject
CamelContext context;
public List<String> listRouteIds() {
return context.getRoutes().stream().map(Route::getId).sorted().collect(Collectors.toList());
}
}
----

== CDI and the Camel Bean component

Expand Down
30 changes: 30 additions & 0 deletions docs/modules/ROOT/pages/user-guide/command-mode.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
= Command Mode Applications

`camel-quarkus-core` brings the option to write https://quarkus.io/guides/command-mode-reference[Quarkus Command Mode Applications] with control about when the Camel runtime should start:

[source,java]
----
import io.quarkus.runtime.Quarkus;
import io.quarkus.runtime.annotations.QuarkusMain;
import org.apache.camel.quarkus.main.CamelMainApplication;
@QuarkusMain
public class Main {
public static void main(String... args) {
//
// your logic here
//
Quarkus.run(CamelMainApplication.class, args); // <1>
}
}
----
<1> Start Quarkus and the Camel Quarkus runtime

[NOTE]
====
It is recommended to perform very little logic in the Java Main.
====

Find more details about Camel Quarkus command line applications in this link:/blog/2020/07/command-line-utility-with-camel-quarkus/[blog post].

0 comments on commit bb64853

Please sign in to comment.