Skip to content

Commit

Permalink
Splunk-hex native support
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek committed Feb 7, 2024
1 parent 0ee7a8a commit d072b53
Show file tree
Hide file tree
Showing 25 changed files with 420 additions and 123 deletions.
6 changes: 3 additions & 3 deletions docs/modules/ROOT/examples/components/splunk-hec.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-splunk-hec
cqArtifactIdBase: splunk-hec
cqNativeSupported: false
cqStatus: Preview
cqNativeSupported: true
cqStatus: Stable
cqDeprecated: false
cqJvmSince: 1.1.0
cqNativeSince: n/a
cqNativeSince: 3.8.0
cqCamelPartName: splunk-hec
cqCamelPartTitle: Splunk HEC
cqCamelPartDescription: The splunk component allows to publish events in Splunk using the HTTP Event Collector.
Expand Down
21 changes: 16 additions & 5 deletions docs/modules/ROOT/pages/reference/extensions/splunk-hec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
= Splunk HEC
:linkattrs:
:cq-artifact-id: camel-quarkus-splunk-hec
:cq-native-supported: false
:cq-status: Preview
:cq-status-deprecation: Preview
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: The splunk component allows to publish events in Splunk using the HTTP Event Collector.
:cq-deprecated: false
:cq-jvm-since: 1.1.0
:cq-native-since: n/a
:cq-native-since: 3.8.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.8.0##
endif::[]

The splunk component allows to publish events in Splunk using the HTTP Event Collector.
Expand All @@ -29,6 +29,10 @@ Please refer to the above link for usage and configuration details.
[id="extensions-splunk-hec-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-splunk-hec[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 All @@ -39,3 +43,10 @@ Please refer to the above link for usage and configuration details.
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-splunk-hec-ssl-in-native-mode"]
== 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].
1 change: 0 additions & 1 deletion extensions-jvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
<module>schematron</module>
<module>smpp</module>
<module>snmp</module>
<module>splunk-hec</module>
<module>spring-redis</module>
<module>stitch</module>
<module>stomp</module>
Expand Down
1 change: 1 addition & 0 deletions extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
<module>snakeyaml</module>
<module>soap</module>
<module>splunk</module>
<module>splunk-hec</module>
<module>spring-rabbitmq</module>
<module>sql</module>
<module>ssh</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-splunk-hec</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-support-httpclient-deployment</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
package org.apache.camel.quarkus.component.splunk.hec.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild;
import org.apache.camel.quarkus.core.JvmOnlyRecorder;
import org.jboss.logging.Logger;

class SplunkHecProcessor {
Expand All @@ -34,13 +31,8 @@ FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

/**
* Remove this once this extension starts supporting the native mode.
*/
@BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
@Record(value = ExecutionTime.RUNTIME_INIT)
void warnJvmInNative(JvmOnlyRecorder recorder) {
JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
recorder.warnJvmInNative(FEATURE); // warn at runtime
@BuildStep
ExtensionSslNativeSupportBuildItem activateSslNativeSupport() {
return new ExtensionSslNativeSupportBuildItem(FEATURE);
}
}
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.8.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.8.0</camel.quarkus.nativeSince>
</properties>

<dependencies>
Expand All @@ -43,10 +44,15 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-splunk-hec</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-support-httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ name: "Camel Splunk HEC"
description: "The splunk component allows to publish events in Splunk using the HTTP Event Collector"
metadata:
icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg"
unlisted: true
guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/splunk-hec.html"
categories:
- "integration"
- "integration"
status:
- "preview"
- "stable"
1 change: 0 additions & 1 deletion integration-tests-jvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
<module>schematron</module>
<module>smpp</module>
<module>snmp</module>
<module>splunk-hec</module>
<module>spring-redis</module>
<module>stitch</module>
<module>stomp</module>
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions integration-tests-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<module>kafka</module>
<module>mongodb</module>
<module>process-executor-support</module>
<module>splunk</module>
<module>test-support</module>
<module>mock-backend</module>
<module>wiremock</module>
Expand Down
69 changes: 69 additions & 0 deletions integration-tests-support/splunk/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?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">
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-integration-tests-support</artifactId>
<version>3.8.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>camel-quarkus-integration-tests-support-splunk</artifactId>
<name>Camel Quarkus :: Integration Tests :: Support :: Splunk</name>

<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-integration-test-support</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit4-mock</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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.test.support.splunk;

public final class SplunkConstants {

public static final String PARAM_TEST_INDEX = "org.apache.camel.quarkus.component.splunk.hec.it.SplunkHecResource_testIndex";
public static final String PARAM_REMOTE_HOST = "org.apache.camel.quarkus.component.splunk.hec.it.SplunkHecResource_host";
public static final String PARAM_HEC_PORT = "org.apache.camel.quarkus.component.splunk.hec.it.SplunkHecResource_hecPort";
public static final String PARAM_HEC_TOKEN = "org.apache.camel.quarkus.component.splunk.hec.it.SplunkHecResource_hecToken";
public static final String PARAM_REMOTE_PORT = "org.apache.camel.quarkus.component.splunk.hec.it.SplunkHecResource_remotePort";
public static final String PARAM_TCP_PORT = "org.apache.camel.quarkus.component.splunk.it.SplunkResource_tcpPort";

public static final int TCP_PORT = 9998;

private SplunkConstants() {
// Utility class
}
}
Loading

0 comments on commit d072b53

Please sign in to comment.