use of io.strimzi.api.kafka.model.connect.build.JarArtifactBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaConnectTemplates method kafkaConnectWithFilePlugin.
/**
* Method for creating the KafkaConnect builder with File plugin - using the KafkaConnect build feature.
* @param name Name for the KafkaConnect resource
* @param namespaceName namespace, where the KafkaConnect resource will be deployed
* @param clusterName name of the Kafka cluster
* @param replicas number of KafkaConnect replicas
* @return KafkaConnect builder with File plugin
*/
public static KafkaConnectBuilder kafkaConnectWithFilePlugin(String name, String namespaceName, String clusterName, int replicas) {
final Plugin fileSinkPlugin = new PluginBuilder().withName("file-plugin").withArtifacts(new JarArtifactBuilder().withUrl(Environment.ST_FILE_PLUGIN_URL).build()).build();
final String imageName = Environment.getImageOutputRegistry() + "/" + namespaceName + "/connect-" + hashStub(String.valueOf(new Random().nextInt(Integer.MAX_VALUE))) + ":latest";
return kafkaConnect(name, namespaceName, clusterName, replicas).editOrNewSpec().editOrNewBuild().withPlugins(fileSinkPlugin).withNewDockerOutput().withImage(imageName).endDockerOutput().endBuild().endSpec();
}
Aggregations