Create a new extension
-
You should know how to build.
-
Go through the Quarkus extension author’s guide to get an idea of what is expected from you.
-
Make sure that nobody else works on the same extension already by searching through the GitHub issues.
-
Let others know that you work on the given extension by either creating a new issue or asking to assign an existing one to you.
-
Scaffold the necessary Maven modules using
quarkus-maven-plugin. As an example let’s add a new extension for supporting an imaginary Camel componentfoo-abc:$ cd camel-quarkus $ mvn cq:create -N -Dcq.artifactIdBase=foo-abcwhere:
-
foo-abcis the unique part of the new extension’sartifactIdwithout thecamel-quarkus-prefixThe above sequence of commands does the following:
-
It creates three new Maven modules under the
extensionsdirectory:camel-quarkus-foo-abc-parent,camel-quarkus-foo-abc(a.k.a. the runtime module) andcamel-quarkus-foo-abc-deployment. -
These three modules are linked where necessary:
-
camel-quarkus-foo-abc-parentis added to the<modules>ofcamel-quarkus-extensions -
camel-quarkus-foo-abcis added to the<dependencyManagement>of the runtime BOM (Bill of Materials)poms/bom/pom.xml -
camel-quarkus-foo-abc-deploymentis added to the<dependencyManagement>of the deployment BOM (Bill of Materials)poms/bom-deployment/pom.xml
-
-
It creates a basic
FooAbcProcessorclass in the deployment module. -
It also creates a stub of an integration test module under
integration-tests/foo-abc.Compilation performed immediately after generating the modules should pass flawlessly but running the tests will fail because the test project needs to get finished. You need to build
poms/bomandpoms/bom-deploymentone time first.
-
-
Review the generated
extensions/foo-abc/runtime/src/main/resources/META-INF/quarkus-extension.yamlfile. If you see an improper description or keyword, file a new Camel issue and ask to fix the metadata for the given Camel component. -
Review the dependencies in the generated runtime and deployment modules. In case the given library is supported by Quarkus, you may want to add a dependency on the corresponding Quarkus extension.
-
Complete the integration test module under
integration-tests/foo-abc. Make sure you test both the consumer and the producer of the component (if the component supports both). Make sure the tests are passing both in the JVM mode (mvn test) and in the native mode (mvn verify -Pnative). -
In case of problems, consult the Quarkus extension author’s guide, ask for help in the given GitHub issue or via Camel Quarkus chat.
-
If the usage of your new extension differs from the usage of the given Camel component, please add an AsciiDoc page under
docs/modules/ROOT/pages/extensionsand document the differences and Quarkus specific configuration options there. For our imaginary Camel componentfoo-abcthe path of the page would bedocs/modules/ROOT/pages/extensions/foo-abc.adoc. After completing the page, runmvn clean install -DskipTestsfrom the root of the source tree to add your extension to the autogenerated list of extensions. -
Before sending a pull request, please make sure you have run the following Maven command from the project root folder:
$ mvn process-resources -PformatThe above command will perform the following tasks:
-
Add license headers to the new files
-
Re-generate the list of extensions and the Camel Quarkus Catalog
-
Sort elements in various POM files properly
Review the result visually.
-
-
Please squash your commits before sending a pull request.
Good luck!