Skip to content

Commit

Permalink
Add stream extension
Browse files Browse the repository at this point in the history
fixes #680
  • Loading branch information
jamesnetherton committed Feb 6, 2020
1 parent ea2b52c commit 8eb4f5d
Show file tree
Hide file tree
Showing 17 changed files with 549 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ jobs:
-pl :camel-quarkus-integration-test-infinispan \
-pl :camel-quarkus-integration-test-mail \
-pl :camel-quarkus-integration-test-pdf \
-pl :camel-quarkus-integration-test-stream \
-pl :camel-quarkus-integration-test-tarfile \
-pl :camel-quarkus-integration-test-validator \
-pl :camel-quarkus-integration-test-zipfile
Expand Down
31 changes: 31 additions & 0 deletions docs/modules/ROOT/pages/extensions/stream.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[[stream]]
= Stream Extension

*Since Camel Quarkus 1.0.0-M4*

The Stream component provides access to the `System.in`, `System.out` and `System.err` streams as well as allowing streaming of files.

Maven users will need to add the following dependency to their `pom.xml` for this extension.

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

== Usage

Please refer to the https://camel.apache.org/components/latest/stream-component.html[Stream] component page.


== Configuration

* Check the xref:native-mode.adoc#charsets[Character encodings section] of the Native mode guide if you want to use
non-default encodings for the stream endpoint `encoding` URI parameter.

[NOTE]
====
The `fileWatcher` feature of the stream consumer requires GraalVM >= 19.3.0, due to a https://github.com/oracle/graal/issues/1253[bug].
====
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: 61 in 52 JAR artifacts (0 deprecated)
Number of Camel components: 62 in 53 JAR artifacts (0 deprecated)

[width="100%",cols="4,1,5",options="header"]
|===
Expand Down Expand Up @@ -186,6 +186,9 @@ Number of Camel components: 61 in 52 JAR artifacts (0 deprecated)
| xref:extensions/sql.adoc[SQL Stored Procedure] (camel-quarkus-sql) +
`sql-stored:template` | 1.0.0-M2 | The sql component allows you to work with databases using JDBC Stored Procedure queries.

| xref:extensions/stream.adoc[Stream] (camel-quarkus-stream) +
`stream:kind` | 1.2.0 | The stream: component provides access to the system-in, system-out and system-err streams as well as allowing streaming of file.

| link:https://camel.apache.org/components/latest/timer-component.html[Timer] (camel-quarkus-timer) +
`timer:timerName` | 0.2.0 | The timer component is used for generating message exchanges when a timer fires.

Expand Down
1 change: 1 addition & 0 deletions extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<module>slack</module>
<module>snakeyaml</module>
<module>sql</module>
<module>stream</module>
<module>tagsoup</module>
<module>tarfile</module>
<module>timer</module>
Expand Down
5 changes: 4 additions & 1 deletion extensions/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Apache Camel Quarkus supports the following Camel artifacts as Quarkus Extension
== Camel Components

// components: START
Number of Camel components: 61 in 52 JAR artifacts (0 deprecated)
Number of Camel components: 62 in 53 JAR artifacts (0 deprecated)

[width="100%",cols="4,1,5",options="header"]
|===
Expand Down Expand Up @@ -173,6 +173,9 @@ Number of Camel components: 61 in 52 JAR artifacts (0 deprecated)
| xref:extensions/sql.adoc[SQL Stored Procedure] (camel-quarkus-sql) +
`sql-stored:template` | 1.0.0-M2 | The sql component allows you to work with databases using JDBC Stored Procedure queries.

| xref:extensions/stream.adoc[Stream] (camel-quarkus-stream) +
`stream:kind` | 1.2.0 | The stream: component provides access to the system-in, system-out and system-err streams as well as allowing streaming of file.

| link:https://camel.apache.org/components/latest/timer-component.html[Timer] (camel-quarkus-timer) +
`timer:timerName` | 0.2.0 | The timer component is used for generating message exchanges when a timer fires.

Expand Down
75 changes: 75 additions & 0 deletions extensions/stream/deployment/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?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-stream-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-stream-deployment</artifactId>
<name>Camel Quarkus :: Stream :: Deployment</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<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-stream</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,31 @@
/*
* 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.stream.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;

class StreamProcessor {

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

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

}
39 changes: 39 additions & 0 deletions extensions/stream/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-stream-parent</artifactId>
<name>Camel Quarkus :: Stream</name>
<packaging>pom</packaging>

<modules>
<module>deployment</module>
<module>runtime</module>
</modules>
</project>
82 changes: 82 additions & 0 deletions extensions/stream/runtime/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?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-stream-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-stream</artifactId>
<name>Camel Quarkus :: Stream :: Runtime</name>

<properties>
<firstVersion>1.2.0</firstVersion>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-stream</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-maven-plugin</artifactId>
</plugin>
<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,27 @@
#
# 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.
#

---
name: "Camel Quarkus Stream"
description: "Camel Quarkus Stream Support"
metadata:
keywords:
- "camel"
- "stream"
guide: "https://quarkus.io/guides/camel"
categories:
- "integration"
1 change: 1 addition & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
<module>slack</module>
<module>snakeyaml</module>
<module>sql</module>
<module>stream</module>
<module>tagsoup</module>
<module>tarfile</module>
<module>twitter</module>
Expand Down

0 comments on commit 8eb4f5d

Please sign in to comment.