Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/modules/ROOT/examples/components/flink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
cqArtifactId: camel-quarkus-flink
cqArtifactIdBase: flink
cqNativeSupported: false
cqStatus: Preview
cqNativeSupported: true
cqStatus: Stable
cqDeprecated: false
cqJvmSince: 1.1.0
cqNativeSince: n/a
cqNativeSince: 3.29.0
cqCamelPartName: flink
cqCamelPartTitle: Flink
cqCamelPartDescription: Send DataSet jobs to an Apache Flink cluster.
Expand Down
14 changes: 9 additions & 5 deletions docs/modules/ROOT/pages/reference/extensions/flink.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
= Flink
:linkattrs:
:cq-artifact-id: camel-quarkus-flink
:cq-native-supported: false
:cq-status: Preview
:cq-status-deprecation: Preview
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Send DataSet jobs to an Apache Flink cluster.
:cq-deprecated: false
:cq-jvm-since: 1.1.0
:cq-native-since: n/a
:cq-native-since: 3.29.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native##[.badge-unsupported]##unsupported##
[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native since##[.badge-supported]##3.29.0##
endif::[]

Send DataSet jobs to an Apache Flink cluster.
Expand All @@ -29,6 +29,10 @@ Please refer to the above link for usage and configuration details.
[id="extensions-flink-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-flink[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion extensions-jvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<module>ehcache</module>
<module>elasticsearch</module>
<module>fastjson</module>
<module>flink</module>
<module>google-functions</module>
<module>guava-eventbus</module>
<module>huaweicloud-smn</module>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
* 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.flink.deployment;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem;
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.apache.flink.client.deployment.ClusterClientFactory;
import org.apache.flink.client.deployment.executors.LocalExecutorFactory;
import org.jboss.logging.Logger;

@RegisterForReflection(targets = { LocalExecutorFactory.class })
class FlinkProcessor {

private static final Logger LOG = Logger.getLogger(FlinkProcessor.class);
private static final String FEATURE = "camel-flink";
private static final String FLINK_SERVICE_BASE = "META-INF/services/";

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

@BuildStep
void runtimeInitializedClasses(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitializedClass) {
System.out.println("runtimeInitializedClasses - Why not called??");
runtimeInitializedClass.produce(new RuntimeInitializedClassBuildItem("com.esotericsoftware.kryo.util.ObjectMap"));
runtimeInitializedClass.produce(new RuntimeInitializedClassBuildItem("org.apache.flink.util.AbstractID"));
}

@BuildStep
RuntimeInitializedClassBuildItem runtimeInitKryoObjectMap() {
System.out.println("runtimeInitKryoObjectMap - Why not called??");
// This class uses a Random which needs to be initialized at run time
return new RuntimeInitializedClassBuildItem("com.esotericsoftware.kryo.util.ObjectMap");
}

@BuildStep
RuntimeInitializedClassBuildItem runtimeInitFlinkAbstractID() {
System.out.println("runtimeInitFlinkAbstractID - Why not called??");
// This class uses a Random which needs to be initialized at run time
return new RuntimeInitializedClassBuildItem("org.apache.flink.util.AbstractID");
}

@BuildStep
void registerServiceProviders(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<NativeImageResourceBuildItem> nativeImage) {

String[] servicePaths = new String[] {
FLINK_SERVICE_BASE + "org.apache.flink.client.deployment.ClusterClientFactory",
FLINK_SERVICE_BASE + "org.apache.flink.core.execution.PipelineExecutorFactory",
};

for (String path : servicePaths) {
reflectiveClass.produce(ReflectiveClassBuildItem.builder(getServiceClasses(path)).methods().build());
}

nativeImage.produce(new NativeImageResourceBuildItem(servicePaths));
}

private String[] getServiceClasses(String servicePath) {
try (InputStream resource = ClusterClientFactory.class.getClassLoader().getResourceAsStream(servicePath)) {
Properties properties = new Properties();
properties.load(resource);
System.out.println("### service classes found: " + properties.keySet());
return properties.keySet().toArray(new String[] {});
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
}
2 changes: 1 addition & 1 deletion extensions-jvm/flink/pom.xml → extensions/flink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-extensions-jvm</artifactId>
<artifactId>camel-quarkus-extensions</artifactId>
<version>3.29.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

<properties>
<camel.quarkus.jvmSince>1.1.0</camel.quarkus.jvmSince>
<camel.quarkus.nativeSince>3.29.0</camel.quarkus.nativeSince>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# seems to have no effect
quarkus.native.auto-service-loader-registration=true
1 change: 1 addition & 0 deletions extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<module>file-cluster-service</module>
<module>file-watch</module>
<module>flatpack</module>
<module>flink</module>
<module>fop</module>
<module>fory</module>
<module>freemarker</module>
Expand Down
1 change: 0 additions & 1 deletion integration-tests-jvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<module>ehcache</module>
<module>elasticsearch</module>
<module>fastjson</module>
<module>flink</module>
<module>google-functions</module>
<module>guava-eventbus</module>
<module>huaweicloud-smn</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,33 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<properties>
<quarkus.native.enabled>true</quarkus.native.enabled>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.flink.it;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
class FlinkIT extends FlinkTest {

}
1 change: 1 addition & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<module>fhir</module>
<module>file</module>
<module>flatpack</module>
<module>flink</module>
<module>fop</module>
<module>fory</module>
<module>freemarker</module>
Expand Down
1 change: 1 addition & 0 deletions tooling/scripts/test-categories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ group-08:
- azure-grouped
- crypto
- crypto-pgp
- flink
- jq
- langchain4j-chat
- master
Expand Down
Loading