Skip to content

Commit

Permalink
Add Camel AS2 Modules as Quarkus Extension apache#1471
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek committed Jul 20, 2020
1 parent 8c76e23 commit 0c43a19
Show file tree
Hide file tree
Showing 29 changed files with 1,507 additions and 79 deletions.
34 changes: 34 additions & 0 deletions docs/modules/ROOT/pages/extensions/as2.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page

[[as2]]
= AS2

[.badges]
[.badge-key]##Since Camel Quarkus##[.badge-version]##1.0.0-CR4## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-supported]##supported##

Transfer data securely and reliably using the AS2 protocol (RFC4130).

== What's inside

* https://camel.apache.org/components/latest/as2-component.html[AS2 component], URI syntax: `as2:apiName/methodName`

Please refer to the above link for usage and configuration details.

== Maven coordinates

[source,xml]
----
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-as2</artifactId>
</dependency>
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add
`quarkus.ssl.native=true` to your `application.properties` yourself. See also
https://quarkus.io/guides/native-and-ssl[Quarkus SSL guide].
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In case you are missing some Camel feature in the list:
== Camel Components

// components: START
Number of Camel components: 155 in 120 JAR artifacts (0 deprecated)
Number of Camel components: 156 in 121 JAR artifacts (0 deprecated)

[width="100%",cols="4,1,1,1,5",options="header"]
|===
Expand All @@ -28,6 +28,8 @@ Number of Camel components: 155 in 120 JAR artifacts (0 deprecated)

| xref:extensions/amqp.adoc[AMQP] | camel-quarkus-amqp | Native + Stable | 1.0.0-M6 | Messaging with AMQP protocol using Apache QPid Client.

| xref:extensions/as2.adoc[AS2] | camel-quarkus-as2 | Native + Stable | 1.0.0-CR4 | Transfer data securely and reliably using the AS2 protocol (RFC4130).

| xref:extensions/ahc.adoc[Async HTTP Client (AHC)] | camel-quarkus-ahc | Native + Stable | 1.0.0-M3 | Call external HTTP services using Async Http Client.

| xref:extensions/ahc-ws.adoc[Async HTTP Client (AHC) Websocket] | camel-quarkus-ahc-ws | Native + Stable | 1.0.0-M3 | Exchange data with external Websocket servers using Async Http Client.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.support.bouncycastle.deployment;

public class BouncycastleSupportProcessor {
static final String FEATURE = "camel-support-bouncycastle";
//
// @BuildStep
// FeatureBuildItem feature() {
// return new FeatureBuildItem(FEATURE);
// }
//
// @BuildStep
// ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
// IndexView index = combinedIndex.getIndex();
//
// String[] dtos = index.getKnownClasses().stream().map(ci -> ci.name().toString())
// .filter(n -> n.startsWith("org.apache.kafka.connect.json")
// || n.startsWith("io.debezium.embedded.spi"))
// .sorted()
// .toArray(String[]::new);
//
// return new ReflectiveClassBuildItem(false, true, dtos);
// }
//
// @BuildStep
// ReflectiveClassBuildItem reflectiveClasses() {
// return new ReflectiveClassBuildItem(false, false,
// new String[] { "org.apache.kafka.connect.storage.FileOffsetBackingStore",
// "org.apache.kafka.connect.storage.MemoryOffsetBackingStore",
// "io.debezium.relational.history.FileDatabaseHistory" });
// }
//
// @BuildStep
// void addDependencies(BuildProducer<IndexDependencyBuildItem> indexDependency) {
// indexDependency.produce(new IndexDependencyBuildItem("org.apache.kafka", "connect-json"));
// indexDependency.produce(new IndexDependencyBuildItem("io.debezium", "debezium-embedded"));
// }
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#

---
name: "Camel Quarkus Support Debezium"
description: "Camel Quarkus Support Debezium"
name: "Camel Quarkus Support Bouncycastle"
description: "Camel Quarkus Support Bouncycastle"
metadata:
unlisted: true
keywords:
Expand Down
1 change: 1 addition & 0 deletions extensions-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<module>ahc</module>
<module>aws</module>
<module>aws2</module>
<module>bouncycastle</module>
<module>common</module>
<module>commons-logging</module>
<module>consul-client</module>
Expand Down
67 changes: 67 additions & 0 deletions extensions/as2/deployment/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-as2-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-as2-deployment</artifactId>
<name>Camel Quarkus :: AS2 :: Deployment</name>

<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-as2</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-support-bouncycastle-deployment</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-processor</artifactId>
<version>${quarkus.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.component.as2.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import org.apache.camel.component.as2.AS2ClientManagerEndpointConfiguration;
import org.apache.camel.component.as2.AS2ServerManagerEndpointConfiguration;
import org.apache.camel.quarkus.core.deployment.spi.UnbannedReflectiveBuildItem;
import org.jboss.jandex.IndexView;

class As2Processor {

private static final String FEATURE = "camel-as2";

@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
RuntimeInitializedClassBuildItem runtimeInitializedClasses() {
return new RuntimeInitializedClassBuildItem("org.apache.camel.component.as2.api.util.AS2Utils");
}

@BuildStep
UnbannedReflectiveBuildItem whitelistConfigurationClasses() {
return new UnbannedReflectiveBuildItem(
AS2ServerManagerEndpointConfiguration.class.getCanonicalName(),
AS2ClientManagerEndpointConfiguration.class.getCanonicalName());
}

@BuildStep
ReflectiveClassBuildItem registerAs2ConfigurationForReflection() {
return new ReflectiveClassBuildItem(true, false,
AS2ServerManagerEndpointConfiguration.class.getCanonicalName(),
AS2ClientManagerEndpointConfiguration.class.getCanonicalName());
}

@BuildStep
ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
IndexView index = combinedIndex.getIndex();

String[] dtos = index.getKnownClasses().stream()
.map(ci -> ci.name().toString())
.filter(n -> n.startsWith("org.apache.velocity.runtime") || n.startsWith("org.apache.velocity.util"))
.sorted()
.peek(System.out::println)
.toArray(String[]::new);

return new ReflectiveClassBuildItem(false, false, dtos);
}

@BuildStep
IndexDependencyBuildItem registerDependencyForIndex() {
return new IndexDependencyBuildItem("org.apache.velocity", "velocity-engine-core");
}

@BuildStep
NativeImageResourceBuildItem initResources() {
return new NativeImageResourceBuildItem("org/apache/velocity/runtime/defaults/velocity.properties",
"org/apache/velocity/runtime/defaults/directive.properties");
}
}
39 changes: 39 additions & 0 deletions extensions/as2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-build-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../../poms/build-parent/pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-as2-parent</artifactId>
<name>Camel Quarkus :: AS2</name>
<packaging>pom</packaging>

<modules>
<module>deployment</module>
<module>runtime</module>
</modules>
</project>

0 comments on commit 0c43a19

Please sign in to comment.