forked from apache/camel-quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document cq:create -Dcq.nativeSupported=false for creating JVM-only e…
…xtensions apache#1662
- Loading branch information
Showing
3 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
docs/modules/ROOT/pages/contributor-guide/create-jvm-only-extension.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[[create-jvm-only-extension]] | ||
= Create a JVM-only extension | ||
|
||
== Why JVM-only extensions | ||
|
||
Quarkus applications can be built and run in two modes: JVM and native. While native mode is clearly superior when it | ||
comes to application start time, memory consumption and size on disk, the JVM mode may still be a valid option. Here is | ||
why: | ||
|
||
First, Quarkus works really well on stock JVMs, such as OpenJDK. While the memory consumption and start times are not | ||
as good as in native mode, they are still very good when | ||
https://quarkus.io/blog/runtime-performance/#application-start-time[compared] to traditional JVM stacks. | ||
|
||
Second, JVM mode beats native mode in https://quarkus.io/blog/runtime-performance/#throughput-reqsec[peak throughput] | ||
and https://quarkus.io/blog/runtime-performance/#response-times-ms[response latency]. You should prefer JVM mode if | ||
these metrics matter to you. | ||
|
||
And third, creating a Quarkus extension that works well both in JVM and native mode requires some time and | ||
xref:contributor-guide/create-new-extension.adoc[expertise]. In case some extension is needed quickly and the native | ||
support is dispensable, relying on JVM-only extensions may make a lot of sense. | ||
|
||
== How to create a JVM-only extension | ||
|
||
The steps are the same as when xref:contributor-guide/create-new-extension.adoc[creating a native extension], except | ||
for the following: | ||
|
||
* Add `-Dcq.nativeSupported=false` to `cq:create` mojo invocation: | ||
+ | ||
[source,shell] | ||
---- | ||
$ cd camel-quarkus | ||
$ mvn cq:create -N -Dcq.artifactIdBase=foo-abc | ||
---- | ||
+ | ||
* A basic integration test is generated for you. It just checks that the newly added Camel component can be loaded. | ||
Adding some meaningful assertions to the generated test is highly welcome though. | ||
* You do not need to add the test to `tooling/scripts/test-categories.yaml` because it is necessary only for | ||
native tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters